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

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

public final class MergeInserter
extends java.lang.Object
implements SortController


Field Summary
(package private)  boolean avoidMergeRun
           
(package private)  long beginFreeMemory
          Information about memory usage to dynamically tune the in-memory sort buffer size.
(package private)  long beginTotalMemory
           
(package private)  long estimatedMemoryUsed
           
(package private)  java.util.Vector mergeRuns
          A vector of the conglomerate ids of the merge runs.
(package private)  int runSize
           
protected  MergeSort sort
          The sort this inserter is for.
(package private)  SortBuffer sortBuffer
          An in-memory ordered set that is used to sort rows before they're sent to merge runs.
protected  java.util.Vector stat_mergeRunsSize
           
protected  int stat_numMergeRuns
           
protected  int stat_numRowsInput
           
protected  int stat_numRowsOutput
           
protected  java.lang.String stat_sortType
           
(package private)  int totalRunSize
           
protected  TransactionManager tran
          The transaction this inserter is in.
 
Constructor Summary
MergeInserter()
           
 
Method Summary
 void close()
          Close this sort controller.
 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

protected MergeSort sort
The sort this inserter is for.


tran

protected TransactionManager tran
The transaction this inserter is in.


mergeRuns

java.util.Vector mergeRuns
A vector of the conglomerate ids of the merge runs.


sortBuffer

SortBuffer sortBuffer
An in-memory ordered set that is used to sort rows before they're sent to merge runs.


beginFreeMemory

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


beginTotalMemory

long beginTotalMemory

estimatedMemoryUsed

long estimatedMemoryUsed

avoidMergeRun

boolean avoidMergeRun

runSize

int runSize

totalRunSize

int totalRunSize

stat_sortType

protected java.lang.String stat_sortType

stat_numRowsInput

protected int stat_numRowsInput

stat_numRowsOutput

protected int stat_numRowsOutput

stat_numMergeRuns

protected int stat_numMergeRuns

stat_mergeRunsSize

protected java.util.Vector stat_mergeRunsSize
Constructor Detail

MergeInserter

public 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 conglomerate. The stored representations of the row's columns are copied into a new row somewhere in the conglomerate.
Throws:
StandardException - Standard exception policy.
See Also:
SortController.insert(org.apache.derby.iapi.types.DataValueDescriptor[])

close

public void close()
Close this sort controller. Closing the sort controller means the caller is done inserting rows. This method must not throw any exceptions since it's called during error processing.

Specified by:
close in interface SortController
See Also:
SortController.close()

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 Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.