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
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 BasicNoPutResultSetImpl
BasicNoPutResultSetImpl.FieldComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate FormatableBitSetprivate booleanprivate FormatableBitSetprivate ConglomerateController(package private) RowLocationprivate boolean(package private) booleanprivate DynamicCompiledOpenConglomInfoprivate booleanprivate int[]private GeneratedMethodlongprivate DataValueDescriptor[]private StaticCompiledOpenConglomInfoFields inherited from class NoPutResultSetImpl
checkNullCols, clonedExecRow, cncLen, resultSetNumber, targetResultSetFields inherited from class BasicNoPutResultSetImpl
activation, beginTime, closeTime, compactRow, constructorTime, currentRow, endExecutionTime, finished, isOpen, isTopResultSet, nextTime, numOpens, openTime, optimizerEstimatedCost, optimizerEstimatedRowCount, resultDescription, rowsFiltered, rowsSeen, startExecutionTime, subqueryTrackingArrayFields inherited from interface NoPutResultSet
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE, TEMPORARY_RESULT_SET_NUMBERFields inherited from interface ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST -
Constructor Summary
ConstructorsConstructorDescriptionIndexRowToBaseRowResultSet(long conglomId, int scociItem, Activation a, NoPutResultSet source, int resultRowAllocator, int resultSetNumber, String indexName, int heapColRefItem, int allColRefItem, int heapOnlyColRefItem, int indexColMapItem, GeneratedMethod restriction, boolean forUpdate, double optimizerEstimatedRowCount, double optimizerEstimatedCost, int baseColumnCount) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()If the result set has been opened, close the open scan.Gets last row returned.Return the requested values computed from the next row (if any) for which the restriction evaluates to true.Return the RowLocation of the base row.longgetTimeSpent(int type) Return the total amount of time spent in this ResultSetbooleanIs this ResultSet or it's source result set for update. beetle 3865: updateable cursor using index scan.voidopenCore()open this ResultSet.voidPositions the cursor in the specified rowLocation.voidreopen this ResultSet.Methods inherited from class NoPutResultSetImpl
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, markRowAsDeleted, needsRowLocation, needsRowLocationForDeferredCheckConstraints, needsToClone, offendingRowLocation, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setHasDeferrableChecks, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, unpackHashValue, updateRowMethods inherited from class 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, toXMLMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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 Details
-
source
-
restriction
-
accessedHeapCols
-
accessedAllCols
-
indexName
-
indexCols
private int[] indexCols -
dcoci
-
scoci
-
baseCC
-
closeBaseCCHere
private boolean closeBaseCCHere -
forUpdate
private boolean forUpdate -
rowArray
-
baseRowLocation
RowLocation baseRowLocation -
copiedFromSource
boolean copiedFromSource -
restrictionTime
public long restrictionTime -
_baseColumnCount
private int _baseColumnCount -
_includeRowLocation
private boolean _includeRowLocation -
_heapColsWithoutRowLocation
-
-
Constructor Details
-
IndexRowToBaseRowResultSet
IndexRowToBaseRowResultSet(long conglomId, int scociItem, Activation a, NoPutResultSet source, int resultRowAllocator, int resultSetNumber, 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 Details
-
openCore
open this ResultSet.- Specified by:
openCorein interfaceNoPutResultSet- Throws:
StandardException- thrown if cursor finished.
-
reopenCore
reopen this ResultSet.- Specified by:
reopenCorein interfaceNoPutResultSet- Overrides:
reopenCorein classBasicNoPutResultSetImpl- Throws:
StandardException- thrown if cursor finished.- See Also:
-
getNextRowCore
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:
-
close
If 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
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:
-
positionScanAtRowLocation
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:
-
getCurrentRow
Gets last row returned.- Specified by:
getCurrentRowin interfaceCursorResultSet- Returns:
- the last row returned.
- Throws:
StandardException- thrown on failure.- See Also:
-
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.
-