com.sun.labs.minion.indexer.partition
Class PartitionManager.Merger

java.lang.Object
  extended by com.sun.labs.minion.indexer.partition.PartitionManager.Merger
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
PartitionManager

public class PartitionManager.Merger
extends java.lang.Object
implements java.lang.Runnable

A threadable class used for merging a list of partitions.


Field Summary
protected  DiskPartition newDP
          The new disk partition resulting from the merge.
protected  int newPart
          The new partition created in the merge.
protected  java.lang.Thread parent
          The thread that instantiated us.
protected  java.util.List<DelMap> preDelMaps
          The list of delmaps for the partitions.
protected  ReadableBuffer[] preMaps
          The deletion bitmaps for the partitions at startup.
protected  java.util.List<DiskPartition> toMerge
          The list of partitions that we wish to merge.
 
Constructor Summary
PartitionManager.Merger(java.util.List<DiskPartition> l, FileLock localMergeLock)
          Instantiates a merger for the given list of partitions.
 
Method Summary
 DiskPartition merge()
          Merges.
 void run()
          Does the merge of the partitions.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

newDP

protected DiskPartition newDP
The new disk partition resulting from the merge.


toMerge

protected java.util.List<DiskPartition> toMerge
The list of partitions that we wish to merge.


preDelMaps

protected java.util.List<DelMap> preDelMaps
The list of delmaps for the partitions.


preMaps

protected ReadableBuffer[] preMaps
The deletion bitmaps for the partitions at startup.


parent

protected java.lang.Thread parent
The thread that instantiated us. We need to take the merge lock from them.


newPart

protected int newPart
The new partition created in the merge.

Constructor Detail

PartitionManager.Merger

public PartitionManager.Merger(java.util.List<DiskPartition> l,
                               FileLock localMergeLock)
Instantiates a merger for the given list of partitions. The resulting partition will be added to the active list of the given manager.

Parameters:
l - The list of partitions to merge.
localMergeLock - the lock file to use when releasing the merge lock.
Method Detail

merge

public DiskPartition merge()
Merges.


run

public void run()
Does the merge of the partitions.

Specified by:
run in interface java.lang.Runnable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object