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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Offset of position which stores CRC32 value of content stored on this page.
    static final int
    Offset of value which contains amount of space which is available to store new records.
    static final int
    Offset of magic number value.
    static final int
    Size of the record which will be stored inside of page even if payload of record equals to 0.
    static final int
    Size of the current instance of page in direct memory.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    byte[]
    getRecord(int position)
    Returns content of record which is stored inside of specified position of page.
    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.
  • Field Details

    • PAGE_SIZE

      static final int PAGE_SIZE
      Size of the current instance of page in direct memory.
    • MIN_RECORD_SIZE

      static final int MIN_RECORD_SIZE
      Size 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_OFFSET
      Offset of position which stores CRC32 value of content stored on this page.
      See Also:
    • MAGIC_NUMBER_OFFSET

      static final int MAGIC_NUMBER_OFFSET
      Offset 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_OFFSET
      Offset 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.