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

pack-priv Class DependentResultSet

extends ScanResultSet
implements CursorResultSet
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.CursorResultSet, org.apache.derby.iapi.sql.ResultSet
Annotations
@SuppressWarnings:UseOfObsoleteCollectionType
Imports
java.util.Properties, .Vector, 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.FormatableBitSet, 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, .TemporaryRowHolder, org.apache.derby.iapi.store.access.ConglomerateController, .DynamicCompiledOpenConglomInfo, .Qualifier, .ScanController, .StaticCompiledOpenConglomInfo, .TransactionController, org.apache.derby.iapi.types.RowLocation

DependentResultSet should be used by only ON DELETE CASCADE/ON DELETE SET NULL ref actions implementation to gather the rows from the dependent tables. Idea is to scan the foreign key index for the rows in the source table materialized temporary result set. Scanning of foreign key index gives us the rows that needs to be deleted on dependent tables. Using the row location we got from the index , base row is fetched.

Field Summary

Modifier and TypeField and Description
pack-priv RowLocation
public boolean
protected long
protected boolean
pack-priv int[]
public boolean
pack-priv ConglomerateController
protected DynamicCompiledOpenConglomInfo
protected StaticCompiledOpenConglomInfo
pack-priv DynamicCompiledOpenConglomInfo
pack-priv IndexRow
pack-priv ExecRow
pack-priv ScanController
pack-priv StaticCompiledOpenConglomInfo
public boolean
protected boolean
pack-priv boolean
pack-priv int
public boolean
pack-priv String
protected Qualifier[][]
pack-priv RowLocation
public int
protected long
protected boolean
pack-priv int
protected ScanController
protected boolean
private Properties
pack-priv ExecRow
pack-priv TemporaryRowHolderResultSet
pack-priv int[]
pack-priv TemporaryRowHolderResultSet[]
pack-priv TemporaryRowHolder[]
protected ExecIndexRow
public String
protected int
protected ExecIndexRow
public String
protected int
pack-priv Vector<TemporaryRowHolder>
pack-priv TransactionController
public String
Inherited from org.apache.derby.impl.sql.execute.ScanResultSet:
accessedColscandidatefetchRowLocationsindexNameisolationLevellockModeresultRowBuildertableName

Constructor Summary

AccessConstructor and Description
pack-priv
DependentResultSet(long conglomId, StaticCompiledOpenConglomInfo scoci, Activation activation, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int lockMode, boolean tableLocked, int isolationLevel, int rowsPerRead, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String parentResultSetId, long fkIndexConglomId, int fkColArrayItem, int rltItem)

Method Summary

Modifier and TypeMethod and Description
private void
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.

Close the all the opens we did in this result set.

private ExecRow

Returns:

The base row row or null.
fetchBaseRow
()

Fetch the base row corresponding to the current index row

private ExecRow

Returns:

The row or null. Note that the next call to fetch will replace the columns in the returned row.
fetchIndexRow
()

Fetch a row from the index scan.

public void
finish()

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

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

Tells the system that there will be no more access to any database information via this result set; in particular, no more calls to open().

public ExecRow
getCurrentRow()

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

Returns the current row of the result set.

private ExecRow
public ExecRow
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 RowLocation
getRowLocation()

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

Returns the row location of the current base table row of the cursor.

public Properties
public long
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 void
public ConglomerateController
private void
private ScanController
openIndexScanController(ExecRow
the row to match
searchRow
)

Get a scan controller positioned using searchRow as the start/stop position.

private String
printPosition(int searchOperator, ExecIndexRow positioner)

Return a start or stop positioner as a String.

public String
printQualifiers()

Return an array of Qualifiers as a String

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

Field Detail

baseRowLocationback to summary
pack-priv RowLocation baseRowLocation
coarserLockback to summary
public boolean coarserLock
conglomIdback to summary
protected long conglomId
firstScanback to summary
protected boolean firstScan
fkColArrayback to summary
pack-priv int[] fkColArray
forUpdateback to summary
public boolean forUpdate
heapCCback to summary
pack-priv ConglomerateController heapCC
heapDcociback to summary
protected DynamicCompiledOpenConglomInfo heapDcoci
heapScociback to summary
protected StaticCompiledOpenConglomInfo heapScoci
indexDcociback to summary
pack-priv DynamicCompiledOpenConglomInfo indexDcoci
indexQualifierRowback to summary
pack-priv IndexRow indexQualifierRow
indexRowback to summary
pack-priv ExecRow indexRow
indexSCback to summary
pack-priv ScanController indexSC
indexScociback to summary
pack-priv StaticCompiledOpenConglomInfo indexScoci
isConstraintback to summary
public boolean isConstraint
isKeyedback to summary
protected boolean isKeyed
isOpenback to summary
pack-priv boolean isOpen

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

