com.sun.labs.minion.classification
Class FeatureEntry

java.lang.Object
  extended by com.sun.labs.minion.indexer.entry.BaseEntry
      extended by com.sun.labs.minion.indexer.entry.SinglePostingsEntry
          extended by com.sun.labs.minion.classification.FeatureEntry
All Implemented Interfaces:
Entry, IndexEntry, QueryEntry, java.lang.Comparable

public class FeatureEntry
extends SinglePostingsEntry


Field Summary
 
Fields inherited from class com.sun.labs.minion.indexer.entry.SinglePostingsEntry
log, logTag, n, offset, p, size, tsize
 
Fields inherited from class com.sun.labs.minion.indexer.entry.BaseEntry
dict, id, name, postIn
 
Constructor Summary
FeatureEntry()
           
FeatureEntry(java.lang.Object name)
           
 
Method Summary
 void decodePostingsInfo(ReadableBuffer b, int pos)
          Decodes the postings information associated with this entry.
 void encodePostingsInfo(WriteableBuffer b)
          Encodes any information associated with the postings onto the given buffer.
 Entry getEntry()
          Duplicates the contents of this entry, except for any postings.
 Entry getEntry(java.lang.Object name)
          Gets a new entry with the given name.
 int getMaxFDT()
          Gets the maximum frequency in the postings associated with this entry.
protected  Postings getPostings()
          Gets the appropriate postings type for the class.
protected  Postings getPostings(ReadableBuffer input)
          Reads the postings for this class, returning a set of postings useful at query time.
 void readPostings()
          Reads the postings data for this entry.
 boolean writePostings(PostingsOutput[] out, int[] idMap)
          Writes the postings associated with this entry to some or all of the given channels.
 
Methods inherited from class com.sun.labs.minion.indexer.entry.SinglePostingsEntry
add, append, copyData, getN, getNumChannels, getTotalOccurrences, hasFieldInformation, hasPositionInformation, iterator
 
Methods inherited from class com.sun.labs.minion.indexer.entry.BaseEntry
compareTo, getID, getName, getPartition, setDictionary, setID, setName, setPostingsInput, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeatureEntry

public FeatureEntry()

FeatureEntry

public FeatureEntry(java.lang.Object name)
Method Detail

getEntry

public Entry getEntry(java.lang.Object name)
Description copied from interface: Entry
Gets a new entry with the given name.

Parameters:
name - the name that we want to give the entry.
Returns:
a new entry.

getEntry

public Entry getEntry()
Duplicates the contents of this entry, except for any postings.

Specified by:
getEntry in interface Entry
Overrides:
getEntry in class SinglePostingsEntry
Returns:
a new entry containing a copy of hte data in this entry.

getPostings

protected Postings getPostings()
Gets the appropriate postings type for the class. These postings should be useable for indexing.

Specified by:
getPostings in class SinglePostingsEntry
Returns:
Postings suitable for use when indexing.

getPostings

protected Postings getPostings(ReadableBuffer input)
Reads the postings for this class, returning a set of postings useful at query time.

Specified by:
getPostings in class SinglePostingsEntry
Parameters:
input - The buffer containing the postings read from the postings file.
Returns:
The postings for this entry.

getMaxFDT

public int getMaxFDT()
Gets the maximum frequency in the postings associated with this entry. This is non-sensical for these postings, so we'll always return 1.

Specified by:
getMaxFDT in interface Entry
Overrides:
getMaxFDT in class SinglePostingsEntry
Returns:
1.

writePostings

public boolean writePostings(PostingsOutput[] out,
                             int[] idMap)
                      throws java.io.IOException
Writes the postings associated with this entry to some or all of the given channels.

Specified by:
writePostings in interface IndexEntry
Overrides:
writePostings in class SinglePostingsEntry
Parameters:
out - The outputs to which we will write the postings.
idMap - A map from the IDs currently used in the postings to the IDs that should be used when the postings are written to disk. This may be null, in which case no remapping will occur.
Returns:
true if postings were written, false otherwise
Throws:
java.io.IOException - if there is any error writing the postings.

encodePostingsInfo

public void encodePostingsInfo(WriteableBuffer b)
Encodes any information associated with the postings onto the given buffer.

Specified by:
encodePostingsInfo in interface IndexEntry
Overrides:
encodePostingsInfo in class SinglePostingsEntry
Parameters:
b - The buffer onto which the postings information should be encoded. The buffer will be positioned to the correct spot for the encoding.

decodePostingsInfo

public void decodePostingsInfo(ReadableBuffer b,
                               int pos)
Decodes the postings information associated with this entry.

Specified by:
decodePostingsInfo in interface QueryEntry
Overrides:
decodePostingsInfo in class SinglePostingsEntry
Parameters:
b - The buffer containing the encoded postings information.
pos - The position in b where the postings information can be found.

readPostings

public void readPostings()
                  throws java.io.IOException
Reads the postings data for this entry. This method must load all available postings information, since this will be used at dictionary merge time to append postings from one entry onto another.

Specified by:
readPostings in interface QueryEntry
Overrides:
readPostings in class SinglePostingsEntry
Throws:
java.io.IOException - if there is any error reading the postings.