com.sun.labs.minion.indexer.dictionary
Class LongNameEntryMapper

java.lang.Object
  extended by com.sun.labs.minion.indexer.dictionary.LongNameEntryMapper
All Implemented Interfaces:
EntryMapper

public class LongNameEntryMapper
extends java.lang.Object
implements EntryMapper

An implementation of EntryMapper that is used to remap the names of the entries in the document-ID-to-field-values dictionary in the field store. The names (which are integers) are mapped to the new names in the merged document ID space.


Field Summary
protected  int[] idMap
          A mapping from old document IDs to new document IDs in this partition when garbage collection will occur.
protected  int start
          The new starting ID for the document keys from this partition.
 
Constructor Summary
LongNameEntryMapper(int start, int[] idMap)
          Creates a entry mapper for the documents from one partition.
 
Method Summary
 Entry map(Entry e)
          Maps a entry from a single partition document dictionary to a merged partition document dictionary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

start

protected int start
The new starting ID for the document keys from this partition. This will be used when there is no garbage collection going on for the partition.


idMap

protected int[] idMap
A mapping from old document IDs to new document IDs in this partition when garbage collection will occur. A new ID of -1 indicates that the given key will not occur in the merged partition. If there is no garbage collection for this partition, this will be null

Constructor Detail

LongNameEntryMapper

public LongNameEntryMapper(int start,
                           int[] idMap)
Creates a entry mapper for the documents from one partition.

Parameters:
start - The new starting ID for the document keys from this partition. This will be used when there is no garbage collection going on for the partition.
idMap - A mapping from old document IDs to new document IDs in this partition when garbage collection will occur. A new ID of -1 indicates that the given key will not occur in the merged partition. If there is no garbage collection under way for this partition, then this element can be null.
Method Detail

map

public Entry map(Entry e)
Maps a entry from a single partition document dictionary to a merged partition document dictionary. This will remap the document's ID to an ID in the merged partition.

Specified by:
map in interface EntryMapper
Parameters:
e - The entry to map.
Returns:
The mapped entry, or null if this entry should not be included in a merged dictionary. It is up to classes using the entry mapper to account for this case!