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 boolean
avoidMergeRun
private long
beginMemoryUsage
Information about memory usage to dynamically tune the in-memory sort buffer size.private java.util.Vector<java.lang.Long>
mergeRuns
A vector of the conglomerate ids of the merge runs.private int
runSize
private MergeSort
sort
The sort this inserter is for.private SortBuffer
sortBuffer
An 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) int
stat_numMergeRuns
(package private) int
stat_numRowsInput
(package private) int
stat_numRowsOutput
(package private) java.lang.String
stat_sortType
private int
totalRunSize
private TransactionManager
tran
The transaction this inserter is in.
-
Constructor Summary
Constructors Constructor Description MergeInserter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
completedInserts()
Called when the caller has completed inserting rows into the sorter.SortInfo
getSortInfo()
Return SortInfo object which contains information about the current sort.(package private) boolean
initialize(MergeSort sort, TransactionManager tran)
Initialize this inserter.void
insert(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:
insert
in 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:
completedInserts
in interfaceSortController
- See Also:
SortController.completedInserts()
-
getSortInfo
public SortInfo getSortInfo() throws StandardException
Return SortInfo object which contains information about the current sort.- Specified by:
getSortInfo
in 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
-
-