Class IndexRowToBaseRowResultSet
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
-
- org.apache.derby.impl.sql.execute.NoPutResultSetImpl
-
- org.apache.derby.impl.sql.execute.IndexRowToBaseRowResultSet
-
- All Implemented Interfaces:
CursorResultSet
,NoPutResultSet
,ResultSet
,RowLocationRetRowSource
,RowSource
class IndexRowToBaseRowResultSet extends NoPutResultSetImpl implements CursorResultSet
Takes a result set with a RowLocation as the last column, and uses the RowLocation to get and return a row from the given base conglomerate. Normally, the input result set will be a TableScanResultSet scanning an index conglomerate.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
BasicNoPutResultSetImpl.FieldComparator
-
-
Field Summary
Fields Modifier and Type Field Description private int
_baseColumnCount
private FormatableBitSet
_heapColsWithoutRowLocation
private boolean
_includeRowLocation
private FormatableBitSet
accessedAllCols
FormatableBitSet
accessedHeapCols
private ConglomerateController
baseCC
(package private) RowLocation
baseRowLocation
private boolean
closeBaseCCHere
(package private) boolean
copiedFromSource
private DynamicCompiledOpenConglomInfo
dcoci
private boolean
forUpdate
private int[]
indexCols
java.lang.String
indexName
private GeneratedMethod
restriction
long
restrictionTime
private DataValueDescriptor[]
rowArray
private StaticCompiledOpenConglomInfo
scoci
NoPutResultSet
source
-
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.execute.NoPutResultSet
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE, TEMPORARY_RESULT_SET_NUMBER
-
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
-
-
Constructor Summary
Constructors Constructor Description IndexRowToBaseRowResultSet(long conglomId, int scociItem, Activation a, NoPutResultSet source, int resultRowAllocator, int resultSetNumber, java.lang.String indexName, int heapColRefItem, int allColRefItem, int heapOnlyColRefItem, int indexColMapItem, GeneratedMethod restriction, boolean forUpdate, double optimizerEstimatedRowCount, double optimizerEstimatedCost, int baseColumnCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
If the result set has been opened, close the open scan.ExecRow
getCurrentRow()
Gets last row returned.ExecRow
getNextRowCore()
Return the requested values computed from the next row (if any) for which the restriction evaluates to true.RowLocation
getRowLocation()
Return the RowLocation of the base row.long
getTimeSpent(int type)
Return the total amount of time spent in this ResultSetboolean
isForUpdate()
Is this ResultSet or it's source result set for update.void
openCore()
open this ResultSet.void
positionScanAtRowLocation(RowLocation rl)
Positions the cursor in the specified rowLocation.void
reopenCore()
reopen this ResultSet.-
Methods inherited from class org.apache.derby.impl.sql.execute.NoPutResultSetImpl
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, markRowAsDeleted, needsRowLocation, needsRowLocationForDeferredCheckConstraints, needsToClone, offendingRowLocation, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setHasDeferrableChecks, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, unpackHashValue, updateRow
-
Methods inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
addWarning, attachStatementContext, checkCancellationFlag, checkRowPosition, childrenToXML, cleanUp, dumpTimeStats, finish, finishAndRTS, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCompactRow, getCurrentTimeMillis, getElapsedMillis, getEndExecutionTimestamp, getEstimatedRowCount, getExecuteTime, getExecutionFactory, getFirstRow, getLanguageConnectionContext, getLastRow, getNextRow, getPointOfAttachment, getPreviousRow, getRelativeRow, getRowNumber, getScanIsolationLevel, getSubqueryTrackingArray, getTransactionController, getWarnings, isClosed, isXplainOnlyMode, markAsTopResultSet, modifiedRowCount, open, recordConstructorTime, requiresRelocking, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow, toXML, toXML
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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, getWarnings, isClosed, modifiedRowCount, open, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
-
-
-
-
Field Detail
-
source
public NoPutResultSet source
-
restriction
private GeneratedMethod restriction
-
accessedHeapCols
public FormatableBitSet accessedHeapCols
-
accessedAllCols
private FormatableBitSet accessedAllCols
-
indexName
public java.lang.String indexName
-
indexCols
private int[] indexCols
-
dcoci
private DynamicCompiledOpenConglomInfo dcoci
-
scoci
private StaticCompiledOpenConglomInfo scoci
-
baseCC
private ConglomerateController baseCC
-
closeBaseCCHere
private boolean closeBaseCCHere
-
forUpdate
private boolean forUpdate
-
rowArray
private DataValueDescriptor[] rowArray
-
baseRowLocation
RowLocation baseRowLocation
-
copiedFromSource
boolean copiedFromSource
-
restrictionTime
public long restrictionTime
-
_baseColumnCount
private int _baseColumnCount
-
_includeRowLocation
private boolean _includeRowLocation
-
_heapColsWithoutRowLocation
private FormatableBitSet _heapColsWithoutRowLocation
-
-
Constructor Detail
-
IndexRowToBaseRowResultSet
IndexRowToBaseRowResultSet(long conglomId, int scociItem, Activation a, NoPutResultSet source, int resultRowAllocator, int resultSetNumber, java.lang.String indexName, int heapColRefItem, int allColRefItem, int heapOnlyColRefItem, int indexColMapItem, GeneratedMethod restriction, boolean forUpdate, double optimizerEstimatedRowCount, double optimizerEstimatedCost, int baseColumnCount) throws StandardException
- Throws:
StandardException
-
-
Method Detail
-
openCore
public void openCore() throws StandardException
open this ResultSet.- Specified by:
openCore
in interfaceNoPutResultSet
- Throws:
StandardException
- thrown if cursor finished.
-
reopenCore
public void reopenCore() throws StandardException
reopen this ResultSet.- Specified by:
reopenCore
in interfaceNoPutResultSet
- Overrides:
reopenCore
in classBasicNoPutResultSetImpl
- Throws:
StandardException
- thrown if cursor finished.- See Also:
NoPutResultSet.openCore()
-
getNextRowCore
public ExecRow getNextRowCore() throws StandardException
Return the requested values computed from the next row (if any) for which the restriction evaluates to true.restriction and projection parameters are evaluated for each row.
- Specified by:
getNextRowCore
in interfaceNoPutResultSet
- Specified by:
getNextRowCore
in classBasicNoPutResultSetImpl
- Returns:
- the next row in the result
- Throws:
StandardException
- thrown on failure.StandardException
- ResultSetNotOpen thrown if not yet open.- See Also:
NoPutResultSet.getNextRowCore()
-
close
public void close() throws StandardException
If the result set has been opened, close the open scan.- Specified by:
close
in interfaceResultSet
- Overrides:
close
in classNoPutResultSetImpl
- Throws:
StandardException
- thrown on error
-
getTimeSpent
public long getTimeSpent(int type)
Return the total amount of time spent in this ResultSet- Specified by:
getTimeSpent
in interfaceResultSet
- Parameters:
type
- CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.- Returns:
- long The total amount of time spent (in milliseconds).
-
getRowLocation
public RowLocation getRowLocation() throws StandardException
Return the RowLocation of the base row.- Specified by:
getRowLocation
in interfaceCursorResultSet
- Returns:
- the row location of the current cursor row.
- Throws:
StandardException
- thrown on failure.- See Also:
CursorResultSet
-
positionScanAtRowLocation
public void positionScanAtRowLocation(RowLocation rl) throws StandardException
Description copied from interface:NoPutResultSet
Positions the cursor in the specified rowLocation. Used for scrollable insensitive result sets in order to position the cursor back to a row that has already be visited.- Specified by:
positionScanAtRowLocation
in interfaceNoPutResultSet
- Overrides:
positionScanAtRowLocation
in classNoPutResultSetImpl
- Parameters:
rl
- row location of the current cursor row- Throws:
StandardException
- thrown on failure to get location from storage engine- See Also:
Also remembers row location so that subsequent invocations of getCurrentRow will not read the index row to look up the row location base row, but reuse the saved row location.
-
getCurrentRow
public ExecRow getCurrentRow() throws StandardException
Gets last row returned.- Specified by:
getCurrentRow
in interfaceCursorResultSet
- Returns:
- the last row returned.
- Throws:
StandardException
- thrown on failure.- See Also:
CursorResultSet
-
isForUpdate
public boolean isForUpdate()
Is this ResultSet or it's source result set for update. beetle 3865: updateable cursor using index scan. We didn't need this function before because we couldn't use index for update cursor.- Specified by:
isForUpdate
in interfaceNoPutResultSet
- Overrides:
isForUpdate
in classNoPutResultSetImpl
- Returns:
- Whether or not the result set is for update.
-
-