Lockable
, RecordHandle
public final class RecordId extends java.lang.Object implements RecordHandle
Modifier and Type | Field | Description |
---|---|---|
private PageKey |
pageId |
Page the record lives in.
|
private int |
recordId |
The actual record id.
|
private int |
slotNumberHint |
Last slot number this record id was at.
|
DEALLOCATE_PROTECTION_HANDLE, FIRST_RECORD_ID, INVALID_RECORD_HANDLE, PREVIOUS_KEY_HANDLE, RESERVED1_RECORD_HANDLE, RESERVED4_RECORD_HANDLE, RESERVED5_RECORD_HANDLE
Constructor | Description |
---|---|
RecordId(ContainerKey container,
long pageNumber,
int recordId) |
|
RecordId(PageKey pageId,
int recordId) |
|
RecordId(PageKey pageId,
int recordId,
int current_slot) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(java.lang.Object ref) |
Implement value equality.
|
ContainerKey |
getContainerId() |
Return the identity of my container.
|
int |
getId() |
Get my record id.
|
java.lang.Object |
getPageId() |
Return the identity of my Page.
|
long |
getPageNumber() |
Get my page number.
|
int |
getSlotNumberHint() |
What slot number might the record be at?
|
int |
hashCode() |
Return a hashcode based on value.
|
boolean |
lockAttributes(int flag,
java.util.Hashtable<java.lang.String,java.lang.Object> attributes) |
This lockable wants to participate in the Virtual Lock table.
|
boolean |
lockerAlwaysCompatible() |
Is a caller that holds a lock compatible with themselves?
|
void |
lockEvent(Latch lockInfo) |
Lock me.
|
boolean |
requestCompatible(java.lang.Object requestedQualifier,
java.lang.Object grantedQualifier) |
Determine if this request can be granted.
|
java.lang.String |
toString() |
|
void |
unlockEvent(Latch lockInfo) |
Unlock me.
|
private final PageKey pageId
private final int recordId
private transient int slotNumberHint
public RecordId(ContainerKey container, long pageNumber, int recordId)
public RecordId(PageKey pageId, int recordId)
public RecordId(PageKey pageId, int recordId, int current_slot)
public int getId()
getId
in interface RecordHandle
RecordHandle.getId()
public long getPageNumber()
getPageNumber
in interface RecordHandle
RecordHandle.getPageNumber()
public java.lang.Object getPageId()
RecordHandle
getPageId
in interface RecordHandle
public ContainerKey getContainerId()
RecordHandle
getContainerId
in interface RecordHandle
public int getSlotNumberHint()
The raw store guarantees that the record handle of a record will not change, but its slot number may. When a RecordId is constructed the caller could have provided a slot number, if so return that slot number hint here. If a hint was not provided then the default Page.FIRST_SLOT_NUMBER will be returned.
getSlotNumberHint
in interface RecordHandle
public void lockEvent(Latch lockInfo)
lockEvent
in interface Lockable
Lockable.lockEvent(org.apache.derby.iapi.services.locks.Latch)
public boolean requestCompatible(java.lang.Object requestedQualifier, java.lang.Object grantedQualifier)
Implements the grant/wait lock logic for row locks. See the
table in RowLock for more information.
MT - Single thread required (methods of Lockable)
requestCompatible
in interface Lockable
Lockable.requestCompatible(java.lang.Object, java.lang.Object)
public boolean lockerAlwaysCompatible()
Row locks held in the same transaction are always compatible with
themselves.
MT - Single thread required (methods of Lockable)
lockerAlwaysCompatible
in interface Lockable
Lockable.lockerAlwaysCompatible()
public void unlockEvent(Latch lockInfo)
unlockEvent
in interface Lockable
Lockable.unlockEvent(org.apache.derby.iapi.services.locks.Latch)
public boolean equals(java.lang.Object ref)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public boolean lockAttributes(int flag, java.util.Hashtable<java.lang.String,java.lang.Object> attributes)
lockAttributes
in interface Lockable
flag
- use the bits in this int to decide if the user is
interested in this kind of lockable object. The bits are defined in
VirtualLockTable. For instance, the user may only ask
for TABLE_AND_ROWLOCK and if this is not a table or row lock, then
don't participate.attributes
- if this decides to participate, put all relevant
attributes into the Hashtable. The complete list of interesting
attributes is listed in VirtualLockTable.
The following attributes must be present for all participating
lockables:
VirtualLockTable.LOCKNAME,
VirtualLockTable.LOCKTYPE,
either VirtualLockTable.CONTAINERID or VirtualLockTable.CONGLOMID,
MT - this routine must be MP safe, caller will not be single threading the lock manager.
VirtualLockTable
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.