public abstract class GridCacheMessage extends Object implements Message
Modifier and Type | Field and Description |
---|---|
protected boolean |
addDepInfo |
static String |
CACHE_MSG_INDEX_FIELD_NAME
Cache message index field name.
|
protected boolean |
forceAddDepInfo
Force addition of deployment info regardless of
addDepInfo flag value. |
static int |
MAX_CACHE_MSG_LOOKUP_INDEX
Maximum number of cache lookup indexes.
|
DIRECT_TYPE_SIZE
Constructor and Description |
---|
GridCacheMessage() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
addDeploymentInfo()
Deployment enabled flag indicates whether deployment info has to be added to this message.
|
protected void |
appendFlag(StringBuilder str,
String name) |
abstract boolean |
cacheGroupMessage() |
IgniteCheckedException |
classError() |
GridDeploymentInfo |
deployInfo() |
@Nullable Throwable |
error() |
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
prepareMarshal(GridCacheSharedContext) method. |
protected void |
finishUnmarshalCacheObjects(@Nullable Collection<? extends CacheObject> col,
GridCacheContext ctx,
ClassLoader ldr) |
void |
finishUnmarshalCacheObjects(@Nullable List<? extends CacheObject> col,
GridCacheContext ctx,
ClassLoader ldr) |
abstract int |
handlerId() |
boolean |
ignoreClassErrors() |
AffinityTopologyVersion |
lastAffinityChangedTopologyVersion()
Returns the earliest affinity topology version for which this message is valid.
|
void |
lastAffinityChangedTopologyVersion(AffinityTopologyVersion topVer)
Sets the earliest affinity topology version for which this message is valid.
|
int |
lookupIndex()
Gets message lookup index.
|
protected @Nullable List<byte[]> |
marshalCollection(@Nullable Collection<?> col,
GridCacheContext ctx) |
protected void |
marshalInfo(GridCacheEntryInfo info,
GridCacheSharedContext ctx,
CacheObjectContext cacheObjCtx) |
protected void |
marshalInfos(Iterable<? extends GridCacheEntryInfo> infos,
GridCacheSharedContext ctx,
CacheObjectContext cacheObjCtx) |
protected @Nullable byte[][] |
marshalInvokeArguments(@Nullable Object[] args,
GridCacheContext ctx) |
protected void |
marshalTx(Iterable<IgniteTxEntry> txEntries,
GridCacheSharedContext ctx) |
long |
messageId() |
IgniteLogger |
messageLogger(GridCacheSharedContext ctx) |
static int |
nextIndexId()
Gets next ID for indexed message ID.
|
void |
onAckReceived()
Method called when ack message received.
|
void |
onClassError(IgniteCheckedException err)
If class loading error occurred during unmarshalling and
ignoreClassErrors() is
set to true , then the error will be passed into this method. |
int |
partition() |
boolean |
partitionExchangeMessage() |
void |
prepare(GridDeploymentInfo depInfo) |
void |
prepareMarshal(GridCacheSharedContext ctx)
This method is called before the whole message is serialized
and is responsible for pre-marshalling state.
|
protected void |
prepareMarshalCacheObject(CacheObject obj,
GridCacheContext ctx) |
protected void |
prepareMarshalCacheObjects(@Nullable Collection<? extends CacheObject> col,
GridCacheContext ctx) |
void |
prepareMarshalCacheObjects(@Nullable List<? extends CacheObject> col,
GridCacheContext ctx) |
protected void |
prepareObject(@Nullable Object o,
GridCacheContext ctx) |
protected void |
prepareObject(@Nullable Object o,
GridCacheSharedContext ctx) |
boolean |
readFrom(ByteBuffer buf,
MessageReader reader)
Reads this message from provided byte buffer.
|
AffinityTopologyVersion |
topologyVersion()
Gets topology version or -1 in case of topology version is not required for this message.
|
String |
toString() |
protected boolean |
transferExpiryPolicy() |
protected <T> @Nullable List<T> |
unmarshalCollection(@Nullable Collection<byte[]> byteCol,
GridCacheSharedContext ctx,
ClassLoader ldr) |
protected void |
unmarshalInfo(GridCacheEntryInfo info,
GridCacheContext ctx,
ClassLoader ldr) |
protected void |
unmarshalInfos(Iterable<? extends GridCacheEntryInfo> infos,
GridCacheContext ctx,
ClassLoader ldr) |
protected @Nullable Object[] |
unmarshalInvokeArguments(@Nullable byte[][] byteCol,
GridCacheSharedContext ctx,
ClassLoader ldr) |
protected void |
unmarshalTx(Iterable<IgniteTxEntry> txEntries,
boolean near,
GridCacheSharedContext ctx,
ClassLoader ldr) |
boolean |
writeTo(ByteBuffer buf,
MessageWriter writer)
Writes this message to provided byte buffer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
directType
public static final int MAX_CACHE_MSG_LOOKUP_INDEX
public static final String CACHE_MSG_INDEX_FIELD_NAME
protected boolean addDepInfo
protected boolean forceAddDepInfo
addDepInfo
flag value.public abstract int handlerId()
public abstract boolean cacheGroupMessage()
True
if cache group message.@Nullable public @Nullable Throwable error()
public static int nextIndexId()
public boolean partitionExchangeMessage()
True
if this message is partition exchange message.public boolean ignoreClassErrors()
True
if class loading errors should be ignored, false otherwise.public int lookupIndex()
MAX_CACHE_MSG_LOOKUP_INDEX
.public int partition()
-1
if it cannot be determined.public void onClassError(IgniteCheckedException err)
ignoreClassErrors()
is
set to true
, then the error will be passed into this method.err
- Error.public IgniteCheckedException classError()
onClassError(IgniteCheckedException)
method.public long messageId()
public AffinityTopologyVersion topologyVersion()
public AffinityTopologyVersion lastAffinityChangedTopologyVersion()
public void lastAffinityChangedTopologyVersion(AffinityTopologyVersion topVer)
topVer
- Last affinity topology version when affinity was modified.public abstract boolean addDeploymentInfo()
true
or if deployment info must be added to the the message, false
otherwise.protected final void prepareObject(@Nullable @Nullable Object o, GridCacheContext ctx) throws IgniteCheckedException
o
- Object to prepare for marshalling.ctx
- Context.IgniteCheckedException
- If failed.protected final void prepareObject(@Nullable @Nullable Object o, GridCacheSharedContext ctx) throws IgniteCheckedException
o
- Object to prepare for marshalling.ctx
- Context.IgniteCheckedException
- If failed.public final void prepare(GridDeploymentInfo depInfo)
depInfo
- Deployment to set.GridCacheDeployable.prepare(GridDeploymentInfo)
public GridDeploymentInfo deployInfo()
GridCacheDeployable.deployInfo()
public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException
ctx
- Cache context.IgniteCheckedException
- If failed.public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException
prepareMarshal(GridCacheSharedContext)
method.ctx
- Context.ldr
- Class loader.IgniteCheckedException
- If failed.protected final void marshalInfo(GridCacheEntryInfo info, GridCacheSharedContext ctx, CacheObjectContext cacheObjCtx) throws IgniteCheckedException
info
- Entry to marshal.ctx
- Context.cacheObjCtx
- Cache object context.IgniteCheckedException
- If failed.protected final void unmarshalInfo(GridCacheEntryInfo info, GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException
info
- Entry to unmarshal.ctx
- Context.ldr
- Loader.IgniteCheckedException
- If failed.protected final void marshalInfos(Iterable<? extends GridCacheEntryInfo> infos, GridCacheSharedContext ctx, CacheObjectContext cacheObjCtx) throws IgniteCheckedException
infos
- Entries to marshal.ctx
- Context.IgniteCheckedException
- If failed.protected final void unmarshalInfos(Iterable<? extends GridCacheEntryInfo> infos, GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException
infos
- Entries to unmarshal.ctx
- Context.ldr
- Loader.IgniteCheckedException
- If failed.protected final void marshalTx(Iterable<IgniteTxEntry> txEntries, GridCacheSharedContext ctx) throws IgniteCheckedException
txEntries
- Entries to marshal.ctx
- Context.IgniteCheckedException
- If failed.protected boolean transferExpiryPolicy()
True
if entries expire policy should be marshalled.protected final void unmarshalTx(Iterable<IgniteTxEntry> txEntries, boolean near, GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException
txEntries
- Entries to unmarshal.ctx
- Context.ldr
- Loader.IgniteCheckedException
- If failed.@Nullable protected final @Nullable byte[][] marshalInvokeArguments(@Nullable @Nullable Object[] args, GridCacheContext ctx) throws IgniteCheckedException
args
- Arguments to marshal.ctx
- Context.IgniteCheckedException
- If failed.@Nullable protected final @Nullable Object[] unmarshalInvokeArguments(@Nullable @Nullable byte[][] byteCol, GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException
byteCol
- Collection to unmarshal.ctx
- Context.ldr
- Loader.IgniteCheckedException
- If failed.@Nullable protected @Nullable List<byte[]> marshalCollection(@Nullable @Nullable Collection<?> col, GridCacheContext ctx) throws IgniteCheckedException
col
- Collection to marshal.ctx
- Context.IgniteCheckedException
- If failed.public final void prepareMarshalCacheObjects(@Nullable @Nullable List<? extends CacheObject> col, GridCacheContext ctx) throws IgniteCheckedException
col
- Collection.ctx
- Cache context.IgniteCheckedException
- If failed.protected final void prepareMarshalCacheObject(CacheObject obj, GridCacheContext ctx) throws IgniteCheckedException
obj
- Object.ctx
- Context.IgniteCheckedException
- If failed.protected final void prepareMarshalCacheObjects(@Nullable @Nullable Collection<? extends CacheObject> col, GridCacheContext ctx) throws IgniteCheckedException
col
- Collection.ctx
- Cache context.IgniteCheckedException
- If failed.public final void finishUnmarshalCacheObjects(@Nullable @Nullable List<? extends CacheObject> col, GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException
col
- Collection.ctx
- Context.ldr
- Class loader.IgniteCheckedException
- If failed.protected final void finishUnmarshalCacheObjects(@Nullable @Nullable Collection<? extends CacheObject> col, GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException
col
- Collection.ctx
- Context.ldr
- Class loader.IgniteCheckedException
- If failed.public void onAckReceived()
onAckReceived
in interface Message
@Nullable protected <T> @Nullable List<T> unmarshalCollection(@Nullable @Nullable Collection<byte[]> byteCol, GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException
byteCol
- Collection to unmarshal.ctx
- Context.ldr
- Loader.IgniteCheckedException
- If failed.public IgniteLogger messageLogger(GridCacheSharedContext ctx)
ctx
- Context.public byte fieldsCount()
fieldsCount
in interface Message
public boolean writeTo(ByteBuffer buf, MessageWriter writer)
public boolean readFrom(ByteBuffer buf, MessageReader reader)
protected final void appendFlag(StringBuilder str, String name)
str
- Bulder.name
- Flag name.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021