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

## Class GridNearGetRequest

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheMessage
  - - org.apache.ignite.internal.processors.cache.GridCacheIdMessage
    - - org.apache.ignite.internal.processors.cache.distributed.near.GridNearGetRequest

All Implemented Interfaces:
  Serializable, GridCacheDeployable, GridCacheVersionable, Message

    public class GridNearGetRequest
    extends GridCacheIdMessage
    implements GridCacheDeployable, GridCacheVersionable

Get request. Responsible for obtaining entry from primary node. 'Near' means 'Primary' here, not 'Near Cache'.

See Also:
  Serialized Form

### Field Summary

Fields
`static int` `RECOVERY_FLAG_MASK`

### 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
`GridNearGetRequest()` Empty constructor required for `Externalizable`.
`GridNearGetRequest(int cacheId, IgniteUuid futId, IgniteUuid miniId, GridCacheVersion ver, Map<KeyCacheObject,Boolean> keys, boolean readThrough, AffinityTopologyVersion topVer, UUID subjId, int taskNameHash, long createTtl, long accessTtl, boolean addReader, boolean skipVals, boolean addDepInfo, boolean recovery)`

### Method Summary

Methods
`long` `accessTtl()`
`boolean` `addDeploymentInfo()` Deployment enabled flag indicates whether deployment info has to be added to this message.
`boolean` `addReaders()`
`long` `createTtl()`
`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.
`IgniteUuid` `futureId()`
`LinkedHashMap<KeyCacheObject,Boolean>` `keys()`
`IgniteUuid` `miniId()`
`int` `partition()`
`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.
`boolean` `readThrough()`
`boolean` `recovery()`
`boolean` `skipValues()`
`UUID` `subjectId()`
`int` `taskNameHash()` Gets task name hash.
`AffinityTopologyVersion` `topologyVersion()` Gets topology version or -1 in case of topology version is not required for this message.
`String` `toString()`
`GridCacheVersion` `version()`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

### 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, error, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lookupIndex, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, messageLogger, nextIndexId, onAckReceived, onClassError, partitionExchangeMessage, prepare, prepareMarshalCacheObject, prepareMarshalCacheObjects, prepareMarshalCacheObjects, prepareObject, 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`

### Field Detail

#### RECOVERY_FLAG_MASK

    public static final int RECOVERY_FLAG_MASK

See Also:
  Constant Field Values

### Constructor Detail

#### GridNearGetRequest

    public GridNearGetRequest()

Empty constructor required for `Externalizable`.

#### GridNearGetRequest

    public GridNearGetRequest(int cacheId,
                      IgniteUuid futId,
                      IgniteUuid miniId,
                      GridCacheVersion ver,
                      Map<KeyCacheObject,Boolean> keys,
                      boolean readThrough,
                      @NotNull
                      AffinityTopologyVersion topVer,
                      UUID subjId,
                      int taskNameHash,
                      long createTtl,
                      long accessTtl,
                      boolean addReader,
                      boolean skipVals,
                      boolean addDepInfo,
                      boolean recovery)

Parameters:
  `cacheId` - Cache ID.
  `futId` - Future ID.
  `miniId` - Sub ID.
  `ver` - Version.
  `keys` - Keys.
  `readThrough` - Read through flag.
  `skipVals` - Skip values flag. When false, only boolean values will be returned indicating whether cache entry has a value.
  `topVer` - Topology version.
  `subjId` - Subject ID.
  `taskNameHash` - Task name hash.
  `createTtl` - New TTL to set after entry is created, -1 to leave unchanged.
  `accessTtl` - New TTL to set after entry is accessed, -1 to leave unchanged.
  `addDepInfo` - Deployment info.

### Method Detail

#### futureId

    public IgniteUuid futureId()

Returns:
  Future ID.

#### miniId

    public IgniteUuid miniId()

Returns:
  Sub ID.

#### subjectId

    public UUID subjectId()

Returns:
  Subject ID.

#### taskNameHash

    public int taskNameHash()

Gets task name hash.

Returns:
  Task name hash.

#### version

    public GridCacheVersion version()

Specified by:
  `version` in interface `GridCacheVersionable`
Returns:
  Version.

#### keys

    public LinkedHashMap<KeyCacheObject,Boolean> keys()

Returns:
  Keys

#### readThrough

    public boolean readThrough()

Returns:
  Read through flag.

#### skipValues

    public boolean skipValues()

Returns:
  Skip values flag. If true, boolean values indicating whether cache entry has a value will be returned as future result.

#### recovery

    public boolean recovery()

Returns:
  Recovery flag.

#### addReaders

    public boolean addReaders()

#### 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.

#### createTtl

    public long createTtl()

Returns:
  New TTL to set after entry is created, -1 to leave unchanged.

#### accessTtl

    public long accessTtl()

Returns:
  New TTL to set after entry is accessed, -1 to leave unchanged.

#### partition

    public int partition()

Overrides:
  `partition` in class `GridCacheMessage`
Returns:
  Partition ID this message is targeted to or `-1` if it cannot be determined.

#### prepareMarshal

    public void prepareMarshal(GridCacheSharedContext ctx)
                        throws IgniteCheckedException

Description copied from class: `GridCacheMessage`
This method is called before the whole message is serialized and is responsible for pre-marshalling state.

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

#### finishUnmarshal

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

Description copied from class: `GridCacheMessage`
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 `GridCacheMessage`
Parameters:
  `ctx` - Context.
  `ldr` - Loader.
Throws:
  `IgniteCheckedException` - If failed.

#### addDeploymentInfo

    public boolean addDeploymentInfo()

Deployment enabled flag indicates whether deployment info has to be added to this message.

Specified by:
  `addDeploymentInfo` in class `GridCacheMessage`
Returns:
  `true` or if deployment info must be added to the the message, `false` otherwise.

#### 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 `GridCacheIdMessage`
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 `GridCacheIdMessage`
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`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

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

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCacheIdMessage`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.2.0
Release Date | : September 15 2017