Package org.apache.derby.iapi.store.raw
Interface RecordHandle
- All Superinterfaces:
Lockable
- All Known Implementing Classes:
RecordId
A handle to a record within a container. This interface does not provide
an information about the data of the record, it is only used to perform
updates, deletes and allow ordered record manipulation.
MT - immutable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
A lock with this recordHandle protects this deallocated page from being freed and reallocated.static final int
First recordId that is used to identify a record.static final int
An invalid record handlestatic final int
A lock with this recordHandle is used to lock the range of keys between the first key in a btree and keys previous to it.static final int
Reserved for future use - name it and define it when you have a need to use one.static final int
Reserve for future use - name it and define it when you have a need to use onestatic final int
-
Method Summary
Modifier and TypeMethodDescriptionReturn the identity of my container.int
getId()
Obtain the page-unique identifier for this record.Return the identity of my Page.long
Obtain the page number this record lives on.int
What slot number might the record be at?Methods inherited from interface org.apache.derby.iapi.services.locks.Lockable
lockAttributes, lockerAlwaysCompatible, lockEvent, requestCompatible, unlockEvent
-
Field Details
-
INVALID_RECORD_HANDLE
static final int INVALID_RECORD_HANDLEAn invalid record handle- See Also:
-
RESERVED1_RECORD_HANDLE
static final int RESERVED1_RECORD_HANDLEReserved for future use - name it and define it when you have a need to use one.- See Also:
-
DEALLOCATE_PROTECTION_HANDLE
static final int DEALLOCATE_PROTECTION_HANDLEA lock with this recordHandle protects this deallocated page from being freed and reallocated. This lock is released when the transaction that deallocated the page terminates, at which point the page can be freed if the transaction committed.- See Also:
-
PREVIOUS_KEY_HANDLE
static final int PREVIOUS_KEY_HANDLEA lock with this recordHandle is used to lock the range of keys between the first key in a btree and keys previous to it.- See Also:
-
RESERVED4_RECORD_HANDLE
static final int RESERVED4_RECORD_HANDLEReserve for future use - name it and define it when you have a need to use one- See Also:
-
RESERVED5_RECORD_HANDLE
static final int RESERVED5_RECORD_HANDLE- See Also:
-
FIRST_RECORD_ID
static final int FIRST_RECORD_IDFirst recordId that is used to identify a record.- See Also:
-
-
Method Details
-
getId
int getId()Obtain the page-unique identifier for this record. This id combined with a page number is guaranteed to be unique within a container. -
getPageNumber
long getPageNumber()Obtain the page number this record lives on. -
getSlotNumberHint
int getSlotNumberHint()What slot number might the record be at?The raw store guarantees that the record handle of a record will not change, but it's slot number may. An implementation of a record handle may provide a hint of the slot number, which may help routines like Page.getSlotNumber() perform better.
If an implementation does not track slot numbers at all the implementation should just always return Page.FIRST_SLOT_NUMBER.
- Returns:
- The slot number the record handle may be at.
-
getContainerId
ContainerKey getContainerId()Return the identity of my container. -
getPageId
Object getPageId()Return the identity of my Page.
-