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

## Class GridNearLockResponse

- 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.GridDistributedLockResponse
      - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockResponse

All Implemented Interfaces:
  Serializable, GridCacheDeployable, GridCacheVersionable, Message

    public class GridNearLockResponse
    extends GridDistributedLockResponse

Near cache lock response.

See Also:
  Serialized Form

### Field Summary

### 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
`GridNearLockResponse()` Empty constructor (required by `Externalizable`).
`GridNearLockResponse(int cacheId, GridCacheVersion lockVer, IgniteUuid futId, IgniteUuid miniId, boolean filterRes, int cnt, Throwable err)`

### Method Summary

Methods
`void` `addValueBytes(CacheObject val, boolean filterPassed, GridCacheVersion dhtVer, GridCacheVersion mappedVer)`
`GridCacheVersion` `dhtVersion(int idx)`
`byte` `directType()` Gets message type.
`byte` `fieldsCount()` Gets fields count.
`boolean` `filterResult(int idx)` Gets filter evaluation result for fast-commit transaction.
`GridCacheVersion` `mappedVersion(int idx)` Returns DHT candidate version for acquired near lock on DHT node.
`IgniteUuid` `miniId()`
`Collection<GridCacheVersion>` `pending()` Gets pending versions that are less than `GridDistributedBaseMessage.version()`.
`void` `pending(Collection<GridCacheVersion> pending)` Sets pending versions that are less than `GridDistributedBaseMessage.version()`.
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`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.GridDistributedLockResponse

`addValue, error, error, finishUnmarshal, futureId, isCurrentlyLocked, prepareMarshal, setCandidates, value, valuesSize`

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

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

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

`allowForStartup, cacheId, cacheId, classError, deployInfo, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lookupIndex, marshalBooleanLinkedMap, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onClassError, partitionExchangeMessage, prepare, prepareMarshalCacheObjects, prepareMarshalCacheObjects, prepareObject, topologyVersion, transferExpiryPolicy, unmarshalBooleanLinkedMap, 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

#### GridNearLockResponse

    public GridNearLockResponse()

Empty constructor (required by `Externalizable`).

#### GridNearLockResponse

    public GridNearLockResponse(int cacheId,
                        GridCacheVersion lockVer,
                        IgniteUuid futId,
                        IgniteUuid miniId,
                        boolean filterRes,
                        int cnt,
                        Throwable err)

Parameters:
  `cacheId` - Cache ID.
  `lockVer` - Lock ID.
  `futId` - Future ID.
  `miniId` - Mini future ID.
  `filterRes` - `True` if need to allocate array for filter evaluation results.
  `cnt` - Count.
  `err` - Error.

### Method Detail

#### pending

    public Collection<GridCacheVersion> pending()

Gets pending versions that are less than `GridDistributedBaseMessage.version()`.

Returns:
  Pending versions.

#### pending

    public void pending(Collection<GridCacheVersion> pending)

Sets pending versions that are less than `GridDistributedBaseMessage.version()`.

Parameters:
  `pending` - Pending versions.

#### miniId

    public IgniteUuid miniId()

Returns:
  Mini future ID.

#### dhtVersion

    public GridCacheVersion dhtVersion(int idx)

Parameters:
  `idx` - Index.
Returns:
  DHT version.

#### mappedVersion

    public GridCacheVersion mappedVersion(int idx)

Returns DHT candidate version for acquired near lock on DHT node.

Parameters:
  `idx` - Key index.
Returns:
  DHT version.

#### filterResult

    public boolean filterResult(int idx)

Gets filter evaluation result for fast-commit transaction.

Parameters:
  `idx` - Result index.
Returns:
  `True` if filter passed on primary node, `false` otherwise.

#### addValueBytes

    public void addValueBytes(@Nullable
                     CacheObject val,
                     boolean filterPassed,
                     @Nullable
                     GridCacheVersion dhtVer,
                     @Nullable
                     GridCacheVersion mappedVer)
                       throws IgniteCheckedException

Parameters:
  `val` - Value.
  `filterPassed` - Boolean flag indicating whether filter passed for fast-commit transaction.
  `dhtVer` - DHT version.
  `mappedVer` - Mapped version.
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 `GridDistributedLockResponse`
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 `GridDistributedLockResponse`
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 `GridDistributedLockResponse`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

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

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDistributedLockResponse`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.1.0-incubating
Release Date | : May 20 2015