public abstract class GridCacheMessage<K,V> extends MessageAdapter
MessageAdapter.Type| Modifier and Type | Field and Description |
|---|---|
static String |
CACHE_MSG_INDEX_FIELD_NAME
Cache message index field name.
|
protected int |
cacheId
Cache ID.
|
static int |
MAX_CACHE_MSG_LOOKUP_INDEX
Maximum number of cache lookup indexes.
|
reader, readState| Constructor and Description |
|---|
GridCacheMessage() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowForStartup() |
int |
cacheId() |
void |
cacheId(int cacheId) |
Exception |
classError() |
GridDeploymentInfo |
deployInfo() |
void |
finishUnmarshal(GridCacheSharedContext<K,V> ctx,
ClassLoader ldr)
This method is called after the message is deserialized and is responsible for
unmarshalling state marshalled in
prepareMarshal(GridCacheSharedContext) method. |
boolean |
ignoreClassErrors() |
int |
lookupIndex()
Gets message lookup index.
|
protected LinkedHashMap<byte[],Boolean> |
marshalBooleanLinkedMap(LinkedHashMap<?,Boolean> map,
GridCacheSharedContext<K,V> ctx) |
protected List<byte[]> |
marshalCollection(Collection<?> col,
GridCacheSharedContext<K,V> ctx) |
protected <T> byte[][] |
marshalFilter(IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] filter,
GridCacheSharedContext<K,V> ctx) |
protected void |
marshalInfo(GridCacheEntryInfo<K,V> info,
GridCacheSharedContext<K,V> ctx) |
protected void |
marshalInfos(Iterable<? extends GridCacheEntryInfo<K,V>> infos,
GridCacheSharedContext<K,V> ctx) |
protected byte[][] |
marshalInvokeArguments(Object[] args,
GridCacheSharedContext<K,V> ctx) |
protected void |
marshalTx(Iterable<IgniteTxEntry<K,V>> txEntries,
GridCacheSharedContext<K,V> ctx) |
protected List<GridCacheValueBytes> |
marshalValuesCollection(Collection<?> col,
GridCacheSharedContext<K,V> ctx) |
long |
messageId() |
static int |
nextIndexId()
Gets next ID for indexed message ID.
|
void |
onClassError(Exception err)
If class loading error occurred during unmarshalling and
ignoreClassErrors() is
set to true, then the error will be passed into this method. |
void |
prepare(GridDeploymentInfo depInfo) |
protected void |
prepareFilter(IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] filters,
GridCacheSharedContext<K,V> ctx) |
void |
prepareMarshal(GridCacheSharedContext<K,V> ctx)
This method is called before the whole message is serialized
and is responsible for pre-marshalling state.
|
protected void |
prepareObject(Object o,
GridCacheSharedContext<K,V> ctx) |
protected void |
prepareObjects(Iterable<?> col,
GridCacheSharedContext<K,V> ctx) |
boolean |
readFrom(ByteBuffer buf)
Reads this message from provided byte buffer.
|
long |
topologyVersion()
Gets topology version or -1 in case of topology version is not required for this message.
|
String |
toString() |
boolean |
transactional() |
protected boolean |
transferExpiryPolicy() |
protected <K1> LinkedHashMap<K1,Boolean> |
unmarshalBooleanLinkedMap(Map<byte[],Boolean> byteMap,
GridCacheSharedContext<K,V> ctx,
ClassLoader ldr) |
protected <T> List<T> |
unmarshalCollection(Collection<byte[]> byteCol,
GridCacheSharedContext<K,V> ctx,
ClassLoader ldr) |
protected <T> IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] |
unmarshalFilter(byte[][] byteCol,
GridCacheSharedContext<K,V> ctx,
ClassLoader ldr) |
protected void |
unmarshalInfo(GridCacheEntryInfo<K,V> info,
GridCacheContext<K,V> ctx,
ClassLoader ldr) |
protected void |
unmarshalInfos(Iterable<? extends GridCacheEntryInfo<K,V>> infos,
GridCacheContext<K,V> ctx,
ClassLoader ldr) |
protected Object[] |
unmarshalInvokeArguments(byte[][] byteCol,
GridCacheSharedContext<K,V> ctx,
ClassLoader ldr) |
protected void |
unmarshalTx(Iterable<IgniteTxEntry<K,V>> txEntries,
boolean near,
GridCacheSharedContext<K,V> ctx,
ClassLoader ldr) |
protected <T> List<T> |
unmarshalValueBytesCollection(Collection<GridCacheValueBytes> byteCol,
GridCacheSharedContext<K,V> ctx,
ClassLoader ldr) |
boolean |
writeTo(ByteBuffer buf,
MessageWriter writer)
Writes this message to provided byte buffer.
|
directType, setReader, skipRecoverypublic static final int MAX_CACHE_MSG_LOOKUP_INDEX
public static final String CACHE_MSG_INDEX_FIELD_NAME
protected int cacheId
public static int nextIndexId()
public boolean allowForStartup()
True if this message is preloader message.public boolean transactional()
public boolean ignoreClassErrors()
True if class loading errors should be ignored, false otherwise.public int lookupIndex()
MAX_CACHE_MSG_LOOKUP_INDEX.public void onClassError(Exception err)
ignoreClassErrors() is
set to true, then the error will be passed into this method.err - Error.public Exception classError()
onClassError(Exception) method.public long messageId()
public int cacheId()
public void cacheId(int cacheId)
cacheId - Cache ID.public long topologyVersion()
protected final void prepareFilter(@Nullable IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] filters, GridCacheSharedContext<K,V> ctx) throws IgniteCheckedException
filters - Predicate filters.ctx - Context.IgniteCheckedException - If failed.protected final void prepareObject(@Nullable Object o, GridCacheSharedContext<K,V> ctx) throws IgniteCheckedException
o - Object to prepare for marshalling.ctx - Context.IgniteCheckedException - If failed.protected final void prepareObjects(@Nullable Iterable<?> col, GridCacheSharedContext<K,V> ctx) throws IgniteCheckedException
col - Collection of objects to prepare for marshalling.ctx - Cache 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<K,V> ctx) throws IgniteCheckedException
ctx - Cache context.IgniteCheckedException - If failed.public void finishUnmarshal(GridCacheSharedContext<K,V> ctx, ClassLoader ldr) throws IgniteCheckedException
prepareMarshal(GridCacheSharedContext) method.ctx - Context.ldr - Class loader.IgniteCheckedException - If failed.protected final void marshalInfo(GridCacheEntryInfo<K,V> info, GridCacheSharedContext<K,V> ctx) throws IgniteCheckedException
info - Entry to marshal.ctx - Context.IgniteCheckedException - If failed.protected final void unmarshalInfo(GridCacheEntryInfo<K,V> info, GridCacheContext<K,V> ctx, ClassLoader ldr) throws IgniteCheckedException
info - Entry to unmarshal.ctx - Context.ldr - Loader.IgniteCheckedException - If failed.protected final void marshalInfos(Iterable<? extends GridCacheEntryInfo<K,V>> infos, GridCacheSharedContext<K,V> ctx) throws IgniteCheckedException
infos - Entries to marshal.ctx - Context.IgniteCheckedException - If failed.protected final void unmarshalInfos(Iterable<? extends GridCacheEntryInfo<K,V>> infos, GridCacheContext<K,V> ctx, ClassLoader ldr) throws IgniteCheckedException
infos - Entries to unmarshal.ctx - Context.ldr - Loader.IgniteCheckedException - If failed.protected final void marshalTx(Iterable<IgniteTxEntry<K,V>> txEntries, GridCacheSharedContext<K,V> 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<K,V>> txEntries, boolean near, GridCacheSharedContext<K,V> ctx, ClassLoader ldr) throws IgniteCheckedException
txEntries - Entries to unmarshal.ctx - Context.ldr - Loader.IgniteCheckedException - If failed.@Nullable protected final byte[][] marshalInvokeArguments(@Nullable Object[] args, GridCacheSharedContext<K,V> ctx) throws IgniteCheckedException
args - Arguments to marshal.ctx - Context.IgniteCheckedException - If failed.@Nullable protected final Object[] unmarshalInvokeArguments(@Nullable byte[][] byteCol, GridCacheSharedContext<K,V> ctx, ClassLoader ldr) throws IgniteCheckedException
byteCol - Collection to unmarshal.ctx - Context.ldr - Loader.IgniteCheckedException - If failed.@Nullable protected final <T> byte[][] marshalFilter(@Nullable IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] filter, GridCacheSharedContext<K,V> ctx) throws IgniteCheckedException
filter - Collection to marshal.ctx - Context.IgniteCheckedException - If failed.@Nullable protected final <T> IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] unmarshalFilter(@Nullable byte[][] byteCol, GridCacheSharedContext<K,V> ctx, ClassLoader ldr) throws IgniteCheckedException
byteCol - Collection to unmarshal.ctx - Context.ldr - Loader.IgniteCheckedException - If failed.@Nullable protected List<GridCacheValueBytes> marshalValuesCollection(@Nullable Collection<?> col, GridCacheSharedContext<K,V> ctx) throws IgniteCheckedException
col - Values collection to marshal.ctx - Context.IgniteCheckedException - If failed.@Nullable protected <T> List<T> unmarshalValueBytesCollection(@Nullable Collection<GridCacheValueBytes> byteCol, GridCacheSharedContext<K,V> ctx, ClassLoader ldr) throws IgniteCheckedException
byteCol - Collection to unmarshal.ctx - Context.ldr - Loader.IgniteCheckedException - If failed.@Nullable protected List<byte[]> marshalCollection(@Nullable Collection<?> col, GridCacheSharedContext<K,V> ctx) throws IgniteCheckedException
col - Collection to marshal.ctx - Context.IgniteCheckedException - If failed.@Nullable protected <T> List<T> unmarshalCollection(@Nullable Collection<byte[]> byteCol, GridCacheSharedContext<K,V> ctx, ClassLoader ldr) throws IgniteCheckedException
byteCol - Collection to unmarshal.ctx - Context.ldr - Loader.IgniteCheckedException - If failed.@Nullable protected final LinkedHashMap<byte[],Boolean> marshalBooleanLinkedMap(@Nullable LinkedHashMap<?,Boolean> map, GridCacheSharedContext<K,V> ctx) throws IgniteCheckedException
map - Map to marshal.ctx - Context.IgniteCheckedException - If failed.@Nullable protected final <K1> LinkedHashMap<K1,Boolean> unmarshalBooleanLinkedMap(@Nullable Map<byte[],Boolean> byteMap, GridCacheSharedContext<K,V> ctx, ClassLoader ldr) throws IgniteCheckedException
byteMap - Map to unmarshal.ctx - Context.ldr - Loader.IgniteCheckedException - If failed.public boolean writeTo(ByteBuffer buf, MessageWriter writer)
writeTo in class MessageAdapterbuf - Byte buffer.writer - Writer.public boolean readFrom(ByteBuffer buf)
readFrom in class MessageAdapterbuf - Byte buffer.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC1 Release Date : February 17 2015