1 byte - status
compressed int - record identifier
compressed long - overflow page } only if hasOverflow() is true
compressed int - overflow id } " " "
compressed int - first field } only if hasFirstField set - otherwise 0
compressed int - number of fields in this portion - only if hasOverflow()
is false OR hasFirstField is true - otherwise 0
| Modifier and Type | Class and Description |
|---|---|
| private static class | StoredRecordHeader.
Class which holds the fields |
| Modifier and Type | Field and Description |
|---|---|
| protected RecordHandle | handle
A record handle that can represent the record, may be null. |
| protected int | id
Actual identifier of the record MT - Mutable |
| public static final int | MAX_OVERFLOW_ONLY_REC_SIZE
maximum length for row containing just an overflow pointer. |
| protected int | numberFields
number of fields in the row. |
| private StoredRecordHeader. | |
| private static final byte | RECORD_DELETED
Status bits for the record header: RECORD_DELETED - used to indicate the record has been deleted RECORD_OVERFLOW - used to indicate the record has been overflowed, it will point to the overflow page and ID RECORD_HAS_FIRST_FIELD - used to indicate that firstField is stored. |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private byte | status
Status of the record. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| protected RecordHandle | |
| public final int | |
| public int | |
| public int | |
| public long | |
| public static final int | Returns: length of encoded record id on disk.Return length on disk of the record id portion of the record header Record id is part of the record header and is stored in an internal compressed format. |
| protected final boolean | |
| public final boolean | |
| public final boolean | |
| public void | |
| private void | |
| private int | |
| private void | |
| private int | |
| private int | |
| public int | |
| public void | |
| public final void | |
| public final void | |
| public void | |
| public void | |
| public int | |
| public String | |
| public int |
| handle | back to summary |
|---|---|
| protected RecordHandle handle A record handle that can represent the record, may be null. | |
| id | back to summary |
|---|---|
| protected int id Actual identifier of the record
| |
| MAX_OVERFLOW_ONLY_REC_SIZE | back to summary |
|---|---|
| public static final int MAX_OVERFLOW_ONLY_REC_SIZE maximum length for row containing just an overflow pointer. The maximum stored length of a row that just contains an overflow pointer is 17 bytes: stored sizeof(status byte) : 1 + stored sizeof(record id) : 4 + max stored size overflow page ptr: 8 + max stored size overflow record id: 4 | |
| numberFields | back to summary |
|---|---|
| protected int numberFields number of fields in the row. | |
| overflow | back to summary |
|---|---|
| private StoredRecordHeader. | |
| RECORD_DELETED | back to summary |
|---|---|
| private static final byte RECORD_DELETED Status bits for the record header: RECORD_DELETED - used to indicate the record has been deleted RECORD_OVERFLOW - used to indicate the record has been overflowed, it will point to the overflow page and ID RECORD_HAS_FIRST_FIELD - used to indicate that firstField is stored. When RECORD_OVERFLOW and RECORD_HAS_FIRST_FIELD both are set, part of record is on the page, the record header also stores the overflow pointer to the next part of the record. RECORD_VALID_MASK - A mask of valid bits that can be set currently, such that the following assert can be made: ASSERT((status & ~RECORD_VALID_MASK) == 0)) | |
| RECORD_HAS_FIRST_FIELD | back to summary |
|---|---|
| private static final byte RECORD_HAS_FIRST_FIELD | |
| RECORD_OVERFLOW | back to summary |
|---|---|
| private static final byte RECORD_OVERFLOW | |
| RECORD_VALID_MASK | back to summary |
|---|---|
| private static final byte RECORD_VALID_MASK | |
| status | back to summary |
|---|---|
| private byte status Status of the record.
See above for description of fields:
RECORD_DELETED
RECORD_OVERFLOW
RECORD_HAS_FIRST_FIELD
RECORD_VALID_MASK
| |
| StoredRecordHeader | back to summary |
|---|---|
| public StoredRecordHeader() Constructors for This class: | |
| StoredRecordHeader | back to summary |
|---|---|
| public StoredRecordHeader(int id, int numberFields) | |
| StoredRecordHeader | back to summary |
|---|---|
| public StoredRecordHeader(byte[] data, int offset) | |
| StoredRecordHeader | back to summary |
|---|---|
| public StoredRecordHeader(StoredRecordHeader loadTargetFrom) | |
| getFirstField | back to summary |
|---|---|
| public int getFirstField() | |
| getHandle | back to summary |
|---|---|
| protected RecordHandle getHandle(PageKey pageId, int current_slot) Get a record handle for the record.
| |
| getId | back to summary |
|---|---|
| public final int getId() Get the record identifier
| |
| getNumberFields | back to summary |
|---|---|
| public int getNumberFields() | |
| getOverflowId | back to summary |
|---|---|
| public int getOverflowId() | |
| getOverflowPage | back to summary |
|---|---|
| public long getOverflowPage() | |
| getStoredSizeRecordId | back to summary |
|---|---|
| public static final int getStoredSizeRecordId(int record_id) Return length on disk of the record id portion of the record header Record id is part of the record header and is stored in an internal compressed format. The length of this format depends on the value of the record id.
| |
| hasFirstField | back to summary |
|---|---|
| protected final boolean hasFirstField() | |
| hasOverflow | back to summary |
|---|---|
| public final boolean hasOverflow() | |
| isDeleted | back to summary |
|---|---|
| public final boolean isDeleted() Get the deleted state of the record.
| |
| read | back to summary |
|---|---|
| public void read(ObjectInput in) throws IOException | |
| read | back to summary |
|---|---|
| private void read(byte[] data, int offset) | |
| readFirstField | back to summary |
|---|---|
| private int readFirstField(byte[] data, int offset) | |
| readNumberFields | back to summary |
|---|---|
| private void readNumberFields(byte[] data, int offset) | |
| readOverFlowId | back to summary |
|---|---|
| private int readOverFlowId(byte[] data, int offset) | |
| readOverFlowPage | back to summary |
|---|---|
| private int readOverFlowPage(byte[] data, int offset) | |
| setDeleted | back to summary |
|---|---|
| public int setDeleted(boolean deleteTrue) Set the deleted state of the record.
return 1, if delete status from not deleted to deleted
return -1, if delete status from deleted to not deleted
return 0, if status unchanged.
| |
| setFirstField | back to summary |
|---|---|
| public void setFirstField(int firstField) | |
| setId | back to summary |
|---|---|
| public final void setId(int id) | |
| setNumberFields | back to summary |
|---|---|
| public final void setNumberFields(int numberFields) | |
| setOverflowDetails | back to summary |
|---|---|
| public void setOverflowDetails(RecordHandle overflowHandle) | |
| setOverflowFields | back to summary |
|---|---|
| public void setOverflowFields(StoredRecordHeader loadFromTarget) | |
| size | back to summary |
|---|---|
| public int size() return the size of the record header. Calculates the size of the record header, mostly used to allow a reader to skip over the record header and position on the 1st field of the record. This low level routine is performance critical to processing lots of rows, so calls to CompressNumber have been hand inlined.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| write | back to summary |
|---|---|
| public int write(OutputStream out) throws IOException Public Methods implmenting read/write of Storable Interface: | |
overflowId, overflowPage
and firstField, which are not needed when there is no
overflow. These fields are factored out to save Java heap space (see
DERBY-3130).
| Modifier and Type | Field and Description |
|---|---|
| private int | firstField
If (hasFirstField()) then this field is the number of the column in the orginal row which is now stored as the first field in this row. |
| private int | overflowId
If (hasOverflow()) then this is the id of the row on page overflowPage where the next portion of the row can be found. |
| private long | overflowPage
If (hasOverflow()) then this is the page where where the next portion of the row can be found. |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| firstField | back to summary |
|---|---|
| private int firstField If (hasFirstField()) then this field is the number of the column in the orginal row which is now stored as the first field in this row. This row is 2nd through N'th portion of a long row. For example if a row has its first 3 fields on page 0 and its next 3 fields on page 1, then the record header of the row portion on page 1 will have hasFirstField() set to true, and the value would be 4, indicating that the 4th field of the row is stored as the 1st field of the partial row portion stored on page 1. | |
| overflowId | back to summary |
|---|---|
| private int overflowId If (hasOverflow()) then this is the id of the row on page overflowPage where the next portion of the row can be found. In this case there are no "real" fields on this page. This situation comes about if a row has been updated such that the real first field no longer fits on the head page. | |
| overflowPage | back to summary |
|---|---|
| private long overflowPage If (hasOverflow()) then this is the page where where the next portion of the row can be found. In this case there are no "real" fields on this page. | |
| OverflowInfo | back to summary |
|---|---|
| private OverflowInfo() Create an empty | |
| OverflowInfo | back to summary |
|---|---|
| private OverflowInfo(StoredRecordHeader. Create a copy of a | |