Class StoreObjectAdapter
java.lang.Object
org.apache.ignite.internal.persistence.store.StoreObjectAdapter
- All Implemented Interfaces:
Externalizable,Serializable,StoreObject
- Direct Known Subclasses:
KeyStoreObjectImpl,StoreObjectImpl
- See Also:
-
Field Summary
FieldsFields inherited from interface org.apache.ignite.internal.persistence.store.StoreObject
TYPE_BINARY, TYPE_BINARY_ENUM, TYPE_BYTE_ARR, TYPE_REGULAR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbytestatic intobjectPutSize(int dataLen) static booleanputValue(byte cacheObjType, ByteBuffer buf, int off, int len, byte[] valBytes, int start) intputValue(long addr) static intputValue(long addr, byte type, byte[] valBytes, int valOff) booleanputValue(ByteBuffer buf) booleanputValue(ByteBuffer buf, int off, int len) voidtoString()intvoidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.ignite.internal.persistence.store.StoreObject
finishUnmarshal, prepareForCache, prepareMarshal, value, valueBytes
-
Field Details
-
val
-
valBytes
protected byte[] valBytes
-
-
Constructor Details
-
StoreObjectAdapter
public StoreObjectAdapter()
-
-
Method Details
-
cacheObjectType
public byte cacheObjectType()- Specified by:
cacheObjectTypein interfaceStoreObject- Returns:
- Object type.
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
putValue
- Specified by:
putValuein interfaceStoreObject- Parameters:
buf- Buffer to write value to.- Returns:
Trueif value was successfully written,falseif there was not enough space in the buffer.- Throws:
IgniteCheckedException- If failed.
-
putValue
- Specified by:
putValuein interfaceStoreObject- Parameters:
addr- Address tp write value to.- Returns:
- Number of bytes written.
- Throws:
IgniteCheckedException- If failed.
-
putValue
public static int putValue(long addr, byte type, byte[] valBytes, int valOff) - Parameters:
addr- Write address.type- Object type.valBytes- Value bytes array.valOff- Value bytes array offset.- Returns:
- Offset shift compared to initial address.
-
putValue
- Specified by:
putValuein interfaceStoreObject- Parameters:
buf- Buffer to write value to.off- Offset in source binary data.len- Length of the data to write.- Returns:
Trueif value was successfully written,falseif there was not enough space in the buffer.- Throws:
IgniteCheckedException- If failed.
-
valueBytesLength
- Specified by:
valueBytesLengthin interfaceStoreObject- Parameters:
ctx- Cache object context.- Returns:
- Size required to store this value object.
- Throws:
IgniteCheckedException- If failed.
-
toString
-
objectPutSize
public static int objectPutSize(int dataLen) - Parameters:
dataLen- Serialized value length.- Returns:
- Full size required to store cache object.
- See Also:
-
putValue
public static boolean putValue(byte cacheObjType, ByteBuffer buf, int off, int len, byte[] valBytes, int start) - Parameters:
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.- Returns:
Trueif data were successfully written.
-