de.aitools.aq.invertedindex.core
Class Configuration

java.lang.Object
  extended by de.aitools.aq.invertedindex.core.Configuration

public final class Configuration
extends java.lang.Object

A configuration class to setup instances of Indexer, ManagedIndexer and Searcher.

Version:
$Id: Configuration.java,v 1.8 2011/07/18 03:18:52 trenkman Exp $
Author:
martin.trenkmann@uni-weimar.de

Nested Class Summary
static class Configuration.KeySorting
          Modes defining the sorting of keys.
static class Configuration.ValueSorting
          Modes defining the sorting of values.
 
Field Summary
static java.lang.String NATIVE_LIB
          The name of the native library.
 
Constructor Summary
Configuration()
          Creates a default configuration with setKeySorting(KeySorting) set to Configuration.KeySorting.UNSORTED, setValueSorting(ValueSorting) set to Configuration.ValueSorting.DISABLED, setMaxMemoryUsage(Memory) set to Memory.MB1024 and setInputDirectory(File) and setIndexDirectory(File) left empty.
 
Method Summary
 long getExpectedNumberOfRecords()
          Returns the total number of records expected to be inserted.
 java.io.File getIndexDirectory()
          Returns the index directory.
 java.io.File getInputDirectory()
          Returns the input directory.
 Configuration.KeySorting getKeySorting()
          Returns the mode of the key sorting.
 Memory getMaxMemoryUsage()
          Returns the upper bound of memory to use.
 Configuration.ValueSorting getValueSorting()
          Returns the mode of the value sorting.
 java.io.PrintStream printTo(java.io.PrintStream stream)
          Prints the content of this object in a human-readable form to the given PrintStream.
 void setExpectedNumberOfRecords(long numberOfRecords)
          Set the number of records expected to be inserted.
 void setIndexDirectory(java.io.File indexDirectory)
          Sets the index directory.
 void setInputDirectory(java.io.File inputDirectory)
          Sets the input directory.
 void setKeySorting(Configuration.KeySorting sorting)
          Sets the mode of the key sorting.
 void setMaxMemoryUsage(Memory maxMemoryUsage)
          Sets the maximal amount of memory the index is required to use during indexing.
 void setValueSorting(Configuration.ValueSorting sorting)
          Sets the mode of the value sorting.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NATIVE_LIB

public static final java.lang.String NATIVE_LIB
The name of the native library.

See Also:
Constant Field Values
Constructor Detail

Configuration

public Configuration()
Creates a default configuration with setKeySorting(KeySorting) set to Configuration.KeySorting.UNSORTED, setValueSorting(ValueSorting) set to Configuration.ValueSorting.DISABLED, setMaxMemoryUsage(Memory) set to Memory.MB1024 and setInputDirectory(File) and setIndexDirectory(File) left empty.

Method Detail

getExpectedNumberOfRecords

public long getExpectedNumberOfRecords()
Returns the total number of records expected to be inserted.

Returns:
the total number of records

getIndexDirectory

public java.io.File getIndexDirectory()
Returns the index directory.

Returns:
the path of the index directory

getInputDirectory

public java.io.File getInputDirectory()
Returns the input directory.

Returns:
the path of input directory

getKeySorting

public Configuration.KeySorting getKeySorting()
Returns the mode of the key sorting.

Returns:
the key sorting mode

getMaxMemoryUsage

public Memory getMaxMemoryUsage()
Returns the upper bound of memory to use.

Returns:
a constant specifying some amount of memory

getValueSorting

public Configuration.ValueSorting getValueSorting()
Returns the mode of the value sorting.

Returns:
the value sorting mode

printTo

public java.io.PrintStream printTo(java.io.PrintStream stream)
Prints the content of this object in a human-readable form to the given PrintStream.

Parameters:
stream - the stream to print to
Returns:
the stream instance itself

setExpectedNumberOfRecords

public void setExpectedNumberOfRecords(long numberOfRecords)
Set the number of records expected to be inserted.

Parameters:
numberOfRecords - the total number of records

setIndexDirectory

public void setIndexDirectory(java.io.File indexDirectory)
Sets the index directory. In the case of Indexer and ManagedIndexer this directory specifies where the index has to be created. In the case of Searcher the index instance to load is expected in this directory.

Parameters:
indexDirectory - the path of the index directory

setInputDirectory

public void setInputDirectory(java.io.File inputDirectory)
Sets the input directory. When using the ManagedIndexer for indexing this path specifies the location of the inverted files.

Parameters:
inputDirectory - the path of the input directory

setKeySorting

public void setKeySorting(Configuration.KeySorting sorting)
Sets the mode of the key sorting.

Parameters:
sorting - the key sorting mode

setMaxMemoryUsage

public void setMaxMemoryUsage(Memory maxMemoryUsage)
Sets the maximal amount of memory the index is required to use during indexing. If Memory.MinRequired is specified the index tries best attempt to work with minimal footprint. In general a higher value can increase the indexing and/or search performance.

Parameters:
maxMemoryUsage - the maximal amount of memory to use

setValueSorting

public void setValueSorting(Configuration.ValueSorting sorting)
Sets the mode of the value sorting.

Parameters:
sorting - the value sorting mode