|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.store.access.btree.index.B2IRowLocking3
org.apache.derby.impl.store.access.btree.index.B2IRowLockingRR
org.apache.derby.impl.store.access.btree.index.B2IRowLocking2
org.apache.derby.impl.store.access.btree.index.B2IRowLocking1
The btree locking policy which implements read uncommitted isolation level. It inherits all functionality from B2IRowLocking2 except that it does not get any read row locks (and thus does not release them). Note that table level and table level intent locking remains the same as B2IRowLocking2 as this is currently the way we prevent concurrent ddl from happening while a read uncommitted scanner is operating in the btree.
Field Summary | |
protected ConglomerateController |
base_cc
The container id of the base container for this index. |
protected OpenBTree |
open_btree
The OpenBtree to use if we have to lock anything in the btree vs. |
Constructor Summary | |
(package private) |
B2IRowLocking1(Transaction rawtran,
int lock_level,
LockingPolicy locking_policy,
ConglomerateController base_cc,
OpenBTree open_btree)
Constructors for This class: |
Method Summary | |
protected boolean |
_lockScanRow(OpenBTree open_btree,
BTree btree,
BTreeRowPosition pos,
boolean request_row_lock,
boolean request_scan_lock,
FetchDescriptor lock_fetch_desc,
DataValueDescriptor[] lock_template,
RowLocation lock_row_loc,
boolean previous_key_lock,
boolean forUpdate,
int lock_operation)
Lock a row as part of doing the scan. |
boolean |
lockNonScanPreviousRow(BTree btree,
LeafControlRow current_leaf,
int current_slot,
FetchDescriptor lock_fetch_desc,
DataValueDescriptor[] lock_template,
RowLocation lock_row_loc,
OpenBTree open_btree,
int lock_operation,
int lock_duration)
Lock the row previous to the input row. |
boolean |
lockNonScanRow(BTree btree,
LeafControlRow current_leaf,
LeafControlRow aux_leaf,
DataValueDescriptor[] current_row,
int lock_operation)
Lock the in memory row. |
boolean |
lockNonScanRowOnPage(BTree btree,
LeafControlRow current_leaf,
int current_slot,
FetchDescriptor lock_fetch_desc,
DataValueDescriptor[] lock_template,
RowLocation lock_row_loc,
int lock_operation)
Lock the row at the given slot. |
boolean |
lockScan(LeafControlRow current_leaf,
ControlRow aux_control_row,
boolean forUpdate,
int lock_operation)
Lock a control row page for scan. |
boolean |
lockScanCommittedDeletedRow(OpenBTree open_btree,
LeafControlRow leaf,
DataValueDescriptor[] template,
FetchDescriptor lock_fetch_desc,
int slot_no)
Lock a btree row to determine if it is a committed deleted row. |
boolean |
lockScanForReclaimSpace(LeafControlRow current_leaf)
Lock a control row page for reclaiming deleted rows. |
boolean |
lockScanRow(OpenBTree open_btree,
BTree btree,
BTreeRowPosition pos,
boolean request_scan_lock,
FetchDescriptor lock_fetch_desc,
DataValueDescriptor[] lock_template,
RowLocation lock_row_loc,
boolean previous_key_lock,
boolean forUpdate,
int lock_operation)
Lock a row as part of doing the scan. |
void |
unlockScan(long page_number)
Release the lock gotten by calling lockScan. |
void |
unlockScanRecordAfterRead(BTreeRowPosition pos,
boolean forUpdate)
Release read lock on a row. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.derby.impl.store.access.btree.BTreeLockingPolicy |
lockNonScanPreviousRow, lockNonScanRow, lockNonScanRowOnPage, lockScan, lockScanCommittedDeletedRow, lockScanForReclaimSpace, unlockScan |
Field Detail |
protected ConglomerateController base_cc
protected OpenBTree open_btree
Constructor Detail |
B2IRowLocking1(Transaction rawtran, int lock_level, LockingPolicy locking_policy, ConglomerateController base_cc, OpenBTree open_btree)
Method Detail |
public boolean lockScanRow(OpenBTree open_btree, BTree btree, BTreeRowPosition pos, boolean request_scan_lock, FetchDescriptor lock_fetch_desc, DataValueDescriptor[] lock_template, RowLocation lock_row_loc, boolean previous_key_lock, boolean forUpdate, int lock_operation) throws StandardException
Lock the row at the given slot (or the previous row if slot is 0). Get the scan lock on the page if "request_scan_lock" is true.
If this routine returns true all locks were acquired while maintaining the latch on leaf. If this routine returns false, locks may or may not have been acquired, and the routine should be called again after the client has researched the tree to reget the latch on the appropriate page. (p> As a side effect stores the value of the record handle of the current scan lock.
lockScanRow
in interface BTreeLockingPolicy
lockScanRow
in class B2IRowLockingRR
open_btree
- The open_btree to associate latches with -
used if routine has to scan backward.btree
- the conglomerate info.pos
- The position of the row to lock.request_scan_lock
- Whether to request the page scan lock, should
only be requested once per page in the scan.lock_template
- A scratch area to use to read in rows.previous_key_lock
- Is this a previous key lock call?forUpdate
- Is the scan for update or for read only.
StandardException
- Standard exception policy.public void unlockScanRecordAfterRead(BTreeRowPosition pos, boolean forUpdate) throws StandardException
unlockScanRecordAfterRead
in interface BTreeLockingPolicy
unlockScanRecordAfterRead
in class B2IRowLocking2
pos
- The position of the row to unlock.forUpdate
- Is the scan for update or for read only.
StandardException
protected boolean _lockScanRow(OpenBTree open_btree, BTree btree, BTreeRowPosition pos, boolean request_row_lock, boolean request_scan_lock, FetchDescriptor lock_fetch_desc, DataValueDescriptor[] lock_template, RowLocation lock_row_loc, boolean previous_key_lock, boolean forUpdate, int lock_operation) throws StandardException
Lock the row at the given slot (or the previous row if slot is 0). Get the scan lock on the page if "request_scan_lock" is true.
If this routine returns true all locks were acquired while maintaining the latch on leaf. If this routine returns false, locks may or may not have been acquired, and the routine should be called again after the client has researched the tree to reget the latch on the appropriate page. (p> As a sided effect stores the value of the record handle of the current scan lock.
open_btree
- The open_btree to associate latches with -
used if routine has to scan backward.btree
- the conglomerate info.pos
- The position of the row to lock.request_row_lock
- Whether to request the row lock, should
only be requested once per page in the scan.request_scan_lock
- Whether to request the page scan lock, should
only be requested once per page in the scan.lock_fetch_desc
- The fetch descriptor to use to fetch the
row location for the lock request.lock_template
- A scratch area to use to read in rows.previous_key_lock
- Is this a previous key lock call?forUpdate
- Is the scan for update or for read only.
StandardException
- Standard exception policy.public boolean lockScan(LeafControlRow current_leaf, ControlRow aux_control_row, boolean forUpdate, int lock_operation) throws StandardException
Scanners get shared lock on the page while positioned on a row within the page, splitter/purgers/mergers get exclusive lock on the page. See BTree.lockScan() for more info.
lockScan
in interface BTreeLockingPolicy
current_leaf
- The lock is associated with this page in the
btree. This control row is unlatched if the
routine has to wait on the lock.aux_control_row
- If non-null, this control row is unlatched
if the routine has to wait on the lock.forUpdate
- Whether to wait for lock.lock_operation
- For what operation are we requesting the lock,
this should be one of the following 4 options:
LOCK_READ [read lock],
(LOCK_INS | LOCK_UPD) [ lock for insert],
(LOCK_INSERT_PREVKEY | LOCK_UPD) [lock for
previous key to insert],
(LOCK_UPD) [lock for delete or replace]
StandardException
- Standard exception policy.public boolean lockScanForReclaimSpace(LeafControlRow current_leaf) throws StandardException
When reclaiming deleted rows during split need to get an exclusive scan lock on the page, which will mean there are no other scans positioned on the page. If there are other scans positioned, just give up on reclaiming space now.
lockScanForReclaimSpace
in interface BTreeLockingPolicy
StandardException
- Standard exception policy.public boolean lockScanCommittedDeletedRow(OpenBTree open_btree, LeafControlRow leaf, DataValueDescriptor[] template, FetchDescriptor lock_fetch_desc, int slot_no) throws StandardException
lockScanCommittedDeletedRow
in interface BTreeLockingPolicy
open_btree
- The conglomerate we are locking.leaf
- The leaf page with the row to lock.template
- Empty full template row, to read row into.slot_no
- The slot of row on "current_leaf"
StandardException
- Standard exception policy.BTreeLockingPolicy.lockScanCommittedDeletedRow(org.apache.derby.impl.store.access.btree.OpenBTree, org.apache.derby.impl.store.access.btree.LeafControlRow, org.apache.derby.iapi.types.DataValueDescriptor[], org.apache.derby.iapi.store.raw.FetchDescriptor, int)
public void unlockScan(long page_number)
See BTree.unlockScan() for more info.
unlockScan
in interface BTreeLockingPolicy
page_number
- page number of page that lockScan was called on.public boolean lockNonScanPreviousRow(BTree btree, LeafControlRow current_leaf, int current_slot, FetchDescriptor lock_fetch_desc, DataValueDescriptor[] lock_template, RowLocation lock_row_loc, OpenBTree open_btree, int lock_operation, int lock_duration) throws StandardException
See BTree.lockPreviousRow() for more info.
lockNonScanPreviousRow
in interface BTreeLockingPolicy
btree
- The conglomerate we are locking.current_leaf
- Latched current leaf where "current" key is.current_slot
- The slot of row on "current_leaf"lock_template
- Empty full template row, to read row into.open_btree
- The open_btree to associate latches with -
used if routine has to scan backward.lock_operation
- For what operation are we requesting the lock,
this should be one of the following 4 options:
LOCK_READ [read lock],
(LOCK_INS | LOCK_UPD) [ lock for insert],
(LOCK_INSERT_PREVKEY | LOCK_UPD) [lock for
previous key to insert],
(LOCK_UPD) [lock for delete or replace]lock_duration
- For what duration should the lock be held,
if INSTANT_DURATION, then the routine will
guarantee that lock was acquired while holding
the latch, but then immediately release the
lock. If COMMIT_DURATION or MANUAL_DURATION
then the lock be held when routine returns
successfully.
StandardException
- Standard exception policy.public boolean lockNonScanRow(BTree btree, LeafControlRow current_leaf, LeafControlRow aux_leaf, DataValueDescriptor[] current_row, int lock_operation) throws StandardException
See BTree.lockRow() for more info.
lockNonScanRow
in interface BTreeLockingPolicy
btree
- The conglomerate we are locking.current_leaf
- If non-null, this leaf is unlatched if the
routine has to wait on the lock.aux_leaf
- If non-null, this leaf is unlatched if the
routine has to wait on the lock.current_row
- In memory, objectified "current" row.lock_operation
- For what operation are we requesting the lock,
this should be one of the following 4 options:
LOCK_READ [read lock],
(LOCK_INS | LOCK_UPD) [ lock for insert],
(LOCK_INSERT_PREVKEY | LOCK_UPD) [lock for
previous key to insert],
(LOCK_UPD) [lock for delete or replace]
StandardException
- Standard exception policy.public boolean lockNonScanRowOnPage(BTree btree, LeafControlRow current_leaf, int current_slot, FetchDescriptor lock_fetch_desc, DataValueDescriptor[] lock_template, RowLocation lock_row_loc, int lock_operation) throws StandardException
BTreeLockingPolicy
If this routine returns true all locks were acquired while maintaining the latch on leaf. If this routine returns false, locks may or may not have been acquired, and the routine should be called again after the client has researched the tree to reget the latch on the appropriate page.
lockNonScanRowOnPage
in interface BTreeLockingPolicy
btree
- the conglomerate info.current_leaf
- The control row of the current leaf to lock.current_slot
- The slot position of the row to lock.lock_template
- A scratch area to use to read in rows.lock_operation
- For what operation are we requesting the lock,
this should be one of the following 4 options:
LOCK_READ [read lock],
(LOCK_INS | LOCK_UPD) [ lock for insert],
(LOCK_INSERT_PREVKEY | LOCK_UPD) [lock for
previous key to insert],
(LOCK_UPD) [lock for delete or replace]
StandardException
- Standard exception policy.
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |