Class HashScanResultSet
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.HashScanResultSet
- All Implemented Interfaces:
CursorResultSet, NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource
- Direct Known Subclasses:
DistinctScanResultSet
Takes a conglomerate and a table filter builds a hash table on the
specified column of the conglomerate on the 1st open. Look up into the
hash table is done on the hash key column. The hash table consists of
either
DataValueDescriptor[]s or Lists of
DataValueDescriptor[]. The store builds the hash table. When a
collision occurs, the store builds a List with the colliding
DataValueDescriptor[]s.-
Nested Class Summary
Nested classes/interfaces inherited from class BasicNoPutResultSetImpl
BasicNoPutResultSetImpl.FieldComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ExecRowprivate longstatic final intstatic final floatstatic final intprotected booleanprivate Listprivate intprotected booleanbooleanprotected BackingStoreHashtableprivate booleanintprivate intbooleanprivate booleanint[]private floatprivate intQualifier[][]private intprivate booleanprivate booleanQualifier[][]protected StaticCompiledOpenConglomInfoprivate booleanprivate GeneratedMethodprivate ExecIndexRowprivate intprivate GeneratedMethodprivate ExecIndexRowprivate intFields inherited from class ScanResultSet
accessedCols, candidate, fetchRowLocations, indexName, isolationLevel, lockMode, resultRowBuilder, tableNameFields inherited from class NoPutResultSetImpl
checkNullCols, clonedExecRow, cncLen, resultSetNumber, targetResultSetFields inherited from class BasicNoPutResultSetImpl
activation, beginTime, closeTime, 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
ConstructorsConstructorDescriptionHashScanResultSet(long conglomId, StaticCompiledOpenConglomInfo scoci, Activation activation, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] scanQualifiers, Qualifier[][] nextQualifiers, int initialCapacity, float loadFactor, int maxCapacity, int hashKeyItem, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int lockMode, boolean tableLocked, int isolationLevel, boolean skipNullKeyColumns, double optimizerEstimatedRowCount, double optimizerEstimatedCost) -
Method Summary
Modifier and TypeMethodDescription(package private) booleanCan we get instantaneous locks when getting share row locks at READ COMMITTED.voidclose()If the result set has been opened, close the open scan.This result set has its row from the last fetch done.Return the next row (if any) from the scan (if open).This result set has its row location from the last fetch done.longgetTimeSpent(int type) Return the total amount of time spent in this ResultSetbooleanIs this ResultSet or it's source result set for updatevoidopenCore()open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...private StringprintPosition(int searchOperator, GeneratedMethod positionGetter, ExecIndexRow eiRow) Return a start or stop positioner as a String.voidreopen this ResultSet.booleanDo we need to relock the row when going to the heap.private voidMethods inherited from class ScanResultSet
getScanIsolationLevel, initIsolationLevel, setRowLocationsState, toXMLMethods inherited from class NoPutResultSetImpl
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, markRowAsDeleted, needsRowLocation, needsRowLocationForDeferredCheckConstraints, needsToClone, offendingRowLocation, positionScanAtRowLocation, 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, getSubqueryTrackingArray, getTransactionController, getWarnings, isClosed, isXplainOnlyMode, markAsTopResultSet, modifiedRowCount, open, recordConstructorTime, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow, 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
-
hashtableBuilt
private boolean hashtableBuilt -
startPosition
-
stopPosition
-
compactRow
-
firstNext
protected boolean firstNext -
numFetchedOnNext
private int numFetchedOnNext -
entryVectorSize
private int entryVectorSize -
entryVector
-
conglomId
private long conglomId -
scoci
-
startKeyGetter
-
startSearchOperator
private int startSearchOperator -
stopKeyGetter
-
stopSearchOperator
private int stopSearchOperator -
scanQualifiers
-
nextQualifiers
-
initialCapacity
private int initialCapacity -
loadFactor
private float loadFactor -
maxCapacity
private int maxCapacity -
userSuppliedOptimizerOverrides
-
forUpdate
public boolean forUpdate -
runTimeStatisticsOn
private boolean runTimeStatisticsOn -
keyColumns
public int[] keyColumns -
sameStartStopPosition
private boolean sameStartStopPosition -
skipNullKeyColumns
private boolean skipNullKeyColumns -
keepAfterCommit
private boolean keepAfterCommit -
hashtable
-
eliminateDuplicates
protected boolean eliminateDuplicates -
scanProperties
-
startPositionString
-
stopPositionString
-
hashtableSize
public int hashtableSize -
isConstraint
public boolean isConstraint -
DEFAULT_INITIAL_CAPACITY
public static final int DEFAULT_INITIAL_CAPACITY- See Also:
-
DEFAULT_LOADFACTOR
public static final float DEFAULT_LOADFACTOR- See Also:
-
DEFAULT_MAX_CAPACITY
public static final int DEFAULT_MAX_CAPACITY- See Also:
-
-
Constructor Details
-
HashScanResultSet
HashScanResultSet(long conglomId, StaticCompiledOpenConglomInfo scoci, Activation activation, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] scanQualifiers, Qualifier[][] nextQualifiers, int initialCapacity, float loadFactor, int maxCapacity, int hashKeyItem, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int lockMode, boolean tableLocked, int isolationLevel, boolean skipNullKeyColumns, double optimizerEstimatedRowCount, double optimizerEstimatedCost) throws StandardException - Throws:
StandardException
-
-
Method Details
-
canGetInstantaneousLocks
boolean canGetInstantaneousLocks()Can we get instantaneous locks when getting share row locks at READ COMMITTED.- Specified by:
canGetInstantaneousLocksin classScanResultSet
-
openCore
open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...- Specified by:
openCorein interfaceNoPutResultSet- Throws:
StandardException- thrown on failure to open
-
reopenCore
reopen this ResultSet.- Specified by:
reopenCorein interfaceNoPutResultSet- Overrides:
reopenCorein classBasicNoPutResultSetImpl- Throws:
StandardException- thrown if cursor finished.- See Also:
-
resetProbeVariables
- Throws:
StandardException
-
getNextRowCore
Return the next row (if any) from the scan (if open).- Specified by:
getNextRowCorein interfaceNoPutResultSet- Specified by:
getNextRowCorein classBasicNoPutResultSetImpl- Returns:
- the next row in the result
- Throws:
StandardException- thrown on failure to get next row- See Also:
-
close
If the result set has been opened, close the open scan.- Specified by:
closein interfaceResultSet- Overrides:
closein classScanResultSet- 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).
-
requiresRelocking
public boolean requiresRelocking()Description copied from interface:NoPutResultSetDo we need to relock the row when going to the heap.- Specified by:
requiresRelockingin interfaceNoPutResultSet- Overrides:
requiresRelockingin classBasicNoPutResultSetImpl- Returns:
- Whether or not we need to relock the row when going to the heap.
- See Also:
-
getRowLocation
This result set has its row location from the last fetch done. If the cursor is closed, a null is returned.- Specified by:
getRowLocationin interfaceCursorResultSet- Returns:
- the row location of the current cursor row.
- Throws:
StandardException- thrown on failure to get row location- See Also:
-
getCurrentRow
This result set has its row from the last fetch done. If the cursor is closed, a null is returned.- Specified by:
getCurrentRowin interfaceCursorResultSet- Returns:
- the last row returned;
- Throws:
StandardException- thrown on failure.- See Also:
-
printStartPosition
-
printStopPosition
-
printPosition
private String printPosition(int searchOperator, GeneratedMethod positionGetter, ExecIndexRow eiRow) Return a start or stop positioner as a String. -
getScanProperties
-
isForUpdate
public boolean isForUpdate()Is this ResultSet or it's source result set for update- Specified by:
isForUpdatein interfaceNoPutResultSet- Overrides:
isForUpdatein classNoPutResultSetImpl- Returns:
- Whether or not the result set is for update.
-