| java.lang.Object org.apache.derby.impl.store.raw.data.StoredRecordHeader
StoredRecordHeader | final public class StoredRecordHeader (Code) | | A class StoredPage uses to cache record headers by passing instances
to BasePage, and to write stored versions of record headers.
Format
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
|
Field Summary | |
final public static int | RECORD_DELETED | final public static int | RECORD_HAS_FIRST_FIELD | final public static int | RECORD_INITIAL Status bits for the record header:
RECORD_INITIAL - used when record header is first initialized
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. | final public static int | RECORD_OVERFLOW | final public static int | RECORD_VALID_MASK | protected 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. | protected RecordHandle | handle A record handle that can represent the record, may be null. | protected int | id | protected int | numberFields number of fields in the row. | protected 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. | protected long | overflowPage If (hasOverflow()) then this is the page where where the next portion of
the row can be found. | protected int | status Status of the record. |
RECORD_DELETED | final public static int RECORD_DELETED(Code) | | |
RECORD_HAS_FIRST_FIELD | final public static int RECORD_HAS_FIRST_FIELD(Code) | | |
RECORD_INITIAL | final public static int RECORD_INITIAL(Code) | | Status bits for the record header:
RECORD_INITIAL - used when record header is first initialized
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 point 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_OVERFLOW | final public static int RECORD_OVERFLOW(Code) | | |
RECORD_VALID_MASK | final public static int RECORD_VALID_MASK(Code) | | |
firstField | protected int firstField(Code) | | 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.
|
handle | protected RecordHandle handle(Code) | | A record handle that can represent the record, may be null.
|
id | protected int id(Code) | | Actual identifier of the record
MT - Mutable
|
numberFields | protected int numberFields(Code) | | number of fields in the row.
|
overflowId | protected int overflowId(Code) | | 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 | protected long overflowPage(Code) | | 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.
|
status | protected int status(Code) | | Status of the record.
See above for description of fields:
RECORD_INITIAL
RECORD_DELETED
RECORD_OVERFLOW
RECORD_HAS_FIRST_FIELD
RECORD_VALID_MASK
MT - Mutable - single thread required.
|
StoredRecordHeader | public StoredRecordHeader()(Code) | | Constructors for This class:
|
StoredRecordHeader | public StoredRecordHeader(int id, int numberFields)(Code) | | |
StoredRecordHeader | public StoredRecordHeader(byte data, int offset)(Code) | | |
getFirstField | public int getFirstField()(Code) | | |
getHandle | protected RecordHandle getHandle(PageKey pageId, int current_slot)(Code) | | Get a record handle for the record.
MT - single thread required
|
getId | final public int getId()(Code) | | Get the record identifier
MT - thread safe
|
getNumberFields | public int getNumberFields()(Code) | | |
getOverflowId | public int getOverflowId()(Code) | | |
getOverflowPage | public long getOverflowPage()(Code) | | |
hasFirstField | final protected boolean hasFirstField()(Code) | | |
hasOverflow | final public boolean hasOverflow()(Code) | | |
isDeleted | final public boolean isDeleted()(Code) | | Get the deleted state of the record.
MT - single thread required
|
setDeleted | public int setDeleted(boolean deleteTrue)(Code) | | 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.
MT - single thread required
|
setFirstField | public void setFirstField(int firstField)(Code) | | |
setId | final public void setId(int id)(Code) | | |
setNumberFields | final public void setNumberFields(int numberFields)(Code) | | |
size | public int size()(Code) | | 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.
The length of the record header. exception: StandardException - Standard exception policy. |
|
|