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

`CACHE_MSG_INDEX_FIELD_NAME, cacheId, MAX_CACHE_MSG_LOOKUP_INDEX`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheQueryRequest()` Required by `Externalizable`
`GridCacheQueryRequest(int cacheId, long id, boolean fields)`
`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 keepPortable, UUID subjId, int taskHash)`
`GridCacheQueryRequest(int cacheId, long id, String cacheName, int pageSize, boolean incBackups, boolean fields, boolean all, boolean keepPortable, UUID subjId, int taskHash)` Request to load page.

### Method Summary

Methods
`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` `keepPortable()`
`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()`
`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

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

#### GridCacheQueryRequest

    public GridCacheQueryRequest()

Required by `Externalizable`

#### GridCacheQueryRequest

    public GridCacheQueryRequest(int cacheId,
                         long id,
                         boolean fields)

Parameters:
  `id` - Request to cancel.
  `fields` - Fields query flag.

#### GridCacheQueryRequest

    public GridCacheQueryRequest(int cacheId,
                         long id,
                         String cacheName,
                         int pageSize,
                         boolean incBackups,
                         boolean fields,
                         boolean all,
                         boolean keepPortable,
                         UUID subjId,
                         int taskHash)

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.
  `keepPortable` - Whether to keep portables.

#### 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 keepPortable,
                         UUID subjId,
                         int taskHash)

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.

### Method Detail

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

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

#### keepPortable

    public boolean keepPortable()

Returns:
  Whether to keep portables.

#### 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.2.0-incubating
Release Date | : June 16 2015