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

pack-priv Class HashTableResultSet

extends NoPutResultSetImpl
implements CursorResultSet
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.CursorResultSet, org.apache.derby.iapi.sql.ResultSet
Imports
org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.io.Storable, .FormatableArrayHolder, .FormatableIntHolder, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.conn.StatementContext, org.apache.derby.iapi.sql.execute.CursorResultSet, .ExecRow, .NoPutResultSet, org.apache.derby.iapi.types.DataValueDescriptor, .RowLocation, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.store.access.Qualifier, .RowSource, .TransactionController, .BackingStoreHashtable, .KeyHasher, org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl, java.util.List, .Properties

Builds a hash table on the underlying result set tree.

Field Summary

Modifier and TypeField and Description
private List<E>
private int
private boolean
private boolean
private boolean
public int
private BackingStoreHashtable
private int
public int[]
private float
private ExecRow
private long
private ExecRow
public Qualifier[][]
private int
private GeneratedMethod
public long
private int[]
private ExecRow
private boolean
public long
public boolean
private boolean
public Properties
public GeneratedMethod
private boolean
public NoPutResultSet
Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
checkNullColsclonedExecRowcncLenresultSetNumbertargetResultSet

Constructor Summary

AccessConstructor and Description
pack-priv
HashTableResultSet(NoPutResultSet s, Activation a, GeneratedMethod str, Qualifier[][] nextQualifiers, GeneratedMethod p, int resultSetNumber, int mapRefItem, boolean reuseResult, int keyColItem, boolean removeDuplicates, long maxInMemoryRowCount, int initialCapacity, float loadFactor, boolean skipNullKeyColumns, double optimizerEstimatedRowCount, double optimizerEstimatedCost)

Method Summary

Modifier and TypeMethod and Description
public void
close()

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

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

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

private ExecRow

Returns:

The result of the projection
doProjection
(ExecRow
The source row.
sourceRow
)

Do the projection against the source row.

public ExecRow

Returns:

the last row returned.
getCurrentRow
()

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

Gets last row returned.

public ExecRow

Returns:

the next row in the result
getNextRowCore
()

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

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

Return the requested values computed from the next row (if any) for which the restriction evaluates to true.

public DataValueDescriptor[]
public RowLocation

Returns:

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

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

Gets information from its source.

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
public void
private void
Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
clearCurrentRowclearOrderableCachecloseRowSourcegetCursorNamegetResultDescriptiongetValidColumnsmarkRowAsDeletedneedsRowLocationneedsRowLocationForDeferredCheckConstraintsneedsToCloneoffendingRowLocationpositionScanAtRowLocationprintQualifiersresultSetNumberrowLocationsetCurrentRowsetHasDeferrableCheckssetNeedsRowLocationsetTargetResultSetskipRowskipScanunpackHashValueupdateRow

Field Detail

entryVectorback to summary
private List<E> entryVector
entryVectorSizeback to summary
private int entryVectorSize
firstIntoHashtableback to summary
private boolean firstIntoHashtable
firstNextback to summary
private boolean firstNext
hashTableBuiltback to summary
private boolean hashTableBuilt
hashtableSizeback to summary
public int hashtableSize
htback to summary
private BackingStoreHashtable ht
initialCapacityback to summary
private int initialCapacity
keyColumnsback to summary
public int[] keyColumns
loadFactorback to summary
private float loadFactor
mappedResultRowback to summary
private ExecRow mappedResultRow
maxInMemoryRowCountback to summary
private long maxInMemoryRowCount
nextCandidateback to summary
private ExecRow nextCandidate
nextQualifiersback to summary
public Qualifier[][] nextQualifiers
numFetchedOnNextback to summary
private int numFetchedOnNext
projectionback to summary
private GeneratedMethod projection
projectionTimeback to summary
public long projectionTime
projectMappingback to summary
private int[] projectMapping
projRowback to summary
private ExecRow projRow
removeDuplicatesback to summary
private boolean removeDuplicates
restrictionTimeback to summary
public long restrictionTime
reuseResultback to summary
public boolean reuseResult
runTimeStatsOnback to summary
private boolean runTimeStatsOn
scanPropertiesback to summary
public Properties scanProperties
singleTableRestrictionback to summary
public GeneratedMethod singleTableRestriction
skipNullKeyColumnsback to summary
private boolean skipNullKeyColumns
sourceback to summary
public NoPutResultSet source

Constructor Detail

HashTableResultSetback to summary
pack-priv HashTableResultSet(NoPutResultSet s, Activation a, GeneratedMethod str, Qualifier[][] nextQualifiers, GeneratedMethod p, int resultSetNumber, int mapRefItem, boolean reuseResult, int keyColItem, boolean removeDuplicates, long maxInMemoryRowCount, int initialCapacity, float loadFactor, boolean skipNullKeyColumns, double optimizerEstimatedRowCount, double optimizerEstimatedCost) throws StandardException

Method Detail

closeback to summary
public void close() throws StandardException

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.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
doProjectionback to summary
private ExecRow doProjection(ExecRow sourceRow) throws StandardException

Do the projection against the source row. Use reflection where necessary, otherwise get the source column into our result row.

Parameters
sourceRow:ExecRow

The source row.

Returns:ExecRow

The result of the projection

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

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

Gets last row 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 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.

Returns:ExecRow

the next row in the result

Exceptions
StandardException:
  • thrown on failure.
  • ResultSetNotOpen thrown if not yet open.
getNextRowFromRowSourceback to summary
public DataValueDescriptor[] getNextRowFromRowSource() throws StandardException

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

Implements org.apache.derby.iapi.store.access.RowSource.getNextRowFromRowSource.

Doc from org.apache.derby.iapi.store.access.RowSource.getNextRowFromRowSource.

Get the next row as an array of column objects. The column objects can be a JBMS Storable or any Serializable/Externalizable/Formattable/Streaming type.
A return of null indicates that the complete set of rows has been read.

A null column can be specified by leaving the object null, or indicated by returning a non-null getValidColumns. On streaming columns, it can be indicated by returning a non-null get FieldStates.

If RowSource.needToClone() is true then the returned row (the DataValueDescriptor[]) is guaranteed not to be modified by drainer of the RowSource (except that the input stream will be read, of course) and drainer will keep no reference to it before making the subsequent nextRow call. So it is safe to return the same DataValueDescriptor[] in subsequent nextRow calls if that is desirable for performance reasons.

If RowSource.needToClone() is false then the returned row (the DataValueDescriptor[]) may be be modified by drainer of the RowSource, and the drainer may keep a reference to it after making the subsequent nextRow call. In this case the client should severe all references to the row after returning it from getNextRowFromRowSource().

Exceptions
StandardException:
on error
See Also
RowSource#getNextRowFromRowSource
getRowLocationback to summary
public RowLocation getRowLocation() throws StandardException

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

Gets information from its source. We might want to have this take a CursorResultSet in its constructor some day, instead of doing a cast here?

Returns:RowLocation

the row location of the current cursor row.

Exceptions
StandardException:
thrown on failure.
See Also
CursorResultSet
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 if cursor finished.
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 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 if cursor finished.
resetProbeVariablesback to summary
private void resetProbeVariables() throws StandardException