numFkColumnsback to summary
pack-priv int numFkColumns
oneRowScanback to summary
public boolean oneRowScan
parentResultSetIdback to summary
pack-priv String parentResultSetId
qualifiersback to summary
protected Qualifier[][] qualifiers
rowLocationback to summary
pack-priv RowLocation rowLocation
rowsPerReadback to summary
public int rowsPerRead
rowsThisScanback to summary
protected long rowsThisScan
runTimeStatisticsOnback to summary
protected boolean runTimeStatisticsOn
sArrayIndexback to summary
pack-priv int sArrayIndex
scanControllerback to summary
protected ScanController scanController
scanControllerOpenedback to summary
protected boolean scanControllerOpened
scanPropertiesback to summary
private Properties scanProperties
searchRowback to summary
pack-priv ExecRow searchRow
sourceback to summary
pack-priv TemporaryRowHolderResultSet source
sourceOpenedback to summary
pack-priv int[] sourceOpened
sourceResultSetsback to summary
pack-priv TemporaryRowHolderResultSet[] sourceResultSets
sourceRowHoldersback to summary
pack-priv TemporaryRowHolder[] sourceRowHolders
startPositionback to summary
protected ExecIndexRow startPosition
startPositionStringback to summary
public String startPositionString
startSearchOperatorback to summary
protected int startSearchOperator
stopPositionback to summary
protected ExecIndexRow stopPosition
stopPositionStringback to summary
public String stopPositionString
stopSearchOperatorback to summary
protected int stopSearchOperator
sVectorback to summary
pack-priv Vector<TemporaryRowHolder> sVector
tcback to summary
pack-priv TransactionController tc

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

userSuppliedOptimizerOverridesback to summary
public String userSuppliedOptimizerOverrides

Constructor Detail

DependentResultSetback to summary
pack-priv DependentResultSet(long conglomId, StaticCompiledOpenConglomInfo scoci, Activation activation, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int lockMode, boolean tableLocked, int isolationLevel, int rowsPerRead, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String parentResultSetId, long fkIndexConglomId, int fkColArrayItem, int rltItem) throws StandardException

Method Detail

addNewSourcesback to summary
private void addNewSources()
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.

Close the all the opens we did in this result set.

Annotations
@Override
Exceptions
StandardException:

Doc from org.apache.derby.iapi.sql.ResultSet.close.

Thrown on error.

fetchBaseRowback to summary
private ExecRow fetchBaseRow() throws StandardException

Fetch the base row corresponding to the current index row

Returns:ExecRow

The base row row or null.

Exceptions
StandardException:
Ooops
fetchIndexRowback to summary
private ExecRow fetchIndexRow() throws StandardException

Fetch a row from the index scan.

Returns:ExecRow

The row or null. Note that the next call to fetch will replace the columns in the returned row.

Exceptions
StandardException:
Ooops
finishback to summary
public void finish() throws StandardException

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

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

Doc from org.apache.derby.iapi.sql.ResultSet.finish.

Tells the system that there will be no more access to any database information via this result set; in particular, no more calls to open(). Will close the result set if it is not already closed.

Annotations
@Override
Exceptions
StandardException:
on error
getCurrentRowback to summary
public ExecRow getCurrentRow() throws StandardException

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

Doc from org.apache.derby.iapi.sql.execute.CursorResultSet.getCurrentRow.

Returns the current row of the result set. REMIND: eventually, this will only return the current row for result sets that need to return it; either some field in the activation or a parameter in the constructor will be used to signal that this needs to function. This will let us limit the number of live objects we are holding on to.

Returns:ExecRow

the last row returned by getNextRow. null if closed.

Exceptions
StandardException:
thrown on failure.
getNextParentRowback to summary
private ExecRow getNextParentRow() throws StandardException
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.

Doc from 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:

Doc from org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRowCore.

thrown if cursor finished.

getRowLocationback to summary
public RowLocation getRowLocation() throws StandardException

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

Doc from org.apache.derby.iapi.sql.execute.CursorResultSet.getRowLocation.

Returns the row location of the current base table row of the cursor. If this cursor's row is composed of multiple base tables' rows, i.e. due to a join, then a null is returned.

Returns:RowLocation

the row location of the current cursor row.

Exceptions
StandardException:
thrown on failure to get location from storage engine
getScanPropertiesback to summary
public Properties getScanProperties()
getTimeSpentback to summary
public long getTimeSpent(int type)

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

Doc from 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).

openCoreback to summary
public void openCore() throws StandardException

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

Doc from 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...

openCore() can only be called on a closed result set. see reopenCore if you want to reuse an open result set.

For NoPutResultSet open() must only be called on the top ResultSet. Opening of NoPutResultSet's below the top result set are implemented by calling openCore.

Exceptions
StandardException:
thrown if cursor finished.
openHeapConglomerateControllerback to summary
public ConglomerateController openHeapConglomerateController() throws StandardException
openIndexScanback to summary
private void openIndexScan(ExecRow searchRow) throws StandardException
openIndexScanControllerback to summary
private ScanController openIndexScanController(ExecRow searchRow) throws StandardException

Get a scan controller positioned using searchRow as the start/stop position. The assumption is that searchRow is of the same format as the index being opened.

Parameters
searchRow:ExecRow

the row to match

Exceptions
StandardException:
on error
printPositionback to summary
private String printPosition(int searchOperator, ExecIndexRow positioner)

Return a start or stop positioner as a String. If we already generated the information, then use that. Otherwise, invoke the activation to get it.

printQualifiersback to summary
public String printQualifiers()

Return an array of Qualifiers as a String

printStartPositionback to summary
public String printStartPosition()
printStopPositionback to summary
public String printStopPosition()
reopenIndexScanControllerback to summary
private void reopenIndexScanController(ExecRow searchRow) throws StandardException
setupQualifierRowback to summary
private void setupQualifierRow(ExecRow searchRow)