Interface OWALPage
public interface OWALPage
Basic interface for classes which present pages of WAL. Main reason of creation of this interface
is support of different binary formats of WAL in the same deployment.
To detect which version of binary format is stored we use value stored under MAGIC_NUMBER_OFFSET
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intOffset of position which stores CRC32 value of content stored on this page.static final intOffset of value which contains amount of space which is available to store new records.static final intOffset of magic number value.static final intSize of the record which will be stored inside of page even if payload of record equals to 0.static final intSize of the current instance of page in direct memory. -
Method Summary
Modifier and TypeMethodDescriptionintbyte[]getRecord(int position) Returns content of record which is stored inside of specified position of page.booleanmergeWithNextPage(int position) Indicates whether page stored inside of passed in position is stored only partially inside of given page, so next part of the record should be read from next page of WAL segment.
-
Field Details
-
PAGE_SIZE
static final int PAGE_SIZESize of the current instance of page in direct memory. -
MIN_RECORD_SIZE
static final int MIN_RECORD_SIZESize of the record which will be stored inside of page even if payload of record equals to 0. That happens because when we store record inside of page we add additional system metadata are used when we read record back from WAL.- See Also:
-
CRC_OFFSET
static final int CRC_OFFSETOffset of position which stores CRC32 value of content stored on this page.- See Also:
-
MAGIC_NUMBER_OFFSET
static final int MAGIC_NUMBER_OFFSETOffset of magic number value. Randomly generated constant which is used to identify whether page is broken on disk and version of binary format is used to store page.- See Also:
-
FREE_SPACE_OFFSET
static final int FREE_SPACE_OFFSETOffset of value which contains amount of space which is available to store new records.- See Also:
-
-
Method Details
-
getRecord
byte[] getRecord(int position) Returns content of record which is stored inside of specified position of page. -
mergeWithNextPage
boolean mergeWithNextPage(int position) Indicates whether page stored inside of passed in position is stored only partially inside of given page, so next part of the record should be read from next page of WAL segment. -
getFreeSpace
int getFreeSpace()- Returns:
- Amount of free space available to store new records inside of page.
-