Top Description Constructors Methods
org.apache.derby.impl.store.access.btree.index

public Class B2INoLocking

extends Object
implements BTreeLockingPolicy
Class Inheritance
All Implemented Interfaces
org.apache.derby.impl.store.access.btree.BTreeLockingPolicy
Known Direct Subclasses
org.apache.derby.impl.store.access.btree.index.B2ITableLocking3
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.ConglomerateController, org.apache.derby.iapi.types.RowLocation, .DataValueDescriptor, org.apache.derby.iapi.store.raw.FetchDescriptor, .LockingPolicy, .RecordHandle, .Transaction, org.apache.derby.impl.store.access.btree.BTree, .BTreeLockingPolicy, .ControlRow, .LeafControlRow, .OpenBTree, .BTreeRowPosition

Secondary index locking policy that does no locking.

This is used when the caller knows that logical locks are already obtained so need not be requested again. For instance when inserting a row into an index, a X row lock has already been obtained when the row was inserted into the base table, so there is no need to get another lock in the secondary index.

This class overrides all interfaces of BTreeLockingPolicy making them no-ops.

Constructor Summary

AccessConstructor and Description
public
B2INoLocking(Transaction rawtran, int lock_level, LockingPolicy locking_policy, ConglomerateController base_cc, OpenBTree open_btree)

Constructors for This class:

protected

Method Summary

Modifier and TypeMethod and Description
public boolean
lockNonScanPreviousRow(LeafControlRow
Latched current leaf where "current" key is.
current_leaf
,
int
The slot of row on "current_leaf"
current_slot
,
FetchDescriptor lock_fetch_desc, DataValueDescriptor[]
Empty full template row, to read row into.
lock_template
,
RowLocation lock_row_loc, OpenBTree
The open_btree to associate latches with - used if routine has to scan backward.
open_btree
,
int
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_operation
,
int
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.
lock_duration
)

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanPreviousRow.

Lock the row previous to the input row.

public boolean
lockNonScanRow(BTree
The conglomerate we are locking.
btree
,
LeafControlRow
If non-null, this leaf is unlatched if the routine has to wait on the lock.
current_leaf
,
LeafControlRow
If non-null, this leaf is unlatched if the routine has to wait on the lock.
aux_leaf
,
DataValueDescriptor[]
In memory, objectified "current" row.
current_row
,
int
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_operation
)

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanRow.

Lock the in memory row.

public boolean
lockNonScanRowOnPage(LeafControlRow
The control row of the current leaf to lock.
current_leaf
,
int
The slot position of the row to lock.
current_slot
,
FetchDescriptor lock_fetch_desc, DataValueDescriptor[]
A scratch area to use to read in rows.
lock_template
,
RowLocation lock_row_loc, int
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_operation
)

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanRowOnPage.

Lock the row at the given slot.

public boolean
lockScanCommittedDeletedRow(OpenBTree
The conglomerate we are locking.
open_btree
,
LeafControlRow
The leaf page with the row to lock.
leaf
,
DataValueDescriptor[]
A scratch area to use to read in RowLocation.
template
,
FetchDescriptor lock_fetch_desc, int
The slot of row on "current_leaf"
slot_no
)

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanCommittedDeletedRow.

Lock a btree row to determine if it is a committed deleted row.

public boolean

Returns:

Whether locks were acquired without releasing latch on leaf.
lockScanRow
(OpenBTree
The open_btree to associate latches with - used if routine has to scan backward.
open_btree
,
BTreeRowPosition
The position of the row to lock.
pos
,
FetchDescriptor lock_fetch_desc, DataValueDescriptor[]
A scratch area to use to read in rows.
lock_template
,
RowLocation lock_row_loc, boolean
Is this a previous key lock call?
previous_key_lock
,
boolean
Is the scan for update or for read only.
forUpdate
,
int
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_operation
)

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanRow.

Lock a row as part of doing the scan.

public void
unlockScanRecordAfterRead(BTreeRowPosition
Data structure that defines the current position in the scan to be unlocked.
pos
,
boolean
Is the scan for update or for read only.
forUpdate
)

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.unlockScanRecordAfterRead.

Release read lock on a row.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

B2INoLockingback to summary
public B2INoLocking(Transaction rawtran, int lock_level, LockingPolicy locking_policy, ConglomerateController base_cc, OpenBTree open_btree)

Constructors for This class:

B2INoLockingback to summary
protected B2INoLocking()

Method Detail

