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

public Class B2IForwardScan

extends BTreeForwardScan
Class Inheritance
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.conglomerate.Conglomerate, .TransactionManager, org.apache.derby.iapi.store.access.ConglomerateController, .DynamicCompiledOpenConglomInfo, .Qualifier, .TransactionController, .GenericScanController, org.apache.derby.iapi.store.raw.ContainerHandle, .LockingPolicy, .Transaction, org.apache.derby.iapi.types.DataValueDescriptor, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.impl.store.access.btree.BTreeLockingPolicy, .BTreeForwardScan

The btree secondary index implementation of ScanManager which provides reading and deleting of entries in the btree secondary index. This supports setting up and iterating through a set of rows while providing a start key, stop key, and a set of AND and OR qualifiers to skip unwanted rows. Currently derby only supports forward scans (but individual columns can have descending order). This interface is also used to delete rows from the conglomerate. Note that update is not supported, it must be implemented as a delete, followed by an insert. Note most work of this class is inherited from the generic btree implementation. This class initializes the top level object and deals with locking information specific to a secondary index implementation of a btree.

Field Summary

Modifier and TypeField and Description
private ConglomerateController
private int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public boolean
closeForEndTransaction(boolean
If true, means to close scan even if it has been opened to be kept opened across commit. This is used to close these scans on abort.
closeHeldScan
)

Overrides org.apache.derby.impl.store.access.btree.BTreeScan.closeForEndTransaction.

Implements org.apache.derby.iapi.store.access.conglomerate.ScanManager.closeForEndTransaction.

Close the scan, a commit or abort is about to happen.

public void
init(TransactionManager xact_manager, Transaction rawtran, boolean hold, int open_mode, int lock_level, LockingPolicy locking_policy, int isolation_level, boolean open_for_locking, FormatableBitSet scanColumnList, DataValueDescriptor[] startKeyValue, int startSearchOperator, Qualifier[][] qualifier, DataValueDescriptor[] stopKeyValue, int stopSearchOperator, B2I conglomerate, B2IUndo undo, B2IStaticCompiledInfo static_info, DynamicCompiledOpenConglomInfo dynamic_info)

Initialize the scan for use.

public ContainerHandle
reopen()

Overrides org.apache.derby.impl.store.access.btree.OpenBTree.reopen.

Open the container after it has been closed previously.

Inherited from org.apache.derby.impl.store.access.btree.BTreeForwardScan:
fetchRowspositionAtStartPosition

Field Detail

base_cc_for_lockingback to summary
private ConglomerateController base_cc_for_locking
init_isolation_levelback to summary
private int init_isolation_level

Constructor Detail

B2IForwardScanback to summary
pack-priv B2IForwardScan()

Method Detail

closeback to summary
public void close() throws StandardException

Overrides org.apache.derby.impl.store.access.btree.BTreeScan.close.

Implements org.apache.derby.iapi.store.access.GenericScanController.close.

Close the scan.

Exceptions
StandardException:

Doc from org.apache.derby.iapi.store.access.GenericScanController.close.

Standard exception policy.

See Also
GenericScanController#newRowLocationTemplate
closeForEndTransactionback to summary
public boolean closeForEndTransaction(boolean closeHeldScan) throws StandardException

Overrides org.apache.derby.impl.store.access.btree.BTreeScan.closeForEndTransaction.

Implements org.apache.derby.iapi.store.access.conglomerate.ScanManager.closeForEndTransaction.

Close the scan, a commit or abort is about to happen.

Parameters
closeHeldScan:boolean

Doc from org.apache.derby.iapi.store.access.conglomerate.ScanManager.closeForEndTransaction.

If true, means to close scan even if it has been opened to be kept opened across commit. This is used to close these scans on abort.

Returns:boolean

Doc from org.apache.derby.iapi.store.access.conglomerate.ScanManager.closeForEndTransaction.

boolean indicating that the close has resulted in a real close of the scan. A held scan will return false if called by closeForEndTransaction(false), otherwise it will return true. A non-held scan will always return true.

Exceptions
StandardException:

Doc from org.apache.derby.iapi.store.access.conglomerate.ScanManager.closeForEndTransaction.

Standard exception policy.

initback to summary
public void init(TransactionManager xact_manager, Transaction rawtran, boolean hold, int open_mode, int lock_level, LockingPolicy locking_policy, int isolation_level, boolean open_for_locking, FormatableBitSet scanColumnList, DataValueDescriptor[] startKeyValue, int startSearchOperator, Qualifier[][] qualifier, DataValueDescriptor[] stopKeyValue, int stopSearchOperator, B2I conglomerate, B2IUndo undo, B2IStaticCompiledInfo static_info, DynamicCompiledOpenConglomInfo dynamic_info) throws StandardException

Initialize the scan for use.

Any changes to this method may have to be reflected in close as well.

The btree init opens the container (super.init), and stores away the state of the qualifiers. The actual searching for the first position is delayed until the first next() call.

Exceptions
StandardException:
Standard exception policy.
reopenback to summary
public ContainerHandle reopen() throws StandardException

Overrides org.apache.derby.impl.store.access.btree.OpenBTree.reopen.

Open the container after it has been closed previously.

Open the container, obtaining necessary locks. Most work is actually done by RawStore.openContainer(). Will only reopen() if the container is not already open.

Exceptions
StandardException:
Standard exception policy.