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.GridCacheIdMessage
    - - org.apache.ignite.internal.processors.cache.query.GridCacheQueryRequest

All Implemented Interfaces:
  Serializable, GridCacheDeployable, Message

    public class GridCacheQueryRequest
    extends GridCacheIdMessage
    implements GridCacheDeployable

Query request.

See Also:
  Serialized Form

### Field Summary

### 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
`GridCacheQueryRequest()` Required by `Externalizable`

### Method Summary

All Methods Static Methods Instance Methods Concrete 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()`
`static GridCacheQueryRequest` `cancelRequest(GridCacheContext<?,?> cctx, long reqId, boolean fieldsQry)` Send cancel query request, so no new pages will be sent.
`String` `className()`
`String` `clause()`
`short` `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()`
`IndexQueryDesc` `idxQryDesc()`
`boolean` `includeBackups()`
`boolean` `includeMetaData()`
`Boolean` `isDataPageScanEnabled()`
`boolean` `keepBinary()`
`IgniteBiPredicate<Object,Object>` `keyValueFilter()`
`int` `limit()`
`static GridCacheQueryRequest` `pageRequest(GridCacheContext<?,?> cctx, long reqId, GridCacheQueryAdapter<?> qry, boolean fields)` Send request for fetching query result pages to specified nodes.
`int` `pageSize()`
`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.
`IgniteReducer<Object,Object>` `reducer()`
`static GridCacheQueryRequest` `startQueryRequest(GridCacheContext<?,?> cctx, long reqId, GridCacheDistributedQueryFuture<?,?,?> fut)` Send initial query request to specified nodes.
`int` `taskHash()`
`AffinityTopologyVersion` `topologyVersion()` Gets topology version or -1 in case of topology version is not required for this message.
`String` `toString()`
`IgniteClosure<?,?>` `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.GridCacheIdMessage

`cacheGroupMessage, cacheId, cacheId, handlerId`

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

`appendFlag, classError, deployInfo, error, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lastAffinityChangedTopologyVersion, lastAffinityChangedTopologyVersion, 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`

### Constructor Detail

#### GridCacheQueryRequest

    public GridCacheQueryRequest()

Required by `Externalizable`

### Method Detail

#### startQueryRequest

    public static GridCacheQueryRequest startQueryRequest(GridCacheContext<?,?> cctx,
                                                          long reqId,
                                                          GridCacheDistributedQueryFuture<?,?,?> fut)

Send initial query request to specified nodes.

Parameters:
  `reqId` - Request (cache query) ID.
  `fut` - Cache query future, contains query info.

#### pageRequest

    public static GridCacheQueryRequest pageRequest(GridCacheContext<?,?> cctx,
                                                    long reqId,
                                                    GridCacheQueryAdapter<?> qry,
                                                    boolean fields)

Send request for fetching query result pages to specified nodes.

Parameters:
  `reqId` - Request (cache query) ID.

#### cancelRequest

    public static GridCacheQueryRequest cancelRequest(GridCacheContext<?,?> cctx,
                                                      long reqId,
                                                      boolean fieldsQry)

Send cancel query request, so no new pages will be sent.

Parameters:
  `reqId` - Query request ID.
  `fieldsQry` - Whether query is a fields query.

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

#### limit

    public int limit()

Returns:
  Query limit.

#### clause

    public String clause()

Returns:
  Query clause.

#### idxQryDesc

    public IndexQueryDesc idxQryDesc()

Returns:
  Index query description.

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

#### taskHash

    public int taskHash()

Returns:
  Task hash.

#### isDataPageScanEnabled

    public Boolean isDataPageScanEnabled()

Returns:
  Flag to enable data page scan.

#### partition

    public int partition()

Overrides:
  `partition` in class `GridCacheMessage`
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 `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`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023