org.apache.derby.impl.sql.execute
Class BulkTableScanResultSet
java.lang.Object
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
org.apache.derby.impl.sql.execute.NoPutResultSetImpl
org.apache.derby.impl.sql.execute.ScanResultSet
org.apache.derby.impl.sql.execute.TableScanResultSet
org.apache.derby.impl.sql.execute.BulkTableScanResultSet
- All Implemented Interfaces:
- java.lang.Cloneable, CursorResultSet, NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource
class BulkTableScanResultSet
- extends TableScanResultSet
- implements CursorResultSet
Read a base table or index in bulk. Most of the
work for this method is inherited from TableScanResultSet.
This class overrides getNextRowCore (and extends
re/openCore) to use a row array and fetch rows
from the Store in bulk (using fetchNextGroup).
Since it retrieves rows in bulk, locking is not
as is usual -- locks may have already been released
on rows as they are returned to the user. Hence,
this ResultSet is not suitable for a query running
Isolation Level 1, cursor stability.
Note that this code is only accessable from an
optimizer override. If it makes sense to have the
optimizer select bulk reads, then this should
probably be rolled into TableScanResultSet.
Fields inherited from class org.apache.derby.impl.sql.execute.TableScanResultSet |
coarserLock, compareToLastKey, conglomId, currentRowPrescanned, dcoci, firstScan, forUpdate, futureForUpdateRows, futureRowResultSet, indexCols, indexName, isConstraint, isKeyed, lastCursorKey, oneRowScan, past2FutureTbl, qualifiers, resultRowAllocator, rowsPerRead, rowsThisScan, runTimeStatisticsOn, sameStartStopPosition, scanController, scanControllerOpened, scoci, skipFutureRowHolder, sourceDrained, startKeyGetter, startPosition, startPositionString, startSearchOperator, stopKeyGetter, stopPosition, stopPositionString, stopSearchOperator, tableName, userSuppliedOptimizerOverrides |
Fields inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl |
activation, beginTime, closeTime, compactRow, constructorTime, currentRow, endExecutionTime, finished, isOpen, isTopResultSet, nextTime, numOpens, openTime, optimizerEstimatedCost, optimizerEstimatedRowCount, resultDescription, rowsFiltered, rowsSeen, startExecutionTime, subqueryTrackingArray |
Constructor Summary |
BulkTableScanResultSet(long conglomId,
StaticCompiledOpenConglomInfo scoci,
Activation activation,
GeneratedMethod resultRowAllocator,
int resultSetNumber,
GeneratedMethod startKeyGetter,
int startSearchOperator,
GeneratedMethod stopKeyGetter,
int stopSearchOperator,
boolean sameStartStopPosition,
Qualifier[][] qualifiers,
java.lang.String tableName,
java.lang.String userSuppliedOptimizerOverrides,
java.lang.String indexName,
boolean isConstraint,
boolean forUpdate,
int colRefItem,
int indexColItem,
int lockMode,
boolean tableLocked,
int isolationLevel,
int rowsPerRead,
boolean oneRowScan,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost)
Constructor. |
Methods inherited from class org.apache.derby.impl.sql.execute.TableScanResultSet |
clone, getCurrentRow, getRowLocation, getScanProperties, getTimeSpent, initStartAndStopKey, isForUpdate, positionScanAtRowLocation, printStartPosition, printStopPosition, reopenScanController, setRowCountIfPossible |
Methods inherited from class org.apache.derby.impl.sql.execute.NoPutResultSetImpl |
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, markRowAsDeleted, needsRowLocation, needsToClone, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, updateRow |
Methods inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl |
addWarning, attachStatementContext, checkCancellationFlag, checkRowPosition, cleanUp, dumpTimeStats, finish, finishAndRTS, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCompactRow, getCurrentTimeMillis, getElapsedMillis, getEndExecutionTimestamp, getEstimatedRowCount, getExecuteTime, getExecutionFactory, getFirstRow, getLanguageConnectionContext, getLastRow, getNextRow, getPointOfAttachment, getPreviousRow, getRelativeRow, getRowNumber, getSubqueryTrackingArray, getTransactionController, getWarnings, isClosed, markAsTopResultSet, modifiedRowCount, open, recordConstructorTime, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.derby.iapi.sql.ResultSet |
checkRowPosition, cleanUp, clearCurrentRow, finish, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getRelativeRow, getResultDescription, getRowNumber, getSubqueryTrackingArray, getTimeSpent, getWarnings, isClosed, modifiedRowCount, open, returnsRows, setAfterLastRow, setBeforeFirstRow |
rowArray
private DataValueDescriptor[][] rowArray
curRowPosition
private int curRowPosition
numRowsInArray
private int numRowsInArray
OUT_OF_ROWS
private static int OUT_OF_ROWS
BulkTableScanResultSet
BulkTableScanResultSet(long conglomId,
StaticCompiledOpenConglomInfo scoci,
Activation activation,
GeneratedMethod resultRowAllocator,
int resultSetNumber,
GeneratedMethod startKeyGetter,
int startSearchOperator,
GeneratedMethod stopKeyGetter,
int stopSearchOperator,
boolean sameStartStopPosition,
Qualifier[][] qualifiers,
java.lang.String tableName,
java.lang.String userSuppliedOptimizerOverrides,
java.lang.String indexName,
boolean isConstraint,
boolean forUpdate,
int colRefItem,
int indexColItem,
int lockMode,
boolean tableLocked,
int isolationLevel,
int rowsPerRead,
boolean oneRowScan,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost)
throws StandardException
- Constructor. Just save off the rowsPerRead argument
and pass everything else down to TableScanResultSet
- Throws:
StandardException
- thrown on failure to open- See Also:
ResultSetFactory.getBulkTableScanResultSet(org.apache.derby.iapi.sql.Activation, long, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, boolean, org.apache.derby.iapi.store.access.Qualifier[][], java.lang.String, java.lang.String, java.lang.String, boolean, boolean, int, int, int, boolean, int, int, boolean, double, double)
openScanController
protected void openScanController(TransactionController tc)
throws StandardException
- Open the scan controller
- Overrides:
openScanController
in class TableScanResultSet
- Parameters:
tc
- transaction controller will open one if null
- Throws:
StandardException
- thrown on failure to open
openCore
public void openCore()
throws StandardException
- Open up the result set. Delegate
most work to TableScanResultSet.openCore().
Create a new array with rows
for use in fetchNextGroup().
- Specified by:
openCore
in interface NoPutResultSet
- Overrides:
openCore
in class TableScanResultSet
- Throws:
StandardException
- thrown on failure to open
reopenCore
public void reopenCore()
throws StandardException
- Reopen the result set. Delegate
most work to TableScanResultSet.reopenCore().
Reuse the array of rows.
- Specified by:
reopenCore
in interface NoPutResultSet
- Overrides:
reopenCore
in class TableScanResultSet
- Throws:
StandardException
- thrown on failure to open- See Also:
NoPutResultSet.openCore()
getNextRowCore
public ExecRow getNextRowCore()
throws StandardException
- Return the next row (if any) from the scan (if open).
Reload the rowArray as necessary.
- Specified by:
getNextRowCore
in interface NoPutResultSet
- Overrides:
getNextRowCore
in class TableScanResultSet
- Returns:
- the next row in the result
- Throws:
StandardException
- thrown on failure to get next row- See Also:
NoPutResultSet.getNextRowCore()
reloadArray
private int reloadArray()
throws StandardException
- Throws:
StandardException
close
public void close()
throws StandardException
- If the result set has been opened,
close the open scan. Delegate most
of the work to TableScanResultSet.
- Specified by:
close
in interface ResultSet
- Overrides:
close
in class TableScanResultSet
- Throws:
StandardException
- on error
canGetInstantaneousLocks
protected boolean canGetInstantaneousLocks()
- Can we get instantaneous locks when getting share row
locks at READ COMMITTED.
- Overrides:
canGetInstantaneousLocks
in class TableScanResultSet
requiresRelocking
public boolean requiresRelocking()
- Description copied from interface:
NoPutResultSet
- Do we need to relock the row when going to the heap.
- Specified by:
requiresRelocking
in interface NoPutResultSet
- Overrides:
requiresRelocking
in class TableScanResultSet
- Returns:
- Whether or not we need to relock the row when going to the heap.
- See Also:
NoPutResultSet.requiresRelocking()
Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.