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_baseColumnCountprivate FormatableBitSet_heapColsWithoutRowLocationprivate boolean_includeRowLocationprivate FormatableBitSetaccessedAllColsFormatableBitSetaccessedHeapColsprivate ConglomerateControllerbaseCC(package private) RowLocationbaseRowLocationprivate booleancloseBaseCCHere(package private) booleancopiedFromSourceprivate DynamicCompiledOpenConglomInfodcociprivate booleanforUpdateprivate int[]indexColsjava.lang.StringindexNameprivate GeneratedMethodrestrictionlongrestrictionTimeprivate DataValueDescriptor[]rowArrayprivate StaticCompiledOpenConglomInfoscociNoPutResultSetsource-
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 voidclose()If the result set has been opened, close the open scan.ExecRowgetCurrentRow()Gets last row returned.ExecRowgetNextRowCore()Return the requested values computed from the next row (if any) for which the restriction evaluates to true.RowLocationgetRowLocation()Return the RowLocation of the base row.longgetTimeSpent(int type)Return the total amount of time spent in this ResultSetbooleanisForUpdate()Is this ResultSet or it's source result set for update.voidopenCore()open this ResultSet.voidpositionScanAtRowLocation(RowLocation rl)Positions the cursor in the specified rowLocation.voidreopenCore()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 StandardExceptionopen this ResultSet.- Specified by:
openCorein interfaceNoPutResultSet- Throws:
StandardException- thrown if cursor finished.
-
reopenCore
public void reopenCore() throws StandardExceptionreopen this ResultSet.- Specified by:
reopenCorein interfaceNoPutResultSet- Overrides:
reopenCorein 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:
getNextRowCorein interfaceNoPutResultSet- Specified by:
getNextRowCorein 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 StandardExceptionIf the result set has been opened, close the open scan.- Specified by:
closein interfaceResultSet- Overrides:
closein classNoPutResultSetImpl- Throws:
StandardException- thrown on error
-
getTimeSpent
public long getTimeSpent(int type)
Return the total amount of time spent in this ResultSet- Specified by:
getTimeSpentin 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:
getRowLocationin 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:NoPutResultSetPositions 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:
positionScanAtRowLocationin interfaceNoPutResultSet- Overrides:
positionScanAtRowLocationin 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:
getCurrentRowin 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:
isForUpdatein interfaceNoPutResultSet- Overrides:
isForUpdatein classNoPutResultSetImpl- Returns:
- Whether or not the result set is for update.
-
-