org.exist.indexing
Class AbstractIndex

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

public abstract class AbstractIndex
extends Object
implements Index


Constructor Summary
AbstractIndex()
           
 
Method Summary
abstract  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.
 BrokerPool getBrokerPool()
           
 String getIndexName()
          Returns a name which uniquely identifies this index.
abstract  Index getInstance()
           
abstract  IndexWorker getWorker()
          Create a new IndexWorker, which is used to access the index in a multi-threaded environment.
abstract  void open()
          Open the index for writing and reading.
abstract  void remove()
          Close the index and remove it completely, including all resources and files associated to it.
abstract  void sync()
          Sync the index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.exist.indexing.Index
getIndexId
 

Constructor Detail

AbstractIndex

public AbstractIndex()
Method Detail

getInstance

public abstract Index getInstance()

getIndexName

public String getIndexName()
Description copied from interface: Index
Returns a name which uniquely identifies this index. This is configured by the user

Specified by:
getIndexName in interface Index
Returns:
a unique name identifying this index.

getBrokerPool

public BrokerPool getBrokerPool()
Specified by:
getBrokerPool in interface 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
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 abstract 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
Throws:
DatabaseConfigurationException

close

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

Specified by:
close in interface Index
Throws:
DBException

sync

public abstract 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
Throws:
DBException

getWorker

public abstract 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
Returns:
a new IndexWorker that can be used for concurrent access to the index.

remove

public abstract 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
Throws:
DBException


Copyright (C) Wolfgang Meier. All rights reserved.