com.sun.labs.minion.classification
Class ClusterPostings

java.lang.Object
  extended by com.sun.labs.minion.indexer.postings.IDPostings
      extended by com.sun.labs.minion.indexer.postings.IDFreqPostings
          extended by com.sun.labs.minion.indexer.postings.DocumentVectorPostings
              extended by com.sun.labs.minion.classification.ClusterPostings
All Implemented Interfaces:
MergeablePostings, Postings

public class ClusterPostings
extends DocumentVectorPostings

Postings for the cluster documents in the cluster partition. These are similar in their behavior to DocumentVectorPostings in that occurences do not need to be added to them in order. Unlike DVP, the cluster postings extends that functionality into the merge behavior. Postings need not be appended in order -- that is, the append method is implemented as a merge.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.labs.minion.indexer.postings.IDFreqPostings
IDFreqPostings.IDFreqIterator
 
Nested classes/interfaces inherited from class com.sun.labs.minion.indexer.postings.IDPostings
IDPostings.IDIterator
 
Field Summary
protected static java.lang.String logTag
           
 
Fields inherited from class com.sun.labs.minion.indexer.postings.DocumentVectorPostings
entries
 
Fields inherited from class com.sun.labs.minion.indexer.postings.IDFreqPostings
freq, freqs, maxfdt, to
 
Fields inherited from class com.sun.labs.minion.indexer.postings.IDPostings
curr, dataStart, ids, lastID, nIDs, nSkips, post, prevID, skipID, skipPos, skipSize
 
Constructor Summary
ClusterPostings()
          Creates a set of postings suitable for use during indexing.
ClusterPostings(ReadableBuffer b)
          Creates a set of postings suitable for use during querying.
 
Method Summary
 void append(Postings p, int start, int[] idMap)
          Appends another set of postings to this one, removing any data associated with deleted documents.
 void remap(int[] idMap)
          Writes the in-memory frequency array out to the postings buffers.
 
Methods inherited from class com.sun.labs.minion.indexer.postings.DocumentVectorPostings
add, finish, getWeightedFeatures, merge, size
 
Methods inherited from class com.sun.labs.minion.indexer.postings.IDFreqPostings
encode, getMaxFDT, getTotalOccurrences, iterator, recodeID
 
Methods inherited from class com.sun.labs.minion.indexer.postings.IDPostings
addSkip, append, getBuffers, getLastID, getN, setSkipSize, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logTag

protected static java.lang.String logTag
Constructor Detail

ClusterPostings

public ClusterPostings()
Creates a set of postings suitable for use during indexing.


ClusterPostings

public ClusterPostings(ReadableBuffer b)
Creates a set of postings suitable for use during querying.

Parameters:
b - a buffer containing the encoded postings.
Method Detail

append

public void append(Postings p,
                   int start,
                   int[] idMap)
Appends another set of postings to this one, removing any data associated with deleted documents.

Specified by:
append in interface Postings
Overrides:
append in class IDPostings
Parameters:
p - The postings to append. Implementers can safely assume that the postings being passed in are of the same class as the implementing class.
start - The new starting document ID for the partition that the entry was drawn from.
idMap - A map from old IDs in the given postings to new IDs with gaps removed for deleted data. If this is null, then there are no deleted documents.

remap

public void remap(int[] idMap)
Writes the in-memory frequency array out to the postings buffers. This is done in the remap method for consistency with the super class. Otherwise, this would probably be done in finish(). Since the clusters' contents will already have been remapped at this point (from the append method) we just flush the contents directly out to disk.

Specified by:
remap in interface Postings
Overrides:
remap in class DocumentVectorPostings
Parameters:
idMap - a map from old IDs to new IDs -- ignored