org.apache.ignite.internal.processors.cache.query

## Class GridCacheQueryRequest

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheMessage
  - - org.apache.ignite.internal.processors.cache.query.GridCacheQueryRequest

All Implemented Interfaces:
  Serializable, GridCacheDeployable, Message

    public class GridCacheQueryRequest
    extends GridCacheMessage
    implements GridCacheDeployable

Query request.

See Also:
  Serialized Form

### Field Summary

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

`addDepInfo, CACHE_MSG_INDEX_FIELD_NAME, cacheId, forceAddDepInfo, MAX_CACHE_MSG_LOOKUP_INDEX`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheQueryRequest()` Required by `Externalizable`
`GridCacheQueryRequest(int cacheId, long id, boolean fields, AffinityTopologyVersion topVer, boolean addDepInfo)` Creates cancel query request.

`GridCacheQueryRequest(int cacheId, long id, String cacheName, GridCacheQueryType type, boolean fields, String clause, String clsName, IgniteBiPredicate<Object,Object> keyValFilter, Integer part, IgniteReducer<Object,Object> rdc, IgniteClosure<Object,Object> trans, int pageSize, boolean incBackups, Object[] args, boolean incMeta, boolean keepBinary, UUID subjId, int taskHash, AffinityTopologyVersion topVer, boolean addDepInfo)`

`GridCacheQueryRequest(int cacheId, long id, String cacheName, int pageSize, boolean incBackups, boolean fields, boolean all, boolean keepBinary, UUID subjId, int taskHash, AffinityTopologyVersion topVer, boolean addDepInfo)` Request to load page.

### Method Summary

Methods
`boolean` `addDeploymentInfo()` Deployment enabled flag indicates whether deployment info has to be added to this message.
`boolean` `allPages()`
`Object[]` `arguments()`
`String` `cacheName()`
`boolean` `cancel()`
`String` `className()`
`String` `clause()`
`byte` `directType()` Gets message type.
`boolean` `fields()`
`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.
`long` `id()`
`boolean` `includeBackups()`
`boolean` `includeMetaData()`
`boolean` `keepBinary()`
`IgniteBiPredicate<Object,Object>` `keyValueFilter()`
`int` `pageSize()`
`Integer` `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.
`IgniteReducer<Object,Object>` `reducer()`
`UUID` `subjectId()`
`int` `taskHash()`
`AffinityTopologyVersion` `topologyVersion()` Gets topology version or -1 in case of topology version is not required for this message.
`String` `toString()`
`IgniteClosure<Object,Object>` `transformer()`
`GridCacheQueryType` `type()`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

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

`cacheId, cacheId, classError, deployInfo, error, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lookupIndex, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, nextIndexId, onAckReceived, onClassError, partitionExchangeMessage, prepare, prepareMarshalCacheObject, 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

#### GridCacheQueryRequest

    public GridCacheQueryRequest()

Required by `Externalizable`

#### GridCacheQueryRequest

    public GridCacheQueryRequest(int cacheId,
                         long id,
                         boolean fields,
                         AffinityTopologyVersion topVer,
                         boolean addDepInfo)

Creates cancel query request.

Parameters:
  `cacheId` - Cache ID.
  `id` - Request to cancel.
  `fields` - Fields query flag.
  `topVer` - Topology version.
  `addDepInfo` - Deployment info flag.

#### GridCacheQueryRequest

    public GridCacheQueryRequest(int cacheId,
                         long id,
                         String cacheName,
                         int pageSize,
                         boolean incBackups,
                         boolean fields,
                         boolean all,
                         boolean keepBinary,
                         UUID subjId,
                         int taskHash,
                         AffinityTopologyVersion topVer,
                         boolean addDepInfo)

Request to load page.

Parameters:
  `cacheId` - Cache ID.
  `id` - Request ID.
  `cacheName` - Cache name.
  `pageSize` - Page size.
  `incBackups` - `true` if need to include backups.
  `fields` - Fields query flag.
  `all` - Whether to load all pages.
  `keepBinary` - Whether to keep binary.
  `subjId` - Subject ID.
  `taskHash` - Task name hash code.
  `topVer` - Topology version.
  `addDepInfo` - Deployment info flag.

#### GridCacheQueryRequest

    public GridCacheQueryRequest(int cacheId,
                         long id,
                         String cacheName,
                         GridCacheQueryType type,
                         boolean fields,
                         String clause,
                         String clsName,
                         IgniteBiPredicate<Object,Object> keyValFilter,
                         @Nullable
                         Integer part,
                         IgniteReducer<Object,Object> rdc,
                         IgniteClosure<Object,Object> trans,
                         int pageSize,
                         boolean incBackups,
                         Object[] args,
                         boolean incMeta,
                         boolean keepBinary,
                         UUID subjId,
                         int taskHash,
                         AffinityTopologyVersion topVer,
                         boolean addDepInfo)

Parameters:
  `cacheId` - Cache ID.
  `id` - Request id.
  `cacheName` - Cache name.
  `type` - Query type.
  `fields` - `true` if query returns fields.
  `clause` - Query clause.
  `clsName` - Query class name.
  `keyValFilter` - Key-value filter.
  `part` - Partition.
  `rdc` - Reducer.
  `trans` - Transformer.
  `pageSize` - Page size.
  `incBackups` - `true` if need to include backups.
  `args` - Query arguments.
  `incMeta` - Include meta data or not.
  `keepBinary` - Keep binary flag.
  `subjId` - Subject ID.
  `taskHash` - Task name hash code.
  `topVer` - Topology version.
  `addDepInfo` - Deployment info flag.

### Method Detail

#### topologyVersion

    public AffinityTopologyVersion topologyVersion()

Gets topology version or -1 in case of topology version is not required for this message.

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

#### 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 `GridCacheMessage`
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 `GridCacheMessage`
Parameters:
  `ctx` - Context.
  `ldr` - Class 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.

#### id

    public long id()

Returns:
  Request id.

#### cacheName

    public String cacheName()

Returns:
  Cache name.

#### type

    public GridCacheQueryType type()

Returns:
  Query type.

#### fields

    public boolean fields()

Returns:
  `true` if query returns fields.

#### clause

    public String clause()

Returns:
  Query clause.

#### className

    public String className()

Returns:
  Class name.

#### includeBackups

    public boolean includeBackups()

Returns:
  Flag indicating whether to include backups.

#### cancel

    public boolean cancel()

Returns:
  Flag indicating that this is cancel request.

#### keyValueFilter

    public IgniteBiPredicate<Object,Object> keyValueFilter()

Returns:
  Key-value filter.

#### reducer

    public IgniteReducer<Object,Object> reducer()

Returns:
  Reducer.

#### transformer

    public IgniteClosure<Object,Object> transformer()

Returns:
  Transformer.

#### pageSize

    public int pageSize()

Returns:
  Page size.

#### arguments

    public Object[] arguments()

Returns:
  Arguments.

#### includeMetaData

    public boolean includeMetaData()

Returns:
  Include meta data or not.

#### allPages

    public boolean allPages()

Returns:
  Whether to load all pages.

#### keepBinary

    public boolean keepBinary()

Returns:
  Whether to keep binary.

#### subjectId

    public UUID subjectId()

Returns:
  Security subject ID.

#### taskHash

    public int taskHash()

Returns:
  Task hash.

#### partition

    @Nullable
    public Integer partition()

Returns:
  partition.

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

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

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

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCacheMessage`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.6.0
Release Date | : May 18 2016