|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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
class BulkTableScanResultSet
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.
| Field Summary | |
|---|---|
private int |
curRowPosition
|
private int |
numRowsInArray
|
private static int |
OUT_OF_ROWS
|
private DataValueDescriptor[][] |
rowArray
|
| Fields inherited from class org.apache.derby.impl.sql.execute.TableScanResultSet |
|---|
coarserLock, conglomId, dcoci, firstScan, forUpdate, indexCols, indexName, isConstraint, isKeyed, oneRowScan, past2FutureTbl, qualifiers, rowsPerRead, rowsThisScan, runTimeStatisticsOn, sameStartStopPosition, scanController, scanControllerOpened, scoci, startKeyGetter, startPosition, startPositionString, startSearchOperator, stopKeyGetter, stopPosition, stopPositionString, stopSearchOperator, tableName, userSuppliedOptimizerOverrides |
| Fields inherited from class org.apache.derby.impl.sql.execute.ScanResultSet |
|---|
accessedCols, candidate, isolationLevel, lockMode, resultRowBuilder |
| Fields inherited from class org.apache.derby.impl.sql.execute.NoPutResultSetImpl |
|---|
checkNullCols, clonedExecRow, cncLen, resultSetNumber, targetResultSet |
| 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 |
| Fields inherited from interface org.apache.derby.iapi.sql.ResultSet |
|---|
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST |
| Fields inherited from interface org.apache.derby.iapi.sql.execute.NoPutResultSet |
|---|
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE |
| Constructor Summary | |
|---|---|
BulkTableScanResultSet(long conglomId,
StaticCompiledOpenConglomInfo scoci,
Activation activation,
int resultRowTemplate,
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 disableForHoldable,
boolean oneRowScan,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost)
Constructor. |
|
| Method Summary | |
|---|---|
private static int |
adjustBulkFetchSize(Activation activation,
int rowsPerRead,
boolean disableForHoldable)
Adjust the bulk fetch size according to the parameters. |
protected boolean |
canGetInstantaneousLocks()
Can we get instantaneous locks when getting share row locks at READ COMMITTED. |
void |
close()
If the result set has been opened, close the open scan. |
ExecRow |
getNextRowCore()
Return the next row (if any) from the scan (if open). |
void |
openCore()
Open up the result set. |
protected void |
openScanController(TransactionController tc)
Open the scan controller |
private int |
reloadArray()
|
void |
reopenCore()
Reopen the result set. |
boolean |
requiresRelocking()
Do we need to relock the row when going to the heap. |
| 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.ScanResultSet |
|---|
getScanIsolationLevel, initIsolationLevel |
| 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 java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.derby.iapi.sql.execute.CursorResultSet |
|---|
getCurrentRow, getRowLocation |
| Methods inherited from interface org.apache.derby.iapi.sql.ResultSet |
|---|
addWarning, 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 |
| Field Detail |
|---|
private DataValueDescriptor[][] rowArray
private int curRowPosition
private int numRowsInArray
private static int OUT_OF_ROWS
| Constructor Detail |
|---|
BulkTableScanResultSet(long conglomId,
StaticCompiledOpenConglomInfo scoci,
Activation activation,
int resultRowTemplate,
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 disableForHoldable,
boolean oneRowScan,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost)
throws StandardException
StandardException - thrown on failure to openResultSetFactory.getBulkTableScanResultSet(org.apache.derby.iapi.sql.Activation, long, int, int, 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, boolean, double, double)| Method Detail |
|---|
private static int adjustBulkFetchSize(Activation activation,
int rowsPerRead,
boolean disableForHoldable)
activation - the activation for the executing statementrowsPerRead - how many rows to read in each chunk if a bulk fetch
is OK to usedisableForHoldable - whether or not bulk fetch should be disabled
for holdable cursors
protected void openScanController(TransactionController tc)
throws StandardException
openScanController in class TableScanResultSettc - transaction controller will open one if null
StandardException - thrown on failure to open
public void openCore()
throws StandardException
openCore in interface NoPutResultSetopenCore in class TableScanResultSetStandardException - thrown on failure to open
public void reopenCore()
throws StandardException
reopenCore in interface NoPutResultSetreopenCore in class TableScanResultSetStandardException - thrown on failure to openNoPutResultSet.openCore()
public ExecRow getNextRowCore()
throws StandardException
getNextRowCore in interface NoPutResultSetgetNextRowCore in class TableScanResultSetStandardException - thrown on failure to get next rowNoPutResultSet.getNextRowCore()
private int reloadArray()
throws StandardException
StandardException
public void close()
throws StandardException
close in interface ResultSetclose in class TableScanResultSetStandardException - on errorprotected boolean canGetInstantaneousLocks()
canGetInstantaneousLocks in class TableScanResultSetpublic boolean requiresRelocking()
NoPutResultSet
requiresRelocking in interface NoPutResultSetrequiresRelocking in class TableScanResultSetNoPutResultSet.requiresRelocking()
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||