org.apache.ignite.internal.processors.cache.distributed.near

## Class GridNearLockRequest

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheMessage
  - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage
    - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedLockRequest
      - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockRequest

All Implemented Interfaces:
  Serializable, GridCacheDeployable, GridCacheVersionable, Message

    public class GridNearLockRequest
    extends GridDistributedLockRequest

Near cache lock request.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedLockRequest

`idx`

### Fields inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage

`ver`

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheMessage

`CACHE_MSG_INDEX_FIELD_NAME, cacheId, MAX_CACHE_MSG_LOOKUP_INDEX`

### Constructor Summary

Constructors
Constructor and Description
`GridNearLockRequest()` Empty constructor required for `Externalizable`.

`GridNearLockRequest(int cacheId, AffinityTopologyVersion topVer, UUID nodeId, long threadId, IgniteUuid futId, GridCacheVersion lockVer, boolean isInTx, boolean implicitTx, boolean implicitSingleTx, boolean isRead, boolean retVal, TransactionIsolation isolation, boolean isInvalidate, long timeout, int keyCnt, int txSize, boolean syncCommit, UUID subjId, int taskNameHash, long accessTtl, boolean skipStore, boolean firstClientReq)`

### Method Summary

Methods
`long` `accessTtl()`
`void` `addKeyBytes(KeyCacheObject key, boolean retVal, GridCacheVersion dhtVer, GridCacheContext ctx)` Adds a key.
`GridCacheVersion` `dhtVersion(int idx)`
`byte` `directType()` Gets message type.
`byte` `fieldsCount()` Gets fields count.
`CacheEntryPredicate[]` `filter()`
`void` `filter(CacheEntryPredicate[] filter, GridCacheContext ctx)`
`void` `finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr)` This method is called after the message is deserialized and is responsible for unmarshalling state marshalled in `GridCacheMessage.prepareMarshal(GridCacheSharedContext)` method.
`boolean` `firstClientRequest()`
`boolean` `hasTransforms()`
`void` `hasTransforms(boolean hasTransforms)`
`boolean` `implicitSingleTx()`
`boolean` `implicitTx()`
`IgniteUuid` `miniId()`
`void` `miniId(IgniteUuid miniId)`
`boolean` `needReturnValue()`
`void` `prepareMarshal(GridCacheSharedContext ctx)` This method is called before the whole message is serialized and is responsible for pre-marshalling state.
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`UUID` `subjectId()`
`boolean` `syncCommit()`
`int` `taskNameHash()`
`AffinityTopologyVersion` `topologyVersion()` Gets topology version or -1 in case of topology version is not required for this message.
`String` `toString()`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

### Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedLockRequest

`addKeyBytes, futureId, inTx, isInvalidate, isolation, keys, nearXidVersion, nodeId, returnFlags, returnValue, skipStore, threadId, timeout, txRead, txSize`

### Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage

`candidatesByIndex, candidatesByIndex, committedVersions, completedVersions, keysCount, rolledbackVersions, version, version`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheMessage

`allowForStartup, cacheId, cacheId, classError, deployInfo, error, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lookupIndex, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onClassError, partitionExchangeMessage, prepare, prepareMarshalCacheObjects, prepareMarshalCacheObjects, prepareObject, transferExpiryPolicy, unmarshalCollection, unmarshalInfo, unmarshalInfos, unmarshalInvokeArguments, unmarshalTx`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.ignite.internal.processors.cache.GridCacheDeployable

`deployInfo, prepare`

### Constructor Detail

#### GridNearLockRequest

    public GridNearLockRequest()

Empty constructor required for `Externalizable`.

#### GridNearLockRequest

    public GridNearLockRequest(int cacheId,
                       @NotNull
                       AffinityTopologyVersion topVer,
                       UUID nodeId,
                       long threadId,
                       IgniteUuid futId,
                       GridCacheVersion lockVer,
                       boolean isInTx,
                       boolean implicitTx,
                       boolean implicitSingleTx,
                       boolean isRead,
                       boolean retVal,
                       TransactionIsolation isolation,
                       boolean isInvalidate,
                       long timeout,
                       int keyCnt,
                       int txSize,
                       boolean syncCommit,
                       @Nullable
                       UUID subjId,
                       int taskNameHash,
                       long accessTtl,
                       boolean skipStore,
                       boolean firstClientReq)

