Class GridCacheQueryResponse
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.GridCacheMessage
-
- org.apache.ignite.internal.processors.cache.GridCacheIdMessage
-
- org.apache.ignite.internal.processors.cache.query.GridCacheQueryResponse
-
- All Implemented Interfaces:
Serializable,GridCacheDeployable,Message
public class GridCacheQueryResponse extends GridCacheIdMessage implements GridCacheDeployable
Page of cache query response.- 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 Description GridCacheQueryResponse()Empty constructor forExternalizableGridCacheQueryResponse(int cacheId, long reqId, boolean finished, boolean fields, boolean addDepInfo)GridCacheQueryResponse(int cacheId, long reqId, Throwable err, boolean addDepInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddDeploymentInfo()Deployment enabled flag indicates whether deployment info has to be added to this message.Collection<Object>data()voiddata(Collection<?> data)shortdirectType()Gets message type.Throwableerror()booleanfields()bytefieldsCount()Gets fields count.voidfinished(boolean finished)voidfinishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr)This method is called after the message is deserialized and is responsible for unmarshalling state marshalled inGridCacheMessage.prepareMarshal(GridCacheSharedContext)method.IndexQueryResultMetaidxQryMetadata()voididxQryMetadata(IndexQueryResultMeta idxQryMetadata)booleanisFinished()List<GridQueryFieldMetadata>metadata()voidmetadata(@Nullable List<GridQueryFieldMetadata> metadata)voidprepareMarshal(GridCacheSharedContext ctx)This method is called before the whole message is serialized and is responsible for pre-marshalling state.booleanreadFrom(ByteBuffer buf, MessageReader reader)Reads this message from provided byte buffer.longrequestId()StringtoString()protected <T> @Nullable List<T>unmarshalCollection0(@Nullable Collection<byte[]> byteCol, GridCacheSharedContext ctx, ClassLoader ldr)booleanwriteTo(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, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lastAffinityChangedTopologyVersion, lastAffinityChangedTopologyVersion, lookupIndex, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, messageLogger, 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
-
GridCacheQueryResponse
public GridCacheQueryResponse()
Empty constructor forExternalizable
-
GridCacheQueryResponse
public GridCacheQueryResponse(int cacheId, long reqId, boolean finished, boolean fields, boolean addDepInfo)- Parameters:
cacheId- Cache ID.reqId- Request id.finished- Last response or not.fields- Fields query or not.addDepInfo- Deployment info flag.
-
GridCacheQueryResponse
public GridCacheQueryResponse(int cacheId, long reqId, Throwable err, boolean addDepInfo)- Parameters:
cacheId- Cache ID.reqId- Request id.err- Error.addDepInfo- Deployment info flag.
-
-
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:
prepareMarshalin classGridCacheMessage- 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 inGridCacheMessage.prepareMarshal(GridCacheSharedContext)method.- Overrides:
finishUnmarshalin classGridCacheMessage- Parameters:
ctx- Context.ldr- Class loader.- Throws:
IgniteCheckedException- If failed.
-
unmarshalCollection0
@Nullable protected <T> @Nullable List<T> unmarshalCollection0(@Nullable @Nullable Collection<byte[]> byteCol, GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException
- Parameters:
byteCol- Collection to unmarshal.ctx- Context.ldr- Loader.- Returns:
- Unmarshalled collection.
- Throws:
IgniteCheckedException- If failed.
-
addDeploymentInfo
public boolean addDeploymentInfo()
Deployment enabled flag indicates whether deployment info has to be added to this message.- Specified by:
addDeploymentInfoin classGridCacheMessage- Returns:
trueor if deployment info must be added to the the message,falseotherwise.
-
metadata
public List<GridQueryFieldMetadata> metadata()
- Returns:
- Metadata.
-
idxQryMetadata
public IndexQueryResultMeta idxQryMetadata()
- Returns:
- IndexQuery metadata.
-
metadata
public void metadata(@Nullable @Nullable List<GridQueryFieldMetadata> metadata)- Parameters:
metadata- Metadata.
-
idxQryMetadata
public void idxQryMetadata(IndexQueryResultMeta idxQryMetadata)
- Parameters:
idxQryMetadata- IndexQuery metadata.
-
data
public Collection<Object> data()
- Returns:
- Query data.
-
data
public void data(Collection<?> data)
- Parameters:
data- Query data.
-
isFinished
public boolean isFinished()
- Returns:
- If this is last response for this request or not.
-
finished
public void finished(boolean finished)
- Parameters:
finished- If this is last response for this request or not.
-
requestId
public long requestId()
- Returns:
- Request id.
-
error
public Throwable error()
- Overrides:
errorin classGridCacheMessage- Returns:
- Error, if any.
-
fields
public boolean fields()
- Returns:
- If fields query.
-
writeTo
public boolean writeTo(ByteBuffer buf, MessageWriter writer)
Writes this message to provided byte buffer.- Specified by:
writeToin interfaceMessage- Overrides:
writeToin classGridCacheIdMessage- 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:
readFromin interfaceMessage- Overrides:
readFromin classGridCacheIdMessage- Parameters:
buf- Byte buffer.reader- Reader.- Returns:
- Whether message was fully read.
-
directType
public short directType()
Gets message type.- Specified by:
directTypein interfaceMessage- Returns:
- Message type.
-
fieldsCount
public byte fieldsCount()
Gets fields count.- Specified by:
fieldsCountin interfaceMessage- Overrides:
fieldsCountin classGridCacheIdMessage- Returns:
- Fields count.
-
toString
public String toString()
- Overrides:
toStringin classGridCacheIdMessage
-
-