org.apache.derby.impl.store.access.sort
Class MergeInserter

java.lang.Object
  extended by org.apache.derby.impl.store.access.sort.MergeInserter
All Implemented Interfaces:
SortController

final class MergeInserter
extends java.lang.Object
implements SortController


Field Summary
private  boolean avoidMergeRun
           
private  long beginFreeMemory
          Information about memory usage to dynamically tune the in-memory sort buffer size.
private  long beginTotalMemory
           
private  long estimatedMemoryUsed
           
private  java.util.Vector 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 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
MergeInserter()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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


beginFreeMemory

private long beginFreeMemory
Information about memory usage to dynamically tune the in-memory sort buffer size.


beginTotalMemory

private long beginTotalMemory

estimatedMemoryUsed

private long estimatedMemoryUsed

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 stat_mergeRunsSize
Constructor Detail

MergeInserter

MergeInserter()
Method Detail

insert

public void insert(DataValueDescriptor[] row)
            throws StandardException
Insert a row into the sort.

Specified by:
insert in interface SortController
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 interface SortController
See Also:
SortController.completedInserts()

getSortInfo

public SortInfo getSortInfo()
                     throws StandardException
Return SortInfo object which contains information about the current sort.

Specified by:
getSortInfo in interface SortController
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

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.