Package com.sleepycat.db
Class HeapRecordId
java.lang.Object
com.sleepycat.db.HeapRecordId
Content used for the key in a Heap database record. Berkeley DB creates
this value for you when you create a record in a Heap database. You
should never create this structure yourself; Berkeley DB must create it
for you.
This structure is returned in the key DatabaseEntry parameter of the
method that you use to add a record to the Heap database.
-
Constructor Summary
ConstructorsConstructorDescriptionHeapRecordId(int pgno, short indx) Construct a new record id, given a page number and index. -
Method Summary
Modifier and TypeMethodDescriptionstatic HeapRecordIdfromArray(byte[] data) Construct a HeapRecordId from a byte array, typically from aDatabaseEntry.static HeapRecordIdConstruct a HeapRecordId from a byte array, typically from aDatabaseEntry.shortgetIndex()Get the index in the offset table where the record can be found.intGet the database page number where the record is stored.voidsetIndex(short indx) Set the index in the offset table where the record can be found.voidsetPageNumber(int pgno) Set the database page number where the record is stored.byte[]toArray()Return a byte array representing this record id.byte[]Return a byte array representing this record id.
-
Constructor Details
-
HeapRecordId
public HeapRecordId(int pgno, short indx) Construct a new record id, given a page number and index.- Parameters:
pgno- The database page number where the record is stored.indx- Index in the offset table where the record can be found.
-
-
Method Details
-
fromArray
Construct a HeapRecordId from a byte array, typically from aDatabaseEntry.- Parameters:
data- The array representing the record id.- Returns:
- A new HeapRecordId
- Throws:
IllegalArgumentException
-
fromArray
Construct a HeapRecordId from a byte array, typically from aDatabaseEntry.- Parameters:
data- The array representing the record id.order- The byte order of data stored in the array.- Returns:
- A new HeapRecordId
- Throws:
IllegalArgumentException
-
toArray
public byte[] toArray()Return a byte array representing this record id.- Returns:
- A byte array representing this record id.
-
toArray
Return a byte array representing this record id.- Parameters:
order- The byte order to use when constructing the array.- Returns:
- A byte array representing this record id.
-
getPageNumber
public int getPageNumber()Get the database page number where the record is stored.- Returns:
- The database page number where the record is stored.
-
setPageNumber
public void setPageNumber(int pgno) Set the database page number where the record is stored. -
getIndex
public short getIndex()Get the index in the offset table where the record can be found.- Returns:
- The index in the offset table where the record can be found.
-
setIndex
public void setIndex(short indx) Set the index in the offset table where the record can be found.
-