org.exist.indexing.impl
Class NGramIndex

java.lang.Object
  extended by org.exist.indexing.AbstractIndex
      extended by org.exist.indexing.impl.NGramIndex
All Implemented Interfaces:
Index

public class NGramIndex
extends AbstractIndex


Field Summary
static String ID
           
 
Constructor Summary
NGramIndex()
           
 
Method Summary
 void close()
          Close the index and all associated resources.
 void configure(BrokerPool pool, String dataDir, Element config)
          Configure the index and all resources associated with it.
 String getIndexId()
          Returns an id which uniquely identifies this index.
 Index getInstance()
           
 int getN()
           
 IndexWorker getWorker()
          Create a new IndexWorker, which is used to access the index in a multi-threaded environment.
 void open()
          Open the index for writing and reading.
 void remove()
          Close the index and remove it completely, including all resources and files associated to it.
 void sync()
          Sync the index.
 
Methods inherited from class org.exist.indexing.AbstractIndex
getBrokerPool, getIndexName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Constructor Detail

NGramIndex

public NGramIndex()
Method Detail

getInstance

public Index getInstance()
Specified by:
getInstance in class AbstractIndex

getIndexId

public String getIndexId()
Description copied from interface: Index
Returns an id which uniquely identifies this index. This is usually the class name

Returns:
a unique name identifying this index.

configure

public void configure(BrokerPool pool,
                      String dataDir,
                      Element config)
               throws DatabaseConfigurationException
Description copied from interface: Index
Configure the index and all resources associated with it. This method is called while the database instance is initializing..

Specified by:
configure in interface Index
Overrides:
configure in class AbstractIndex
Parameters:
pool - the BrokerPool representing the current database instance.
dataDir - the main data directory where eXist stores its files.
config - the module element which configures this index, as found in conf.xml
Throws:
DatabaseConfigurationException

open

public void open()
          throws DatabaseConfigurationException
Description copied from interface: Index
Open the index for writing and reading. Will be called during initialization, but also if the database had to be restarted.

Specified by:
open in interface Index
Specified by:
open in class AbstractIndex
Throws:
DatabaseConfigurationException

close

public void close()
           throws DBException
Description copied from interface: Index
Close the index and all associated resources.

Specified by:
close in interface Index
Specified by:
close in class AbstractIndex
Throws:
DBException

sync

public void sync()
          throws DBException
Description copied from interface: Index
Sync the index. This method should make sure that all index contents are written to disk. It will be called during checkpoint events and the system relies on the index to materialize all data.

Specified by:
sync in interface Index
Specified by:
sync in class AbstractIndex
Throws:
DBException

remove

public void remove()
            throws DBException
Description copied from interface: Index
Close the index and remove it completely, including all resources and files associated to it. This method is called during database repair before the db contents are reindexed.

Specified by:
remove in interface Index
Specified by:
remove in class AbstractIndex
Throws:
DBException

getWorker

public IndexWorker getWorker()
Description copied from interface: Index
Create a new IndexWorker, which is used to access the index in a multi-threaded environment. Every database instance has a number of DBBroker objects. All operations on the db have to go through one of these brokers. Each DBBroker retrieves an IndexWorker for every index by calling this method.

Specified by:
getWorker in interface Index
Specified by:
getWorker in class AbstractIndex
Returns:
a new IndexWorker that can be used for concurrent access to the index.

getN

public int getN()


Copyright (C) Wolfgang Meier. All rights reserved.