Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.store.access.btree.index
Class B2IForwardScan  view B2IForwardScan download B2IForwardScan.java

java.lang.Object
  extended byorg.apache.derby.impl.store.access.btree.OpenBTree
      extended byorg.apache.derby.impl.store.access.btree.BTreeScan
          extended byorg.apache.derby.impl.store.access.btree.BTreeForwardScan
              extended byorg.apache.derby.impl.store.access.btree.index.B2IForwardScan
All Implemented Interfaces:
org.apache.derby.iapi.store.access.GenericScanController, org.apache.derby.iapi.store.access.GroupFetchScanController, org.apache.derby.iapi.store.access.RowCountable, org.apache.derby.iapi.store.access.ScanController, org.apache.derby.iapi.store.access.conglomerate.ScanManager

public class B2IForwardScan
extends org.apache.derby.impl.store.access.btree.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
private  org.apache.derby.iapi.store.access.ConglomerateController base_cc_for_locking
           
private  int init_isolation_level
           
 
Fields inherited from class org.apache.derby.impl.store.access.btree.BTreeScan
fetchNext_one_slot_array, init_fetchDesc, init_forUpdate, init_hold, init_lock_fetch_desc, init_qualifier, init_rawtran, init_scanColumnList, init_startKeyValue, init_startSearchOperator, init_stopKeyValue, init_stopSearchOperator, init_template, init_useUpdateLocks, lock_operation, SCAN_DONE, SCAN_HOLD_INIT, SCAN_HOLD_INPROGRESS, SCAN_INIT, SCAN_INPROGRESS, scan_state, stat_numdeleted_rows_visited, stat_numpages_visited, stat_numrows_qualified, stat_numrows_visited
 
Fields inherited from class org.apache.derby.impl.store.access.btree.OpenBTree
btree_undo, container, err_containerid, init_lock_level, init_open_user_scans, runtime_mem
 
Fields inherited from interface org.apache.derby.iapi.store.access.ScanController
GE, GT, NA
 
Constructor Summary
(package private) B2IForwardScan()
           
 
Method Summary
 void close()
          Close the scan.
 boolean closeForEndTransaction(boolean closeHeldScan)
          Close the scan, a commit or abort is about to happen.
 void init(org.apache.derby.iapi.store.access.conglomerate.TransactionManager xact_manager, org.apache.derby.iapi.store.raw.Transaction rawtran, boolean hold, int open_mode, int lock_level, org.apache.derby.iapi.store.raw.LockingPolicy locking_policy, int isolation_level, boolean open_for_locking, org.apache.derby.iapi.services.io.FormatableBitSet scanColumnList, org.apache.derby.iapi.types.DataValueDescriptor[] startKeyValue, int startSearchOperator, org.apache.derby.iapi.store.access.Qualifier[][] qualifier, org.apache.derby.iapi.types.DataValueDescriptor[] stopKeyValue, int stopSearchOperator, B2I conglomerate, B2IUndo undo, B2IStaticCompiledInfo static_info, org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo dynamic_info)
          Initialize the scan for use.
 org.apache.derby.iapi.store.raw.ContainerHandle reopen()
          Open the container after it has been closed previously.
 
Methods inherited from class org.apache.derby.impl.store.access.btree.BTreeForwardScan
fetchRows, init, positionAtStartPosition
 
Methods inherited from class org.apache.derby.impl.store.access.btree.BTreeScan
delete, didNotQualify, doesCurrentPositionQualify, fetch, fetchLocation, fetchNext, fetchNextGroup, fetchNextGroup, fetchSet, getCurrentRecordHandleForDebugging, getScanInfo, isCurrentPositionDeleted, isKeyed, newRowLocationTemplate, next, positionAtDoneScan, positionAtDoneScanFromClose, positionAtNextPage, positionAtStartForBackwardScan, positionAtStartForForwardScan, process_qualifier, reopenScan, reopenScanByRowLocation, replace, reposition, savePosition, toString
 
Methods inherited from class org.apache.derby.impl.store.access.btree.OpenBTree
checkConsistency, debugConglomerate, getColumnSortOrderInfo, getConglomerate, getContainer, getContainerHandle, getEstimatedRowCount, getHeight, getHold, getLockingPolicy, getLockLevel, getOpenMode, getRawTran, getRuntimeMem, getSpaceInfo, getXactMgr, init, isClosed, isTableLocked, makeRecordHandle, setEstimatedRowCount, setLockingPolicy, test_errors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.derby.iapi.store.access.GenericScanController
isTableLocked
 
Methods inherited from interface org.apache.derby.iapi.store.access.RowCountable
getEstimatedRowCount, setEstimatedRowCount
 

Field Detail

base_cc_for_locking

private org.apache.derby.iapi.store.access.ConglomerateController base_cc_for_locking

init_isolation_level

private int init_isolation_level
Constructor Detail

B2IForwardScan

B2IForwardScan()
Method Detail

close

public void close()
           throws org.apache.derby.iapi.error.StandardException
Close the scan.


closeForEndTransaction

public boolean closeForEndTransaction(boolean closeHeldScan)
                               throws org.apache.derby.iapi.error.StandardException
Close the scan, a commit or abort is about to happen.


reopen

public org.apache.derby.iapi.store.raw.ContainerHandle reopen()
                                                       throws org.apache.derby.iapi.error.StandardException
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.


init

public void init(org.apache.derby.iapi.store.access.conglomerate.TransactionManager xact_manager,
                 org.apache.derby.iapi.store.raw.Transaction rawtran,
                 boolean hold,
                 int open_mode,
                 int lock_level,
                 org.apache.derby.iapi.store.raw.LockingPolicy locking_policy,
                 int isolation_level,
                 boolean open_for_locking,
                 org.apache.derby.iapi.services.io.FormatableBitSet scanColumnList,
                 org.apache.derby.iapi.types.DataValueDescriptor[] startKeyValue,
                 int startSearchOperator,
                 org.apache.derby.iapi.store.access.Qualifier[][] qualifier,
                 org.apache.derby.iapi.types.DataValueDescriptor[] stopKeyValue,
                 int stopSearchOperator,
                 B2I conglomerate,
                 B2IUndo undo,
                 B2IStaticCompiledInfo static_info,
                 org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo dynamic_info)
          throws org.apache.derby.iapi.error.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.