com.sun.labs.minion.classification
Class ClusterPostings
java.lang.Object
com.sun.labs.minion.indexer.postings.IDPostings
com.sun.labs.minion.indexer.postings.IDFreqPostings
com.sun.labs.minion.indexer.postings.DocumentVectorPostings
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.
|
Field Summary |
protected static java.lang.String |
logTag
|
| Fields inherited from class com.sun.labs.minion.indexer.postings.IDPostings |
curr, dataStart, ids, lastID, nIDs, nSkips, post, prevID, skipID, skipPos, skipSize |
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logTag
protected static java.lang.String logTag
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.
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