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

## Class GridDhtLockResponse

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheMessage
  - - org.apache.ignite.internal.processors.cache.GridCacheIdMessage
    - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedBaseMessage
      - - org.apache.ignite.internal.processors.cache.distributed.GridDistributedLockResponse
        - - org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLockResponse

All Implemented Interfaces:
  Serializable, GridCacheDeployable, GridCacheVersionable, Message

    public class GridDhtLockResponse
    extends GridDistributedLockResponse

DHT 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.GridCacheIdMessage

`cacheId`

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

`addDepInfo, CACHE_MSG_INDEX_FIELD_NAME, forceAddDepInfo, MAX_CACHE_MSG_LOOKUP_INDEX`

### Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message

`DIRECT_TYPE_SIZE`

### Constructor Summary

Constructors
Constructor and Description
`GridDhtLockResponse()` Empty constructor (required by `Externalizable`).
`GridDhtLockResponse(int cacheId, GridCacheVersion lockVer, IgniteUuid futId, IgniteUuid miniId, int cnt, boolean addDepInfo)`
`GridDhtLockResponse(int cacheId, GridCacheVersion lockVer, IgniteUuid futId, IgniteUuid miniId, Throwable err, boolean addDepInfo)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addInvalidPartition(int part)`
`void` `addPreloadEntry(GridCacheEntryInfo info)` Adds preload entry to lock response.
`short` `directType()` Gets message type.
`byte` `fieldsCount()` Gets fields count.
`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.
`Collection<Integer>` `invalidPartitions()`
`IgniteUuid` `miniId()`
`Collection<IgniteTxKey>` `nearEvicted()`
`void` `nearEvicted(Collection<IgniteTxKey> nearEvicted)`
`Collection<GridCacheEntryInfo>` `preloadEntries()` Gets preload entries returned from backup.
`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.
`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, futureId, messageLogger, value, valuesSize`

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

`addDeploymentInfo, committedVersions, completedVersions, rolledbackVersions, version, version`

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

`cacheGroupMessage, cacheId, cacheId, handlerId`

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

`appendFlag, classError, deployInfo, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lookupIndex, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onAckReceived, onClassError, partition, partitionExchangeMessage, prepare, prepareMarshalCacheObject, prepareMarshalCacheObjects, prepareMarshalCacheObjects, prepareObject, prepareObject, topologyVersion, 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

#### GridDhtLockResponse

    public GridDhtLockResponse()

Empty constructor (required by `Externalizable`).

#### GridDhtLockResponse

    public GridDhtLockResponse(int cacheId,
                               GridCacheVersion lockVer,
                               IgniteUuid futId,
                               IgniteUuid miniId,
                               int cnt,
                               boolean addDepInfo)

Parameters:
  `lockVer` - Lock version.
  `futId` - Future ID.
  `miniId` - Mini future ID.
  `cnt` - Key count.
  `addDepInfo` - Deployment info.

#### GridDhtLockResponse

    public GridDhtLockResponse(int cacheId,
                               GridCacheVersion lockVer,
                               IgniteUuid futId,
                               IgniteUuid miniId,
                               Throwable err,
                               boolean addDepInfo)

Parameters:
  `lockVer` - Lock ID.
  `futId` - Future ID.
  `miniId` - Mini future ID.
  `err` - Error.
  `addDepInfo` -

### Method Detail

#### nearEvicted

    public Collection<IgniteTxKey> nearEvicted()

Returns:
  Evicted readers.

#### nearEvicted

    public void nearEvicted(Collection<IgniteTxKey> nearEvicted)

Parameters:
  `nearEvicted` - Evicted readers.

#### miniId

    public IgniteUuid miniId()

Returns:
  Mini future ID.

#### addInvalidPartition

    public void addInvalidPartition(int part)

Parameters:
  `part` - Invalid partition.

#### invalidPartitions

    public Collection<Integer> invalidPartitions()

Returns:
  Invalid partitions.

#### addPreloadEntry

    public void addPreloadEntry(GridCacheEntryInfo info)

Adds preload entry to lock response.

Parameters:
  `info` - Info to add.

#### preloadEntries

    public Collection<GridCacheEntryInfo> preloadEntries()

Gets preload entries returned from backup.

Returns:
  Collection of preload entries.

#### 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 `GridDistributedLockResponse`
Parameters:
  `ctx` -
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 `GridDistributedLockResponse`
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 `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 short 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`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019