Parameters:
  `cacheId` - Cache ID.
  `topVer` - Topology version.
  `nodeId` - Node ID.
  `threadId` - Thread ID.
  `futId` - Future ID.
  `lockVer` - Cache version.
  `isInTx` - `True` if implicit transaction lock.
  `implicitTx` - Flag to indicate that transaction is implicit.
  `implicitSingleTx` - Implicit-transaction-with-one-key flag.
  `isRead` - Indicates whether implicit lock is for read or write operation.
  `retVal` - Return value flag.
  `isolation` - Transaction isolation.
  `isInvalidate` - Invalidation flag.
  `timeout` - Lock timeout.
  `keyCnt` - Number of keys.
  `txSize` - Expected transaction size.
  `syncCommit` - Synchronous commit flag.
  `subjId` - Subject ID.
  `taskNameHash` - Task name hash code.
  `accessTtl` - TTL for read operation.
  `skipStore` - Skip store flag.
  `firstClientReq` - `True` if first lock request for lock operation sent from client node.

### Method Detail

#### firstClientRequest

    public boolean firstClientRequest()

Returns:
  `True` if first lock request for lock operation sent from client node.

#### topologyVersion

    public AffinityTopologyVersion topologyVersion()

Description copied from class: `GridCacheMessage`
Gets topology version or -1 in case of topology version is not required for this message.

Overrides:
  `topologyVersion` in class `GridCacheMessage`
Returns:
  Topology version.

#### subjectId

    public UUID subjectId()

Returns:
  Subject ID.

#### taskNameHash

    public int taskNameHash()

Returns:
  Task name hash.q

#### implicitTx

    public boolean implicitTx()

Returns:
  Implicit transaction flag.

#### implicitSingleTx

    public boolean implicitSingleTx()

Returns:
  Implicit-transaction-with-one-key flag.

#### syncCommit

    public boolean syncCommit()

Returns:
  Sync commit flag.

#### filter

    public CacheEntryPredicate[] filter()

Returns:
  Filter.

#### filter

    public void filter(CacheEntryPredicate[] filter,
              GridCacheContext ctx)
                throws IgniteCheckedException

Parameters:
  `filter` - Filter.
  `ctx` - Context.
Throws:
  `IgniteCheckedException` - If failed.

#### miniId

    public IgniteUuid miniId()

Returns:
  Mini future ID.

#### miniId

    public void miniId(IgniteUuid miniId)

Parameters:
  `miniId` - Mini future Id.

#### hasTransforms

    public void hasTransforms(boolean hasTransforms)

Parameters:
  `hasTransforms` - `True` if originating transaction has transform entries.

#### hasTransforms

    public boolean hasTransforms()

Returns:
  `True` if originating transaction has transform entries.

#### needReturnValue

    public boolean needReturnValue()

Returns:
  Need return value flag.

#### addKeyBytes

    public void addKeyBytes(KeyCacheObject key,
                   boolean retVal,
                   @Nullable
                   GridCacheVersion dhtVer,
                   GridCacheContext ctx)
                     throws IgniteCheckedException

Adds a key.

Parameters:
  `key` - Key.
  `retVal` - Flag indicating whether value should be returned.
  `dhtVer` - DHT version.
  `ctx` - Context.
Throws:
  `IgniteCheckedException` - If failed.

#### dhtVersion

    public GridCacheVersion dhtVersion(int idx)

Parameters:
  `idx` - Index of the key.
Returns:
  DHT version for key at given index.

#### accessTtl

    public long accessTtl()

Returns:
  TTL for read operation.

#### prepareMarshal

    public void prepareMarshal(GridCacheSharedContext ctx)
                        throws IgniteCheckedException

This method is called before the whole message is serialized and is responsible for pre-marshalling state.

Overrides:
  `prepareMarshal` in class `GridDistributedLockRequest`
Parameters:
  `ctx` - Cache context.
Throws:
  `IgniteCheckedException` - If failed.

#### finishUnmarshal

    public void finishUnmarshal(GridCacheSharedContext ctx,
                       ClassLoader ldr)
                         throws IgniteCheckedException

This method is called after the message is deserialized and is responsible for unmarshalling state marshalled in `GridCacheMessage.prepareMarshal(GridCacheSharedContext)` method.

Overrides:
  `finishUnmarshal` in class `GridDistributedLockRequest`
Parameters:
  `ctx` - Context.
  `ldr` - Class loader.
Throws:
  `IgniteCheckedException` - If failed.

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                  MessageWriter writer)

Writes this message to provided byte buffer.

Specified by:
  `writeTo` in interface `Message`
Overrides:
  `writeTo` in class `GridDistributedLockRequest`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf,
                   MessageReader reader)

Reads this message from provided byte buffer.

Specified by:
  `readFrom` in interface `Message`
Overrides:
  `readFrom` in class `GridDistributedLockRequest`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### directType

    public byte directType()

Gets message type.

Specified by:
  `directType` in interface `Message`
Overrides:
  `directType` in class `GridDistributedLockRequest`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

Specified by:
  `fieldsCount` in interface `Message`
Overrides:
  `fieldsCount` in class `GridDistributedLockRequest`
Returns:
  Fields count.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDistributedLockRequest`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.4.0
Release Date | : September 24 2015