Class ODurablePage
java.lang.Object
com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurablePage
- Direct Known Subclasses:
CellBTreeBucketSingleValueV1,CellBTreeMultiValueV2Bucket,CellBTreeMultiValueV2EntryPoint,CellBTreeMultiValueV2NullBucket,CellBTreeNullBucketSingleValueV1,CellBTreeSingleValueBucketV3,CellBTreeSingleValueEntryPointV1,CellBTreeSingleValueEntryPointV3,CellBTreeSingleValueV3NullBucket,DirectoryPageV2,EntryPoint,FreeSpaceMapPage,HashIndexBucketV2,HashIndexMetadataPageV2,HashIndexNullBucketV2,OBonsaiBucketAbstract,OClusterPage,OClusterPositionMapBucket,ODirectoryPage,OHashIndexBucket,OHashIndexFileLevelMetadataPage,ONullBucket,OPaginatedClusterStateV0,OPaginatedClusterStateV1,OPaginatedClusterStateV2,OPaginatedVersionStateV0,OSBTreeBucketV1,OSBTreeBucketV2,OSBTreeNullBucketV1,OSBTreeNullBucketV2,OVersionPositionMapBucket
Base page class for all durable data structures, that is data structures state of which can be
consistently restored after system crash but results of last operations in small interval before
crash may be lost.
This page has several booked memory areas with following offsets at the beginning:
- from 0 to 7 - Magic number
- from 8 to 11 - crc32 of all page content, which is calculated by cache system just before save
- from 12 to 23 - LSN of last operation which was stored for given page
Developer which will extend this class should use all page memory starting from NEXT_FREE_POSITION offset. All data structures which use this kind of pages should be derived
from ODurableComponent class.
- Since:
- 16.08.13
- Author:
- Andrey Lomakin (a.lomakin-at-orientdb.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> TdeserializeFromDirectMemory(OBinarySerializer<T> binarySerializer, int offset) protected final byte[]getBinaryValue(int pageOffset, int valLen) protected final bytegetByteValue(int pageOffset) final OCacheEntryprotected final int[]getIntArray(int pageOffset, int size) protected final intgetIntValue(int pageOffset) static OLogSequenceNumbergetLogSequenceNumber(int offset, byte[] data) DO NOT DELETE THIS METHOD IT IS USED IN ENTERPRISE STORAGEstatic OLogSequenceNumberprotected final longgetLongValue(int pageOffset) final OLogSequenceNumbergetLSN()protected intgetObjectSizeInDirectMemory(OBinarySerializer<?> binarySerializer, int offset) static voidgetPageData(ByteBuffer buffer, byte[] data, int offset, int length) DO NOT DELETE THIS METHOD IT IS USED IN ENTERPRISE STORAGEfinal intprotected shortgetShortValue(int pageOffset) protected final voidmoveData(int from, int to, int len) voidrestoreChanges(OWALChanges changes) protected final intsetBinaryValue(int pageOffset, byte[] value) protected final intsetByteValue(int pageOffset, byte value) protected voidsetIntArray(int pageOffset, int[] values, int offset) protected final intsetIntValue(int pageOffset, int value) protected final intsetLongValue(int pageOffset, long value) final voidsetLsn(OLogSequenceNumber lsn) protected final intsetShortValue(int pageOffset, short value) toString()
-
Field Details
-
MAGIC_NUMBER_OFFSET
public static final int MAGIC_NUMBER_OFFSET- See Also:
-
CRC32_OFFSET
protected static final int CRC32_OFFSET- See Also:
-
WAL_SEGMENT_OFFSET
public static final int WAL_SEGMENT_OFFSET- See Also:
-
WAL_POSITION_OFFSET
public static final int WAL_POSITION_OFFSET- See Also:
-
MAX_PAGE_SIZE_BYTES
public static final int MAX_PAGE_SIZE_BYTES -
NEXT_FREE_POSITION
public static final int NEXT_FREE_POSITION- See Also:
-
-
Constructor Details
-
ODurablePage
-
-
Method Details
-
getPageIndex
public final int getPageIndex() -
getLSN
-
getLogSequenceNumberFromPage
-
getPageData
DO NOT DELETE THIS METHOD IT IS USED IN ENTERPRISE STORAGECopies content of page into passed in byte array.
- Parameters:
buffer- Buffer from which data will be copieddata- Byte array to which data will be copiedoffset- Offset of data inside pagelength- Length of data to be copied
-
getLogSequenceNumber
DO NOT DELETE THIS METHOD IT IS USED IN ENTERPRISE STORAGEGet value of LSN from the passed in offset in byte array.
- Parameters:
offset- Offset inside of byte array from which LSN value will be read.data- Byte array from which LSN value will be read.
-
getIntValue
protected final int getIntValue(int pageOffset) -
getIntArray
protected final int[] getIntArray(int pageOffset, int size) -
setIntArray
protected void setIntArray(int pageOffset, int[] values, int offset) -
getShortValue
protected short getShortValue(int pageOffset) -
getLongValue
protected final long getLongValue(int pageOffset) -
getBinaryValue
protected final byte[] getBinaryValue(int pageOffset, int valLen) -
getObjectSizeInDirectMemory
-
deserializeFromDirectMemory
-
getByteValue
protected final byte getByteValue(int pageOffset) -
setIntValue
protected final int setIntValue(int pageOffset, int value) -
setShortValue
protected final int setShortValue(int pageOffset, short value) -
setByteValue
protected final int setByteValue(int pageOffset, byte value) -
setLongValue
protected final int setLongValue(int pageOffset, long value) -
setBinaryValue
protected final int setBinaryValue(int pageOffset, byte[] value) -
moveData
protected final void moveData(int from, int to, int len) -
getChanges
-
getCacheEntry
-
restoreChanges
-
setLsn
-
toString
-