public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Externalizable, CacheObject
TYPE_BINARY, TYPE_BINARY_ENUM, TYPE_BYTE_ARR, TYPE_REGULARDIRECT_TYPE_SIZE| Constructor and Description |
|---|
BinaryObjectOffheapImpl()
For
Externalizable (not supported). |
BinaryObjectOffheapImpl(BinaryContext ctx,
long ptr,
int start,
int size) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
array() |
byte |
cacheObjectType() |
BinaryObject |
clone()
Copies this binary object.
|
BinaryContext |
context()
Get binary context.
|
BinarySerializedFieldComparator |
createFieldComparator()
Create field comparator.
|
BinarySchema |
createSchema()
Create schema for object.
|
int |
dataStartOffset()
Get offset of data begin.
|
<T> T |
deserialize()
Gets fully deserialized instance of binary object.
|
<T> T |
deserialize(@Nullable ClassLoader ldr)
Gets fully deserialized instance of binary object.
|
short |
directType()
Gets message type.
|
protected <F> F |
field(BinaryReaderHandles rCtx,
String fieldName) |
<F> F |
field(int fieldId)
Gets field value.
|
<F> F |
field(String fieldName)
Gets field value.
|
<F> F |
fieldByOrder(int order)
Get field by offset.
|
byte |
fieldsCount()
Gets fields count.
|
void |
finishUnmarshal(CacheObjectValueContext ctx,
ClassLoader ldr) |
int |
footerStartOffset()
Get offset of the footer begin.
|
boolean |
hasArray() |
boolean |
hasField(String fieldName)
Checks whether field exists in the object.
|
int |
hashCode() |
boolean |
hasSchema() |
BinaryObject |
heapCopy() |
boolean |
isFlagSet(short flag)
Check if flag set.
|
boolean |
isPlatformType()
Gets flag indicating whether object value is a platform type.
|
int |
length() |
long |
offheapAddress() |
void |
onAckReceived()
Method called when ack message received.
|
CacheObject |
prepareForCache(CacheObjectContext ctx)
Prepares cache object for cache (e.g. copies user-provided object if needed).
|
void |
prepareMarshal(CacheObjectValueContext ctx) |
boolean |
putValue(ByteBuffer buf) |
boolean |
putValue(ByteBuffer buf,
int off,
int len) |
int |
putValue(long addr) |
@Nullable BinaryType |
rawType()
Get raw type.
|
void |
readExternal(ObjectInput in) |
boolean |
readFrom(ByteBuffer buf,
MessageReader reader)
Reads this message from provided byte buffer.
|
int |
schemaId()
Get schema ID.
|
int |
size()
Get the size of the object
|
int |
start() |
BinaryObjectBuilder |
toBuilder()
Creates a new
BinaryObjectBuilder based on this binary object. |
@Nullable BinaryType |
type()
Gets type information for this binary object.
|
int |
typeId() |
<T> T |
value(CacheObjectValueContext ctx,
boolean cpy) |
<T> T |
value(CacheObjectValueContext ctx,
boolean cpy,
ClassLoader ldr)
Deserializes a value from an internal representation.
|
byte[] |
valueBytes(CacheObjectValueContext ctx) |
int |
valueBytesLength(CacheObjectContext ctx) |
void |
writeExternal(ObjectOutput out) |
protected boolean |
writeFieldByOrder(int fieldOffset,
ByteBuffer buf)
Writes field value defined by the given field offset to the given byte buffer.
|
boolean |
writeTo(ByteBuffer buf,
MessageWriter writer)
Writes this message to provided byte buffer.
|
enumName, enumOrdinal, equals, hasCircularReferences, toStringpublic BinaryObjectOffheapImpl()
Externalizable (not supported).public BinaryObjectOffheapImpl(BinaryContext ctx, long ptr, int start, int size)
ctx - Context.ptr - Memory address.start - Object start.size - Memory size.public BinaryObject heapCopy()
public int typeId()
typeId in interface BinaryObjectExpublic int length()
length in class BinaryObjectExImplpublic boolean hasSchema()
hasSchema in class BinaryObjectExImplTrue if object has schema.public int schemaId()
schemaId in class BinaryObjectExImplpublic BinarySchema createSchema()
createSchema in class BinaryObjectExImplpublic BinaryContext context()
context in class BinaryObjectExImplpublic int start()
start in class BinaryObjectExImplpublic byte[] array()
array in class BinaryObjectExImplnull.public 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 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 long offheapAddress()
offheapAddress in class BinaryObjectExImplpublic boolean hasArray()
hasArray in class BinaryObjectExImplTrue if object is array based.public boolean isFlagSet(short flag)
isFlagSet in interface BinaryObjectExflag - flag to check.true if flag is set, false otherwise.@Nullable public @Nullable BinaryType type() throws BinaryObjectException
type in interface BinaryObjectBinaryObjectException - In case of error.@Nullable public @Nullable BinaryType rawType() throws BinaryObjectException
rawType in interface BinaryObjectExBinaryObjectException - If failed.@Nullable public <F> F field(String fieldName) throws BinaryObjectException
field in interface BinaryObjectfieldName - Field name.BinaryObjectException - In case of any other error.@Nullable
public <F> F field(int fieldId)
throws BinaryObjectException
field in class BinaryObjectExImplfieldId - Field ID.BinaryObjectException - In case of any other error.public BinarySerializedFieldComparator createFieldComparator()
createFieldComparator in class BinaryObjectExImplpublic int dataStartOffset()
dataStartOffset in class BinaryObjectExImplpublic int footerStartOffset()
footerStartOffset in class BinaryObjectExImpl@Nullable public <F> F fieldByOrder(int order)
fieldByOrder in class BinaryObjectExImplorder - Field offset.protected boolean writeFieldByOrder(int fieldOffset,
ByteBuffer buf)
writeFieldByOrder in class BinaryObjectExImplfieldOffset - Field offset.false
if there is no enough space for the field in the buffer.@Nullable protected <F> F field(BinaryReaderHandles rCtx, String fieldName)
field in class BinaryObjectExImplrCtx - Reader context.fieldName - Field name.public boolean hasField(String fieldName)
hasField in interface BinaryObjectfieldName - Field name.True if field exists.@Nullable
public <T> T deserialize(@Nullable
@Nullable ClassLoader ldr)
throws BinaryObjectException
ldr was not specified, configured class loader
will be used IgniteConfiguration.getClassLoader().deserialize in interface BinaryObjectldr - Class loader.BinaryInvalidTypeException - If class doesn't exist.BinaryObjectException - In case of any other error.@Nullable
public <T> T deserialize()
throws BinaryObjectException
deserialize in interface BinaryObjectBinaryInvalidTypeException - If class doesn't exist.BinaryObjectException - In case of any other error.public BinaryObject clone() throws CloneNotSupportedException
clone in interface BinaryObjectclone in class BinaryObjectExImplCloneNotSupportedExceptionpublic BinaryObjectBuilder toBuilder() throws BinaryObjectException
BinaryObjectBuilder based on this binary object. The following code
BinaryObjectBuilder builder = binaryObject.toBuilder();is equivalent to
BinaryObjectBuilder builder = ignite.binary().builder(binaryObject);
toBuilder in interface BinaryObjecttoBuilder in class BinaryObjectExImplBinaryObjectException - If builder cannot be created.public byte cacheObjectType()
cacheObjectType in interface CacheObjectpublic boolean isPlatformType()
IgniteCache.withKeepBinary() is used or not.isPlatformType in interface CacheObject@Nullable public <T> T value(CacheObjectValueContext ctx, boolean cpy)
value in interface CacheObjectctx - Context.cpy - If true need to copy value.@Nullable public <T> T value(CacheObjectValueContext ctx, boolean cpy, ClassLoader ldr)
value in interface CacheObjectctx - Context.cpy - If true need to copy value.ldr - Class loader, if it is null, default class loader will be used.public byte[] valueBytes(CacheObjectValueContext ctx) throws IgniteCheckedException
valueBytes in interface CacheObjectctx - Context.IgniteCheckedException - If failed.public CacheObject prepareForCache(CacheObjectContext ctx)
prepareForCache in interface CacheObjectctx - Cache context.public void finishUnmarshal(CacheObjectValueContext ctx, ClassLoader ldr) throws IgniteCheckedException
finishUnmarshal in interface CacheObjectctx - Context.ldr - Class loader.IgniteCheckedException - If failed.public void prepareMarshal(CacheObjectValueContext ctx) throws IgniteCheckedException
prepareMarshal in interface CacheObjectctx - Context.IgniteCheckedException - If failed.public boolean writeTo(ByteBuffer buf, MessageWriter writer)
public boolean readFrom(ByteBuffer buf, MessageReader reader)
public short directType()
directType in interface Messagepublic byte fieldsCount()
fieldsCount in interface Messagepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void onAckReceived()
onAckReceived in interface Messagepublic int size()
size in interface BinaryObject
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.1 Release Date : December 20 2021