Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

public Class HashScanResultSet

extends ScanResultSet
implements CursorResultSet
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.CursorResultSet, org.apache.derby.iapi.sql.ResultSet
Known Direct Subclasses
org.apache.derby.impl.sql.execute.DistinctScanResultSet
Imports
java.util.List, .Properties, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.shared.common.i18n.MessageService, org.apache.derby.iapi.services.io.FormatableArrayHolder, .FormatableIntHolder, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.execute.CursorResultSet, .ExecIndexRow, .ExecRow, .NoPutResultSet, org.apache.derby.iapi.store.access.BackingStoreHashtable, .KeyHasher, .Qualifier, .RowUtil, .ScanController, .StaticCompiledOpenConglomInfo, .TransactionController, org.apache.derby.iapi.types.DataValueDescriptor, .RowLocation

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.

Field Summary

Modifier and TypeField and Description
protected ExecRow
private long
public static final int
public static final float
public static final int
protected boolean
private List<E>
private int
protected boolean
public boolean
protected BackingStoreHashtable
private boolean
public int
private int
public boolean
private boolean
public int[]
private float
private int
public Qualifier[][]
private int
private boolean
private boolean
public Properties
public Qualifier[][]
protected StaticCompiledOpenConglomInfo
private boolean
private GeneratedMethod
private ExecIndexRow
public String
private int
private GeneratedMethod
private ExecIndexRow
public String
private int
public String
Inherited from org.apache.derby.impl.sql.execute.ScanResultSet:
accessedColscandidatefetchRowLocationsindexNameisolationLevellockModeresultRowBuildertableName

Constructor Summary

AccessConstructor and Description
pack-priv
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)

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
canGetInstantaneousLocks()

Implements abstract org.apache.derby.impl.sql.execute.ScanResultSet.canGetInstantaneousLocks.

Can we get instantaneous locks when getting share row locks at READ COMMITTED.

public void
close()

Overrides org.apache.derby.impl.sql.execute.ScanResultSet.close.

Implements org.apache.derby.iapi.sql.ResultSet.close.

If the result set has been opened, close the open scan.

public ExecRow

Returns:

the last row returned;
getCurrentRow
()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getCurrentRow.

This result set has its row from the last fetch done.

public ExecRow
public RowLocation

Returns:

the row location of the current cursor row.
getRowLocation
()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getRowLocation.

This result set has its row location from the last fetch done.

public Properties
public long

Returns:

long The total amount of time spent (in milliseconds).
getTimeSpent
(int
CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.
type
)

Implements org.apache.derby.iapi.sql.ResultSet.getTimeSpent.

Return the total amount of time spent in this ResultSet

public boolean

Returns:

Whether or not the result set is for update.
isForUpdate
()

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.isForUpdate.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.isForUpdate.

Is this ResultSet or it's source result set for update

public void
private String
printPosition(int searchOperator, GeneratedMethod positionGetter, ExecIndexRow eiRow)

Return a start or stop positioner as a String.

public String
public String
public void
public boolean
private void
Inherited from org.apache.derby.impl.sql.execute.ScanResultSet:
getScanIsolationLevelinitIsolationLevelsetRowLocationsStatetoXML

Field Detail

compactRowback to summary
protected ExecRow compactRow

Hides org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.compactRow.

