Top Description Fields Methods
org.apache.derby.iapi.store.raw

public Interface RecordHandle

extends Lockable
Known Direct Implementers
org.apache.derby.impl.store.raw.data.RecordId
Imports
org.apache.derby.iapi.services.locks.Lockable

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
Page

Field Summary

Modifier and TypeField and Description
public static final int
DEALLOCATE_PROTECTION_HANDLE

A lock with this recordHandle protects this deallocated page from being freed and reallocated.

public static final int
FIRST_RECORD_ID

First recordId that is used to identify a record.

public static final int
INVALID_RECORD_HANDLE

An invalid record handle

public static final int
PREVIOUS_KEY_HANDLE

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.

public static final int
RESERVED1_RECORD_HANDLE

Reserved for future use - name it and define it when you have a need to use one.

public static final int
RESERVED4_RECORD_HANDLE

Reserve for future use - name it and define it when you have a need to use one

public static final int

Method Summary

Modifier and TypeMethod and Description
public ContainerKey
getContainerId()

Return the identity of my container.

public int
getId()

Obtain the page-unique identifier for this record.

public Object
getPageId()

Return the identity of my Page.

public long
getPageNumber()

Obtain the page number this record lives on.

public int

Returns:

The slot number the record handle may be at.
getSlotNumberHint
()

What slot number might the record be at?

Inherited from org.apache.derby.iapi.services.locks.Lockable:
lockAttributeslockerAlwaysCompatiblelockEventrequestCompatibleunlockEvent

Field Detail

DEALLOCATE_PROTECTION_HANDLEback to summary
public static final int DEALLOCATE_PROTECTION_HANDLE

A 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.

FIRST_RECORD_IDback to summary
public static final int FIRST_RECORD_ID

First recordId that is used to identify a record.

INVALID_RECORD_HANDLEback to summary
public static final int INVALID_RECORD_HANDLE

An invalid record handle

PREVIOUS_KEY_HANDLEback to summary
public static final int PREVIOUS_KEY_HANDLE

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.

RESERVED1_RECORD_HANDLEback to summary
public static final int RESERVED1_RECORD_HANDLE

Reserved for future use - name it and define it when you have a need to use one.

RESERVED4_RECORD_HANDLEback to summary
public static final int RESERVED4_RECORD_HANDLE

Reserve for future use - name it and define it when you have a need to use one

RESERVED5_RECORD_HANDLEback to summary
public static final int RESERVED5_RECORD_HANDLE

Method Detail

getContainerIdback to summary
public ContainerKey getContainerId()

Return the identity of my container.

getIdback to summary
public 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.

getPageIdback to summary
public Object getPageId()

Return the identity of my Page.

getPageNumberback to summary
public long getPageNumber()

Obtain the page number this record lives on.

getSlotNumberHintback to summary
public 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:int

The slot number the record handle may be at.