org.apache.derby.impl.store.access.btree.index
Class B2IMaxScan

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.BTreeMaxScan
              extended byorg.apache.derby.impl.store.access.btree.index.B2IMaxScan
All Implemented Interfaces:
GenericScanController, GroupFetchScanController, RowCountable, ScanController, ScanManager

public class B2IMaxScan
extends BTreeMaxScan

Scan used to find maximum value in the secondary index. This class implements an optimized interface to find the maximum row, for a set of rows between an input start and stop key. 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  ConglomerateController base_cc_for_locking
           
 
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) B2IMaxScan()
           
 
Method Summary
 void close()
          Close the scan.
 boolean closeForEndTransaction(boolean closeHeldScan)
          Close the scan, a commit or abort is about to happen.
 void init(TransactionManager xact_manager, Transaction rawtran, int open_mode, int lock_level, LockingPolicy locking_policy, int isolation_level, boolean open_for_locking, FormatableBitSet scanColumnList, B2I conglomerate, B2IUndo undo)
          Initialize the scan for use.
 
Methods inherited from class org.apache.derby.impl.store.access.btree.BTreeMaxScan
fetchMax, fetchRows, positionAtStartPosition
 
Methods inherited from class org.apache.derby.impl.store.access.btree.BTreeScan
delete, didNotQualify, doesCurrentPositionQualify, fetch, fetchLocation, fetchNext, fetchNextGroup, fetchNextGroup, fetchSet, getCurrentRecordHandleForDebugging, getScanInfo, init, 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, reopen, 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 ConglomerateController base_cc_for_locking
Constructor Detail

B2IMaxScan

B2IMaxScan()
Method Detail

close

public void close()
           throws StandardException
Close the scan.

Specified by:
close in interface GenericScanController
Overrides:
close in class BTreeScan
Throws:
StandardException
See Also:
GenericScanController.newRowLocationTemplate()

closeForEndTransaction

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

Specified by:
closeForEndTransaction in interface ScanManager
Overrides:
closeForEndTransaction in class BTreeScan
Throws:
StandardException

init

public void init(TransactionManager xact_manager,
                 Transaction rawtran,
                 int open_mode,
                 int lock_level,
                 LockingPolicy locking_policy,
                 int isolation_level,
                 boolean open_for_locking,
                 FormatableBitSet scanColumnList,
                 B2I conglomerate,
                 B2IUndo undo)
          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.

Throws:
StandardException - Standard exception policy.

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.