class TemporaryRowHolderImpl extends java.lang.Object implements TemporaryRowHolder
It is used for deferred DML processing.
Constructor and Description |
---|
TemporaryRowHolderImpl(Activation activation,
java.util.Properties properties,
ResultDescription resultDescription)
Uses the default overflow to
a conglomerate threshold (5).
|
TemporaryRowHolderImpl(Activation activation,
java.util.Properties properties,
ResultDescription resultDescription,
boolean isUniqueStream)
Uses the default overflow to
a conglomerate threshold (5).
|
TemporaryRowHolderImpl(Activation activation,
java.util.Properties properties,
ResultDescription resultDescription,
int overflowToConglomThreshold,
boolean isUniqueStream,
boolean isVirtualMemHeap)
Create a temporary row holder with the defined overflow to conglom
|
Modifier and Type | Method and Description |
---|---|
private ExecRow |
cloneRow(ExecRow inputRow) |
void |
close()
Clean up
|
long |
getPositionIndexConglomId() |
CursorResultSet |
getResultSet()
Get a result set for scanning what has been inserted
so far.
|
long |
getTemporaryConglomId()
Accessor to get the id of the temporary conglomerate.
|
void |
insert(ExecRow inputRow)
Insert a row
|
private void |
insertToPositionIndex(int position,
RowLocation rl)
Maintain an index that will allow us to read from the
temporary heap in the order we inserted.
|
private boolean |
isRowAlreadyExist(ExecRow inputRow)
Maintain an unique index based on the input row's row location in the
base table, this index make sures that we don't insert duplicate rows
into the temporary heap.
|
private java.util.Properties |
makeIndexProperties(DataValueDescriptor[] indexRowArray,
long conglomId) |
void |
setRowHolderTypeToUniqueStream() |
void |
truncate()
Purge the row holder of all its rows.
|
public static final int DEFAULT_OVERFLOWTHRESHOLD
protected static final int STATE_UNINIT
protected static final int STATE_INSERT
protected static final int STATE_DRAIN
protected ExecRow[] rowArray
protected int lastArraySlot
private int numRowsIn
protected int state
private long CID
private boolean conglomCreated
private ConglomerateController cc
private java.util.Properties properties
private ScanController scan
private ResultDescription resultDescription
Activation activation
private boolean isUniqueStream
private boolean isVirtualMemHeap
private boolean uniqueIndexCreated
private boolean positionIndexCreated
private long uniqueIndexConglomId
private long positionIndexConglomId
private ConglomerateController uniqueIndex_cc
private ConglomerateController positionIndex_cc
private DataValueDescriptor[] uniqueIndexRow
private DataValueDescriptor[] positionIndexRow
private RowLocation destRowLocation
private SQLLongint position_sqllong
public TemporaryRowHolderImpl(Activation activation, java.util.Properties properties, ResultDescription resultDescription)
activation
- the activationproperties
- the properties of the original table. Used
to help the store use optimal page size, etc.resultDescription
- the result description. Relevant for the getResultDescription
call on the result set returned by getResultSet. May be nullpublic TemporaryRowHolderImpl(Activation activation, java.util.Properties properties, ResultDescription resultDescription, boolean isUniqueStream)
activation
- the activationproperties
- the properties of the original table. Used
to help the store use optimal page size, etc.resultDescription
- the result description. Relevant for the getResultDescription
call on the result set returned by getResultSet. May be nullisUniqueStream
- - true , if it has to be temporary row holder unique streampublic TemporaryRowHolderImpl(Activation activation, java.util.Properties properties, ResultDescription resultDescription, int overflowToConglomThreshold, boolean isUniqueStream, boolean isVirtualMemHeap)
activation
- the activationproperties
- the properties of the original table. Used
to help the store use optimal page size, etc.resultDescription
- the result description. Relevant for the getResultDescription
call on the result set returned by getResultSet. May be nulloverflowToConglomThreshold
- on an attempt to insert
this number of rows, the rows will be put
into a temporary conglomerate.public void insert(ExecRow inputRow) throws StandardException
insert
in interface TemporaryRowHolder
inputRow
- the row to insertStandardException
- on errorprivate boolean isRowAlreadyExist(ExecRow inputRow) throws StandardException
inputRow
- the row we are inserting to temporary row holderStandardException
- on errorprivate void insertToPositionIndex(int position, RowLocation rl) throws StandardException
position
- - the number of the row we are inserting into heaprl
- the row to Location in the temporary heapStandardException
- on errorpublic CursorResultSet getResultSet()
getResultSet
in interface TemporaryRowHolder
public void truncate() throws StandardException
StandardException
- on errorpublic long getTemporaryConglomId()
getTemporaryConglomId
in interface TemporaryRowHolder
public long getPositionIndexConglomId()
getPositionIndexConglomId
in interface TemporaryRowHolder
private java.util.Properties makeIndexProperties(DataValueDescriptor[] indexRowArray, long conglomId) throws StandardException
StandardException
public void setRowHolderTypeToUniqueStream()
setRowHolderTypeToUniqueStream
in interface TemporaryRowHolder
public void close() throws StandardException
close
in interface TemporaryRowHolder
StandardException
- on errorApache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.