conglomIdback to summary
private long conglomId
DEFAULT_INITIAL_CAPACITYback to summary
public static final int DEFAULT_INITIAL_CAPACITY
DEFAULT_LOADFACTORback to summary
public static final float DEFAULT_LOADFACTOR
DEFAULT_MAX_CAPACITYback to summary
public static final int DEFAULT_MAX_CAPACITY
eliminateDuplicatesback to summary
protected boolean eliminateDuplicates
entryVectorback to summary
private List<E> entryVector
entryVectorSizeback to summary
private int entryVectorSize
firstNextback to summary
protected boolean firstNext
forUpdateback to summary
public boolean forUpdate
hashtableback to summary
protected BackingStoreHashtable hashtable
hashtableBuiltback to summary
private boolean hashtableBuilt
hashtableSizeback to summary
public int hashtableSize
initialCapacityback to summary
private int initialCapacity
isConstraintback to summary
public boolean isConstraint
keepAfterCommitback to summary
private boolean keepAfterCommit
keyColumnsback to summary
public int[] keyColumns
loadFactorback to summary
private float loadFactor
maxCapacityback to summary
private int maxCapacity
nextQualifiersback to summary
public Qualifier[][] nextQualifiers
numFetchedOnNextback to summary
private int numFetchedOnNext
runTimeStatisticsOnback to summary
private boolean runTimeStatisticsOn
sameStartStopPositionback to summary
private boolean sameStartStopPosition
scanPropertiesback to summary
public Properties scanProperties
scanQualifiersback to summary
public Qualifier[][] scanQualifiers
scociback to summary
protected StaticCompiledOpenConglomInfo scoci
skipNullKeyColumnsback to summary
private boolean skipNullKeyColumns
startKeyGetterback to summary
private GeneratedMethod startKeyGetter
startPositionback to summary
private ExecIndexRow startPosition
startPositionStringback to summary
public String startPositionString
startSearchOperatorback to summary
private int startSearchOperator
stopKeyGetterback to summary
private GeneratedMethod stopKeyGetter
stopPositionback to summary
private ExecIndexRow stopPosition
stopPositionStringback to summary
public String stopPositionString
stopSearchOperatorback to summary
private int stopSearchOperator
userSuppliedOptimizerOverridesback to summary
public String userSuppliedOptimizerOverrides

Constructor Detail

HashScanResultSetback to summary
pack-priv 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

Method Detail

canGetInstantaneousLocksback to summary
pack-priv boolean canGetInstantaneousLocks()

Implements abstract org.apache.derby.impl.sql.execute.ScanResultSet.canGetInstantaneousLocks.

Can we get instantaneous locks when getting share row locks at READ COMMITTED.

closeback to summary
public void close() throws StandardException

Overrides org.apache.derby.impl.sql.execute.ScanResultSet.close.

Implements org.apache.derby.iapi.sql.ResultSet.close.

If the result set has been opened, close the open scan.

Exceptions
StandardException:
thrown on error
getCurrentRowback to summary
public ExecRow getCurrentRow() throws StandardException

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getCurrentRow.

This result set has its row from the last fetch done. If the cursor is closed, a null is returned.

Returns:ExecRow

the last row returned;

Exceptions
StandardException:
thrown on failure.
See Also
CursorResultSet
getNextRowCoreback to summary
public ExecRow getNextRowCore() throws StandardException

Implements abstract org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRowCore.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.getNextRowCore.

Return the next row (if any) from the scan (if open).

Returns:ExecRow

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.getNextRowCore.

the next row in the result

Exceptions
StandardException:
thrown on failure to get next row
getRowLocationback to summary
public RowLocation getRowLocation() throws StandardException

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getRowLocation.

This result set has its row location from the last fetch done. If the cursor is closed, a null is returned.

Returns:RowLocation

the row location of the current cursor row.

Exceptions
StandardException:
thrown on failure to get row location
See Also
CursorResultSet
getScanPropertiesback to summary
public Properties getScanProperties()
getTimeSpentback to summary
public long getTimeSpent(int type)

Implements org.apache.derby.iapi.sql.ResultSet.getTimeSpent.

Return the total amount of time spent in this ResultSet

Parameters
type:int

CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.

Returns:long

long The total amount of time spent (in milliseconds).

isForUpdateback to summary
public boolean isForUpdate()

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.isForUpdate.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.isForUpdate.

Is this ResultSet or it's source result set for update

Returns:boolean

Whether or not the result set is for update.

openCoreback to summary
public void openCore() throws StandardException

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.openCore.

open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...

Exceptions
StandardException:
thrown on failure to open
printPositionback to summary
private String printPosition(int searchOperator, GeneratedMethod positionGetter, ExecIndexRow eiRow)

Return a start or stop positioner as a String.

printStartPositionback to summary
public String printStartPosition()
printStopPositionback to summary
public String printStopPosition()
reopenCoreback to summary
public void reopenCore() throws StandardException

Overrides org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.reopenCore.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.reopenCore.

reopen this ResultSet.

Exceptions
StandardException:
thrown if cursor finished.
requiresRelockingback to summary
public boolean requiresRelocking()

Overrides org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.requiresRelocking.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.requiresRelocking.

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.requiresRelocking.

Do we need to relock the row when going to the heap.

Returns:boolean

Whether or not we need to relock the row when going to the heap.

See Also
NoPutResultSet#requiresRelocking
resetProbeVariablesback to summary
private void resetProbeVariables() throws StandardException