lockNonScanPreviousRowback to summary
public boolean lockNonScanPreviousRow(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

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanPreviousRow.

Lock the row previous to the input row.

See BTree.lockPreviousRow() for more info.

Parameters
current_leaf:LeafControlRow

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanPreviousRow.

Latched current leaf where "current" key is.

current_slot:int

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanPreviousRow.

The slot of row on "current_leaf"

lock_template:DataValueDescriptor[]

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanPreviousRow.

Empty full template row, to read row into.

open_btree:OpenBTree

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanPreviousRow.

The open_btree to associate latches with - used if routine has to scan backward.

lock_operation:int

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanPreviousRow.

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:int

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanPreviousRow.

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.

Exceptions
StandardException:
Standard exception policy.
lockNonScanRowback to summary
public boolean lockNonScanRow(BTree btree, LeafControlRow current_leaf, LeafControlRow aux_leaf, DataValueDescriptor[] current_row, int lock_operation) throws StandardException

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanRow.

Lock the in memory row.

See BTree.lockRow() for more info.

Parameters
btree:BTree

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanRow.

The conglomerate we are locking.

current_leaf:LeafControlRow

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanRow.

If non-null, this leaf is unlatched if the routine has to wait on the lock.

aux_leaf:LeafControlRow

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanRow.

If non-null, this leaf is unlatched if the routine has to wait on the lock.

current_row:DataValueDescriptor[]

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanRow.

In memory, objectified "current" row.

lock_operation:int

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanRow.

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]

Exceptions
StandardException:
Standard exception policy.
lockNonScanRowOnPageback to summary
public boolean lockNonScanRowOnPage(LeafControlRow current_leaf, int current_slot, FetchDescriptor lock_fetch_desc, DataValueDescriptor[] lock_template, RowLocation lock_row_loc, int lock_operation) throws StandardException

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanRowOnPage.

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockNonScanRowOnPage.

Lock the row at the given slot.

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.

Parameters
current_leaf:LeafControlRow

The control row of the current leaf to lock.

current_slot:int

The slot position of the row to lock.

lock_template:DataValueDescriptor[]

A scratch area to use to read in rows.

lock_operation:int

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]

Returns:boolean

Whether locks were acquired without releasing latch on leaf.

Exceptions
StandardException:
Standard exception policy.
lockScanCommittedDeletedRowback to summary
public boolean lockScanCommittedDeletedRow(OpenBTree open_btree, LeafControlRow leaf, DataValueDescriptor[] template, FetchDescriptor lock_fetch_desc, int slot_no) throws StandardException

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanCommittedDeletedRow.

Lock a btree row to determine if it is a committed deleted row.

Request an exclusive lock on the row located at the given slot, NOWAIT. Return true if the lock is granted, otherwise false.

Parameters
open_btree:OpenBTree

The conglomerate we are locking.

leaf:LeafControlRow

The leaf page with the row to lock.

template:DataValueDescriptor[]

A scratch area to use to read in RowLocation.

slot_no:int

The slot of row on "current_leaf"

Exceptions
StandardException:
Standard exception policy.
lockScanRowback to summary
public boolean lockScanRow(OpenBTree open_btree, BTreeRowPosition pos, FetchDescriptor lock_fetch_desc, DataValueDescriptor[] lock_template, RowLocation lock_row_loc, boolean previous_key_lock, boolean forUpdate, int lock_operation) throws StandardException

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanRow.

Lock a row as part of doing the scan.

Lock the row at the given slot (or the previous row if slot is 0).

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.

Parameters
open_btree:OpenBTree

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanRow.

The open_btree to associate latches with - used if routine has to scan backward.

pos:BTreeRowPosition

The position of the row to lock.

lock_template:DataValueDescriptor[]

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanRow.

A scratch area to use to read in rows.

previous_key_lock:boolean

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanRow.

Is this a previous key lock call?

forUpdate:boolean

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanRow.

Is the scan for update or for read only.

lock_operation:int

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanRow.

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]

Returns:boolean

Whether locks were acquired without releasing latch on leaf.

Exceptions
StandardException:
Standard exception policy.
unlockScanRecordAfterReadback to summary
public void unlockScanRecordAfterRead(BTreeRowPosition pos, boolean forUpdate) throws StandardException

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.unlockScanRecordAfterRead.

Release read lock on a row.

Parameters
pos:BTreeRowPosition

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.unlockScanRecordAfterRead.

Data structure that defines the current position in the scan to be unlocked.

forUpdate:boolean

Is the scan for update or for read only.

Exceptions
StandardException:
Standard exception policy.