Class CacheVersionIO
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.tree.io.CacheVersionIO
-
public class CacheVersionIO extends Object
Utility to read and writeGridCacheVersioninstances.
-
-
Constructor Summary
Constructors Constructor Description CacheVersionIO()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GridCacheVersionread(long pageAddr, boolean allowNull)Reads GridCacheVersion instance from the given address.static GridCacheVersionread(ByteBuffer buf, boolean allowNull)Reads GridCacheVersion instance from the given buffer.static intreadSize(long pageAddr, boolean allowNull)Gets needed buffer size to read the whole version instance.static intreadSize(ByteBuffer buf, boolean allowNull)Gets needed buffer size to read the whole version instance.static intsize(GridCacheVersion ver, boolean allowNull)static voidwrite(long addr, GridCacheVersion ver, boolean allowNull)static voidwrite(ByteBuffer buf, GridCacheVersion ver, boolean allowNull)
-
-
-
Method Detail
-
size
public static int size(GridCacheVersion ver, boolean allowNull)
- Parameters:
ver- Version.allowNull- Isnullversion allowed.- Returns:
- Serialized size in bytes.
-
write
public static void write(ByteBuffer buf, GridCacheVersion ver, boolean allowNull)
- Parameters:
buf- Byte buffer.ver- Version to write.allowNull- Isnullversion allowed.
-
write
public static void write(long addr, GridCacheVersion ver, boolean allowNull)- Parameters:
addr- Write address.ver- Version to write.allowNull- Isnullversion allowed.
-
readSize
public static int readSize(ByteBuffer buf, boolean allowNull) throws IgniteCheckedException
Gets needed buffer size to read the whole version instance. Does not change buffer position.- Parameters:
buf- Buffer.allowNull- Isnullversion allowed.- Returns:
- Size of serialized version.
- Throws:
IgniteCheckedException- If failed.
-
readSize
public static int readSize(long pageAddr, boolean allowNull) throws IgniteCheckedExceptionGets needed buffer size to read the whole version instance. Does not change buffer position.- Parameters:
pageAddr- Page address.allowNull- Isnullversion allowed.- Returns:
- Size of serialized version.
- Throws:
IgniteCheckedException- If failed.
-
read
public static GridCacheVersion read(ByteBuffer buf, boolean allowNull) throws IgniteCheckedException
Reads GridCacheVersion instance from the given buffer. Moves buffer's position by the number of used bytes.- Parameters:
buf- Byte buffer.allowNull- Isnullversion allowed.- Returns:
- Version.
- Throws:
IgniteCheckedException- If failed.
-
read
public static GridCacheVersion read(long pageAddr, boolean allowNull) throws IgniteCheckedException
Reads GridCacheVersion instance from the given address.- Parameters:
pageAddr- Page address.allowNull- Isnullversion allowed.- Returns:
- Version.
- Throws:
IgniteCheckedException- If failed.
-
-