org.opends.server.backends.jeb
Class MergeValue

java.lang.Object
  extended by org.opends.server.backends.jeb.MergeValue

public class MergeValue
extends java.lang.Object

This is a class used by the index merge thread. It merges the data for one index key from multiple intermediate files.


Constructor Summary
MergeValue(int numReaders, int entryLimit)
          Create a new merge value.
 
Method Summary
 java.util.List<Longs> getAddValues()
          Get the list of arrays of IDs to be added.
 java.util.List<Longs> getDelValues()
          Get the list of arrays of IDs to be deleted.
 byte[] getKey()
          Get the value of the key.
 int[] getReaders()
          Get the readers that provided data to be merged.
 void mergeData(int reader, Longs addData, Longs delData)
          Provide data for the key from one of the file readers.
 void setKey(byte[] key)
          Set the value of the key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergeValue

public MergeValue(int numReaders,
                  int entryLimit)
Create a new merge value.

Parameters:
numReaders - The total number of file readers that could be contributing to this value. Reader identifiers are in the range 0 .. numReaders-1.
entryLimit - The configured index entry limit.
Method Detail

getKey

public byte[] getKey()
Get the value of the key.

Returns:
The key value.

setKey

public void setKey(byte[] key)
Set the value of the key.

Parameters:
key - The key value .

mergeData

public void mergeData(int reader,
                      Longs addData,
                      Longs delData)
Provide data for the key from one of the file readers.

Parameters:
reader - The reader providing the data.
addData - A set of entry IDs to be added.
delData - A set of entry IDs to be deleted.

getReaders

public int[] getReaders()
Get the readers that provided data to be merged.

Returns:
An array of identifiers of readers that provided data.

getAddValues

public java.util.List<Longs> getAddValues()
Get the list of arrays of IDs to be added.

Returns:
The list of arrays of IDs to be added.

getDelValues

public java.util.List<Longs> getDelValues()
Get the list of arrays of IDs to be deleted.

Returns:
The list of arrays of IDs to be deleted.