org.basex.index
Class IndexBuilder

java.lang.Object
  extended by org.basex.core.Proc
      extended by org.basex.index.IndexBuilder
Direct Known Subclasses:
FTBuilder, ValueIndexBuilder

public abstract class IndexBuilder
extends Proc

This interface defines the functions which are needed for building new index structures.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
protected  long count
          Total number of index operations (may get pretty large).
protected  Data data
          Data reference.
protected  int pre
          Current pre value.
protected  int size
          Total parsing value.
protected  int splits
          Number of partial index structures.
protected  int splitSize
          Number of index operations to perform before writing a partial index to disk.
 
Fields inherited from class org.basex.core.Proc
listen, updating
 
Constructor Summary
protected IndexBuilder(Data d, int max)
          Constructor.
 
Method Summary
abstract  Index build()
          Builds the index structure and returns an index instance.
protected  void check()
          Checks if the command was interrupted, and prints some debug output.
protected  void finishIndex(Performance perf)
          Prints some final debugging information.
protected  void finishSplit()
          Performs memory cleanup after writing partial memory, if necessary.
 double prog()
          Returns a progress value (0 - 1).
protected  boolean split()
          Decides whether in-memory temporary index structures are so large that we must flush them to disk before continuing.
 java.lang.String tit()
          Returns short information on this process.
 
Methods inherited from class org.basex.core.Proc
abort, checkStop, databases, det, detail, listen, proc, progress, registered, registered, startTimeout, stop, stopTimeout, title
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected final Data data
Data reference.


size

protected final int size
Total parsing value.


splitSize

protected final int splitSize
Number of index operations to perform before writing a partial index to disk.


pre

protected int pre
Current pre value.


count

protected long count
Total number of index operations (may get pretty large).


splits

protected int splits
Number of partial index structures.

Constructor Detail

IndexBuilder

protected IndexBuilder(Data d,
                       int max)
Constructor.

Parameters:
d - reference
max - maximum number of operations per partial index
Method Detail

build

public abstract Index build()
                     throws java.io.IOException
Builds the index structure and returns an index instance.

Returns:
index instance
Throws:
java.io.IOException - I/O Exception

check

protected final void check()
Checks if the command was interrupted, and prints some debug output.


split

protected final boolean split()
                       throws java.io.IOException
Decides whether in-memory temporary index structures are so large that we must flush them to disk before continuing.

Returns:
true if structures shall be flushed to disk
Throws:
java.io.IOException - I/O Exception

finishSplit

protected final void finishSplit()
Performs memory cleanup after writing partial memory, if necessary.


finishIndex

protected final void finishIndex(Performance perf)
Prints some final debugging information.

Parameters:
perf - performance

tit

public final java.lang.String tit()
Description copied from class: Proc
Returns short information on this process. Can be overwritten to give more detailed information.

Overrides:
tit in class Proc
Returns:
header information

prog

public final double prog()
Description copied from class: Proc
Returns a progress value (0 - 1). Can be overwritten to give more detailed information.

Overrides:
prog in class Proc
Returns:
header information