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

Quick Search    Search Deep

org.apache.derby.iapi.store.access
Interface GenericScanController  view GenericScanController download GenericScanController.java

All Superinterfaces:
RowCountable
All Known Subinterfaces:
GroupFetchScanController, ScanController

public interface GenericScanController
extends RowCountable

The set of interfaces implemented by all types of ScanControllers.

A scan is the mechanism for iterating over the rows in a conglomerate, the scan controller is the interface through which access clients control the underlying scan. An instance of a scan controller can be thought of as an open scan.

Scans are opened from a TransactionController.

A ScanController can handle partial rows. Partial rows are described in RowUtil.
A scan controller is opened with a FormatableBitSet that describes the columns that need to be returned on a fetch call. This FormatableBitSet need not include any columns referenced in the qualifers, start and/or stop keys.


Method Summary
 void close()
          Close the scan.
 ScanInfo getScanInfo()
          Return ScanInfo object which describes performance of scan.
 boolean isKeyed()
          Return whether this is a keyed conglomerate.
 boolean isTableLocked()
          Return whether this scan is table locked.
 org.apache.derby.iapi.types.RowLocation newRowLocationTemplate()
          Return a row location object to be used in calls to fetchLocation.
 void reopenScan(org.apache.derby.iapi.types.DataValueDescriptor[] startKeyValue, int startSearchOperator, Qualifier[][] qualifier, org.apache.derby.iapi.types.DataValueDescriptor[] stopKeyValue, int stopSearchOperator)
          Reposition the current scan.
 void reopenScanByRowLocation(org.apache.derby.iapi.types.RowLocation startRowLocation, Qualifier[][] qualifier)
          Reposition the current scan.
 
Methods inherited from interface org.apache.derby.iapi.store.access.RowCountable
getEstimatedRowCount, setEstimatedRowCount
 

Method Detail

close

public void close()
           throws org.apache.derby.iapi.error.StandardException
Close the scan. This method always succeeds, and never throws any exceptions. Callers must not use the scan controller after closing it; they are strongly advised to clear out the scan controller reference after closing.


getScanInfo

public ScanInfo getScanInfo()
                     throws org.apache.derby.iapi.error.StandardException
Return ScanInfo object which describes performance of scan.

Return ScanInfo object which contains information about the current state of the scan.

The statistics gathered by the scan are not reset to 0 by a reopenScan(), rather they continue to accumulate.


isKeyed

public boolean isKeyed()
Return whether this is a keyed conglomerate.


isTableLocked

public boolean isTableLocked()
Return whether this scan is table locked.

Implementation of this is not complete. Currently it does not give back the right information on covering locks or lock escalation. If the openScan() caller specifies a MODE_TABLE as the lock_level then this routine will always return true. If the openScan() caller specifies a MODE_RECORD as the lock_level then this routine will return true iff the lock level of the system has been overridden either by the derby.storage.rowLocking=false property, or by a shipped configuration which disables row locking.


newRowLocationTemplate

public org.apache.derby.iapi.types.RowLocation newRowLocationTemplate()
                                                               throws org.apache.derby.iapi.error.StandardException
Return a row location object to be used in calls to fetchLocation.

Return a row location object of the correct type to be used in calls to fetchLocation.


reopenScan

public void reopenScan(org.apache.derby.iapi.types.DataValueDescriptor[] startKeyValue,
                       int startSearchOperator,
                       Qualifier[][] qualifier,
                       org.apache.derby.iapi.types.DataValueDescriptor[] stopKeyValue,
                       int stopSearchOperator)
                throws org.apache.derby.iapi.error.StandardException
Reposition the current scan. This call is semantically the same as if the current scan had been closed and a openScan() had been called instead. The scan is reopened with against the same conglomerate, and the scan is reopened with the same "scan column list", "hold" and "forUpdate" parameters passed in the original openScan.

The statistics gathered by the scan are not reset to 0 by a reopenScan(), rather they continue to accumulate.


reopenScanByRowLocation

public void reopenScanByRowLocation(org.apache.derby.iapi.types.RowLocation startRowLocation,
                                    Qualifier[][] qualifier)
                             throws org.apache.derby.iapi.error.StandardException
Reposition the current scan. This call is semantically the same as if the current scan had been closed and a openScan() had been called instead. The scan is reopened against the same conglomerate, and the scan is reopened with the same "scan column list", "hold" and "forUpdate" parameters passed in the original openScan.

The statistics gathered by the scan are not reset to 0 by a reopenScan(), rather they continue to accumulate.

Note that this operation is currently only supported on Heap conglomerates. Also note that order of rows within are heap are not guaranteed, so for instance positioning at a RowLocation in the "middle" of a heap, then inserting more data, then continuing the scan is not guaranteed to see the new rows - they may be put in the "beginning" of the heap.