|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.labs.minion.indexer.entry.BaseEntry
com.sun.labs.minion.indexer.entry.SinglePostingsEntry
public abstract class SinglePostingsEntry
An abstract base class for those entries that only define a single postings type. This is a convenience class that implements most of the behaviour needed for an entry that can be used at indexing or query time.
| Field Summary | |
|---|---|
protected static java.lang.String |
logTag
A tag for the log. |
protected int |
n
The number of postings associated with this entry. |
protected long |
offset
The offset of the postings in a postings file. |
protected Postings |
p
The postings associated with this entry. |
protected int |
size
The size of the postings, in bytes. |
static long |
tsize
|
| Fields inherited from class com.sun.labs.minion.indexer.entry.BaseEntry |
|---|
dict, id, name, postIn |
| Constructor Summary | |
|---|---|
SinglePostingsEntry()
Creates an entry. |
|
SinglePostingsEntry(java.lang.Object name)
Creates an entry. |
|
| Method Summary | |
|---|---|
void |
add(Occurrence o)
Adds an occurrence at indexing time. |
void |
append(QueryEntry qe,
int start,
int[] idMap)
Appends the postings from another entry onto this one. |
protected void |
copyData(SinglePostingsEntry e)
Copies the data from another entry of this type into this entry. |
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()
Gets a new entry that contains a copy of the data in this entry. |
int |
getMaxFDT()
Gets the maximum frequency in the postings associated with this entry. |
int |
getN()
Gets the number of postings associated with this entry. |
int |
getNumChannels()
Returns the number of channels needed to store the postings for this entry type. |
protected abstract Postings |
getPostings()
Gets the appropriate postings type for the class. |
protected abstract Postings |
getPostings(ReadableBuffer input)
Reads the postings for this class, returning a set of postings useful at query time. |
long |
getTotalOccurrences()
Gets the total number of occurrences associated with this entry. |
boolean |
hasFieldInformation()
Indicates whether the postings associated with this entry have field information. |
boolean |
hasPositionInformation()
Indicates whether the postings associated with this entry have position information. |
PostingsIterator |
iterator(PostingsIteratorFeatures features)
Gets an iterator that will iterate through the postings associated with this entry. |
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.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 |
| Methods inherited from interface com.sun.labs.minion.indexer.entry.Entry |
|---|
getEntry |
| Field Detail |
|---|
protected Postings p
protected int n
protected int size
protected long offset
public static long tsize
protected static java.lang.String logTag
| Constructor Detail |
|---|
public SinglePostingsEntry()
public SinglePostingsEntry(java.lang.Object name)
| Method Detail |
|---|
protected abstract Postings getPostings()
protected abstract Postings getPostings(ReadableBuffer input)
input - The buffer containing the postings read from the
postings file.
public Entry getEntry()
java.lang.ClassCastException - if the provided entry is not of type
SinglePostingsEntryprotected void copyData(SinglePostingsEntry e)
public void add(Occurrence o)
o - The occurrence to add.public int getNumChannels()
public boolean writePostings(PostingsOutput[] out,
int[] idMap)
throws java.io.IOException
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.
java.io.IOException - if there is any error writing the
postings.public void encodePostingsInfo(WriteableBuffer b)
b - The buffer onto which the postings information should be
encoded. The buffer will be positioned to the correct spot for the
encoding.
public void append(QueryEntry qe,
int start,
int[] idMap)
qe - The entry that we want to append onto this one.start - The new starting 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.
public void decodePostingsInfo(ReadableBuffer b,
int pos)
b - The buffer containing the encoded postings information.pos - The position in b where the postings
information can be found.
public void readPostings()
throws java.io.IOException
java.io.IOException - if there is any error reading the
postings.public int getN()
public long getTotalOccurrences()
public int getMaxFDT()
public boolean hasPositionInformation()
QueryEntry
public boolean hasFieldInformation()
QueryEntry
public PostingsIterator iterator(PostingsIteratorFeatures features)
features - A set of features that the iterator must support.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||