gate.creole.annic.apache.lucene.index
Class TermInfosWriter

java.lang.Object
  extended by gate.creole.annic.apache.lucene.index.TermInfosWriter

final class TermInfosWriter
extends Object

This stores a monotonically increasing set of pairs in a Directory. A TermInfos can be written once, in order.


Field Summary
private  FieldInfos fieldInfos
           
static int FORMAT
          The file format version, a negative number.
(package private)  int indexInterval
          Expert: The fraction of terms in the "dictionary" which should be stored in RAM.
private  boolean isIndex
           
private  long lastIndexPointer
           
private  Term lastTerm
           
private  TermInfo lastTi
           
private  TermInfosWriter other
           
private  OutputStream output
           
private  long size
           
(package private)  int skipInterval
          Expert: The fraction of TermDocs entries stored in skip tables, used to accellerate TermDocs.skipTo(int).
 
Constructor Summary
(package private) TermInfosWriter(Directory directory, String segment, FieldInfos fis)
           
private TermInfosWriter(Directory directory, String segment, FieldInfos fis, boolean isIndex)
           
 
Method Summary
(package private)  void add(Term term, TermInfo ti)
          Adds a new pair to the set.
(package private)  void close()
          Called to complete TermInfos creation.
private  void initialize(Directory directory, String segment, FieldInfos fis, boolean isi)
           
private  void writeTerm(Term term)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT

public static final int FORMAT
The file format version, a negative number.

See Also:
Constant Field Values

fieldInfos

private FieldInfos fieldInfos

output

private OutputStream output

lastTerm

private Term lastTerm

lastTi

private TermInfo lastTi

size

private long size

indexInterval

int indexInterval
Expert: The fraction of terms in the "dictionary" which should be stored in RAM. Smaller values use more memory, but make searching slightly faster, while larger values use less memory and make searching slightly slower. Searching is typically not dominated by dictionary lookup, so tweaking this is rarely useful.


skipInterval

int skipInterval
Expert: The fraction of TermDocs entries stored in skip tables, used to accellerate TermDocs.skipTo(int). Larger values result in smaller indexes, greater acceleration, but fewer accelerable cases, while smaller values result in bigger indexes, less acceleration and more accelerable cases. More detailed experiments would be useful here.


lastIndexPointer

private long lastIndexPointer

isIndex

private boolean isIndex

other

private TermInfosWriter other
Constructor Detail

TermInfosWriter

TermInfosWriter(Directory directory,
                String segment,
                FieldInfos fis)
          throws IOException
Throws:
IOException

TermInfosWriter

private TermInfosWriter(Directory directory,
                        String segment,
                        FieldInfos fis,
                        boolean isIndex)
                 throws IOException
Throws:
IOException
Method Detail

initialize

private void initialize(Directory directory,
                        String segment,
                        FieldInfos fis,
                        boolean isi)
                 throws IOException
Throws:
IOException

add

final void add(Term term,
               TermInfo ti)
        throws IOException
Adds a new pair to the set. Term must be lexicographically greater than all previous Terms added. TermInfo pointers must be positive and greater than all previous.

Throws:
IOException

writeTerm

private final void writeTerm(Term term)
                      throws IOException
Throws:
IOException

close

final void close()
          throws IOException
Called to complete TermInfos creation.

Throws:
IOException