Class MergeInserter
- java.lang.Object
-
- org.apache.derby.impl.store.access.sort.MergeInserter
-
- All Implemented Interfaces:
SortController
final class MergeInserter extends java.lang.Object implements SortController
-
-
Field Summary
Fields Modifier and Type Field Description private booleanavoidMergeRunprivate longbeginMemoryUsageInformation about memory usage to dynamically tune the in-memory sort buffer size.private java.util.Vector<java.lang.Long>mergeRunsA vector of the conglomerate ids of the merge runs.private intrunSizeprivate MergeSortsortThe sort this inserter is for.private SortBuffersortBufferAn in-memory ordered set that is used to sort rows before they're sent to merge runs.(package private) java.util.Vector<java.lang.Integer>stat_mergeRunsSize(package private) intstat_numMergeRuns(package private) intstat_numRowsInput(package private) intstat_numRowsOutput(package private) java.lang.Stringstat_sortTypeprivate inttotalRunSizeprivate TransactionManagertranThe transaction this inserter is in.
-
Constructor Summary
Constructors Constructor Description MergeInserter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompletedInserts()Called when the caller has completed inserting rows into the sorter.SortInfogetSortInfo()Return SortInfo object which contains information about the current sort.(package private) booleaninitialize(MergeSort sort, TransactionManager tran)Initialize this inserter.voidinsert(DataValueDescriptor[] row)Insert a row into the sort.
-
-
-
Field Detail
-
sort
private MergeSort sort
The sort this inserter is for.
-
tran
private TransactionManager tran
The transaction this inserter is in.
-
mergeRuns
private java.util.Vector<java.lang.Long> mergeRuns
A vector of the conglomerate ids of the merge runs.
-
sortBuffer
private SortBuffer sortBuffer
An in-memory ordered set that is used to sort rows before they're sent to merge runs.
-
beginMemoryUsage
private long beginMemoryUsage
Information about memory usage to dynamically tune the in-memory sort buffer size.
-
avoidMergeRun
private boolean avoidMergeRun
-
runSize
private int runSize
-
totalRunSize
private int totalRunSize
-
stat_sortType
java.lang.String stat_sortType
-
stat_numRowsInput
int stat_numRowsInput
-
stat_numRowsOutput
int stat_numRowsOutput
-
stat_numMergeRuns
int stat_numMergeRuns
-
stat_mergeRunsSize
java.util.Vector<java.lang.Integer> stat_mergeRunsSize
-
-
Method Detail
-
insert
public void insert(DataValueDescriptor[] row) throws StandardException
Insert a row into the sort.- Specified by:
insertin interfaceSortController- Parameters:
row- The row to insert into the SortController. The stored representations of the row's columns are copied into a new row somewhere in the sort.- Throws:
StandardException- Standard exception policy.- See Also:
SortController.insert(org.apache.derby.iapi.types.DataValueDescriptor[])
-
completedInserts
public void completedInserts()
Called when the caller has completed inserting rows into the sorter.- Specified by:
completedInsertsin interfaceSortController- See Also:
SortController.completedInserts()
-
getSortInfo
public SortInfo getSortInfo() throws StandardException
Return SortInfo object which contains information about the current sort.- Specified by:
getSortInfoin interfaceSortController- Returns:
- The SortInfo object which contains info about current sort.
- Throws:
StandardException- Standard exception policy.- See Also:
SortInfo
-
initialize
boolean initialize(MergeSort sort, TransactionManager tran)
Initialize this inserter.- Returns:
- true if initialization was successful
-
-