|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.galagosearch.core.index.IndexWriter
public class IndexWriter
This class writes index files, which are used for most Galago indexes. An index is a mapping between a key and a value, much like a TreeMap. The keys are sorted to allow iteration over the whole file. Keys are stored using prefix compression to save space. The structure is designed for fast random access on disk. For indexes, we assume that the data in each value is already compressed, so IndexWriter does no additional compression. However, if the isCompressed flag is set, IndexWriter will compress the value data. This is convenient for storing documents in an index. Keys cannot be longer than 256 bytes, and they must be added in sorted order.
| Field Summary | |
|---|---|
static long |
MAGIC_NUMBER
|
| Constructor Summary | |
|---|---|
IndexWriter(java.lang.String outputFilename)
|
|
IndexWriter(java.lang.String outputFilename,
org.galagosearch.tupleflow.Parameters parameters)
Creates a new instance of IndexWriter |
|
IndexWriter(org.galagosearch.tupleflow.TupleFlowParameters parameters)
|
|
| Method Summary | |
|---|---|
void |
add(IndexElement list)
|
long |
bufferedSize()
Gives a conservative estimate of the buffered size of the data, excluding the most recent inverted list. |
void |
close()
|
void |
flush()
Flush all lists out to disk. |
long |
getBlockSize()
|
org.galagosearch.tupleflow.Parameters |
getManifest()
Returns the current copy of the manifest, which will be stored in the completed index file. |
void |
updateBufferedSize(IndexElement list)
|
boolean |
wordsInOrder(java.util.List<IndexElement> blockLists)
Returns true if the lists are sorted in ascending order by key. |
void |
writeBlock(java.util.List<IndexElement> blockLists,
long length)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long MAGIC_NUMBER
| Constructor Detail |
|---|
public IndexWriter(java.lang.String outputFilename,
org.galagosearch.tupleflow.Parameters parameters)
throws java.io.FileNotFoundException,
java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public IndexWriter(java.lang.String outputFilename)
throws java.io.FileNotFoundException,
java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public IndexWriter(org.galagosearch.tupleflow.TupleFlowParameters parameters)
throws java.io.FileNotFoundException,
java.io.IOException
java.io.FileNotFoundException
java.io.IOException| Method Detail |
|---|
public org.galagosearch.tupleflow.Parameters getManifest()
public long bufferedSize()
public void updateBufferedSize(IndexElement list)
public void flush()
throws java.io.IOException
java.io.IOExceptionpublic long getBlockSize()
public boolean wordsInOrder(java.util.List<IndexElement> blockLists)
blockLists -
public void writeBlock(java.util.List<IndexElement> blockLists,
long length)
throws java.io.IOException
java.io.IOException
public void add(IndexElement list)
throws java.io.IOException
java.io.IOException
public void close()
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||