public abstract class CacheObjectAdapter extends Object implements CacheObject, Externalizable
| Modifier and Type | Field and Description |
|---|---|
protected static int |
HEAD_SIZE
Head size.
|
protected Object |
val |
protected byte[] |
valBytes |
TYPE_BINARY, TYPE_BINARY_ENUM, TYPE_BYTE_ARR, TYPE_REGULARDIRECT_TYPE_SIZE| Constructor and Description |
|---|
CacheObjectAdapter() |
| Modifier and Type | Method and Description |
|---|---|
byte |
cacheObjectType() |
byte |
fieldsCount()
Gets fields count.
|
protected boolean |
needCopy(CacheObjectValueContext ctx) |
static int |
objectPutSize(int dataLen) |
boolean |
putValue(ByteBuffer buf) |
boolean |
putValue(ByteBuffer buf,
int off,
int len) |
static boolean |
putValue(byte cacheObjType,
ByteBuffer buf,
int off,
int len,
byte[] valBytes,
int start) |
int |
putValue(long addr) |
static int |
putValue(long addr,
byte type,
byte[] valBytes) |
static int |
putValue(long addr,
byte type,
byte[] srcBytes,
int srcOff,
int len) |
void |
readExternal(ObjectInput in) |
boolean |
readFrom(ByteBuffer buf,
MessageReader reader)
Reads this message from provided byte buffer.
|
String |
toString() |
protected byte[] |
valueBytesFromValue(CacheObjectValueContext ctx) |
int |
valueBytesLength(CacheObjectContext ctx) |
protected Object |
valueFromValueBytes(CacheObjectValueContext ctx,
ClassLoader ldr) |
void |
writeExternal(ObjectOutput out) |
boolean |
writeTo(ByteBuffer buf,
MessageWriter writer)
Writes this message to provided byte buffer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfinishUnmarshal, isPlatformType, prepareForCache, prepareMarshal, value, value, valueBytesdirectType, onAckReceivedprotected static final int HEAD_SIZE
@GridToStringInclude(sensitive=true) protected Object val
protected byte[] valBytes
protected boolean needCopy(CacheObjectValueContext ctx)
ctx - Context.True need to copy value returned to user.protected byte[] valueBytesFromValue(CacheObjectValueContext ctx) throws IgniteCheckedException
IgniteCheckedExceptionprotected Object valueFromValueBytes(CacheObjectValueContext ctx, ClassLoader ldr) throws IgniteCheckedException
IgniteCheckedExceptionpublic byte cacheObjectType()
cacheObjectType in interface CacheObjectpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic boolean putValue(ByteBuffer buf) throws IgniteCheckedException
putValue in interface CacheObjectbuf - Buffer to write value to.True if value was successfully written, false if there was not enough space in the
buffer.IgniteCheckedException - If failed.public int putValue(long addr)
throws IgniteCheckedException
putValue in interface CacheObjectaddr - Address tp write value to.IgniteCheckedException - If failed.public static int putValue(long addr,
byte type,
byte[] valBytes)
addr - Write address.type - Object type.valBytes - Value bytes array.public static int putValue(long addr,
byte type,
byte[] srcBytes,
int srcOff,
int len)
addr - Write address.type - Object type.srcBytes - Source value bytes array.srcOff - Start position in sourceBytes.len - Number of bytes for write.public boolean putValue(ByteBuffer buf, int off, int len) throws IgniteCheckedException
putValue in interface CacheObjectbuf - Buffer to write value to.off - Offset in source binary data.len - Length of the data to write.True if value was successfully written, false if there was not enough space in the
buffer.IgniteCheckedException - If failed.public int valueBytesLength(CacheObjectContext ctx) throws IgniteCheckedException
valueBytesLength in interface CacheObjectctx - Cache object context.IgniteCheckedException - If failed.public boolean readFrom(ByteBuffer buf, MessageReader reader)
public boolean writeTo(ByteBuffer buf, MessageWriter writer)
public byte fieldsCount()
fieldsCount in interface Messagepublic static int objectPutSize(int dataLen)
dataLen - Serialized value length.putValue(byte, ByteBuffer, int, int, byte[], int)public static boolean putValue(byte cacheObjType,
ByteBuffer buf,
int off,
int len,
byte[] valBytes,
int start)
throws IgniteCheckedException
cacheObjType - Cache object type.buf - Buffer to write value to.off - Offset in source binary data.len - Length of the data to write.valBytes - Binary data.start - Start offset in binary data.True if data were successfully written.IgniteCheckedException - If failed.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023