Class IndexBuilder

java.lang.Object
org.basex.core.jobs.Job
org.basex.index.IndexBuilder
Direct Known Subclasses:
FTBuilder, ValuesBuilder

public abstract class IndexBuilder extends Job
This interface defines the functions which are needed for building new index structures.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected long
    Total number of index operations (may get pretty large).
    protected final Data
    Data reference.
    protected int
    Current pre value.
    protected final int
    Total parsing value.
    protected int
    Number of partial index structures.
    protected final boolean
    Text node flag.
    protected final IndexType
    Index type.

    Fields inherited from class org.basex.core.jobs.Job

    state, updating
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract ValueIndex
    Builds the index structure and returns an index instance.
    protected void
    Checks if the command was interrupted, and prints some debug output.
    protected final void
    Performs memory cleanup after writing partial memory if necessary.
    final String
    Returns detailed progress information.
    protected final void
    Prints some final debugging information.
    protected final boolean
    Checks if the current entry should be indexed.
    final double
    Returns a progress value (0 - 1).
    final String
    Returns short progress information.
    protected final boolean
    Decides whether in-memory temporary index structures are so large that we must flush them to disk before continuing.

    Methods inherited from class org.basex.core.jobs.Job

    active, addLocks, checkStop, jc, memory, popJob, pushJob, register, state, stop, stopped, timeout, unregister

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • data

      protected final Data data
      Data reference.
    • size

      protected final int size
      Total parsing value.
    • type

      protected final IndexType type
      Index type.
    • text

      protected final boolean text
      Text node flag.
    • 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 Details

    • IndexBuilder

      protected IndexBuilder(Data data, IndexType type)
      Constructor.
      Parameters:
      data - reference
      type - index type
  • Method Details

    • build

      public abstract ValueIndex build() throws IOException
      Builds the index structure and returns an index instance.
      Returns:
      index instance
      Throws:
      IOException - I/O Exception
    • check

      protected void check() throws IOException
      Checks if the command was interrupted, and prints some debug output.
      Throws:
      IOException - I/O Exception
    • indexEntry

      protected final boolean indexEntry()
      Checks if the current entry should be indexed.
      Returns:
      result of check
    • splitRequired

      protected final boolean splitRequired() throws 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:
      IOException - I/O Exception
    • clean

      protected final void clean()
      Performs memory cleanup after writing partial memory if necessary.
    • finishIndex

      protected final void finishIndex()
      Prints some final debugging information.
    • shortInfo

      public final String shortInfo()
      Description copied from class: Job
      Returns short progress information. Can be overwritten to give more specific feedback.
      Overrides:
      shortInfo in class Job
      Returns:
      header information
    • progressInfo

      public final double progressInfo()
      Description copied from class: Job
      Returns a progress value (0 - 1). Can be overwritten to give more specific feedback.
      Overrides:
      progressInfo in class Job
      Returns:
      header information
    • detailedInfo

      public final String detailedInfo()
      Description copied from class: Job
      Returns detailed progress information. Can be overwritten to give more specific feedback.
      Overrides:
      detailedInfo in class Job
      Returns:
      header information