org.exist.fulltext
Class FTIndex

java.lang.Object
  extended by org.exist.indexing.AbstractIndex
      extended by org.exist.fulltext.FTIndex
All Implemented Interfaces:
Index, RawBackupSupport

public class FTIndex
extends AbstractIndex
implements RawBackupSupport

Implementation of the full text index. We are currently in a redesign process which is not yet complete. We still have dependencies on FTIndex in the database core. Once these dependencies were removed, FTIndex will be moved into a separate extension module.


Field Summary
static String FILE_NAME
           
static String ID
           
 
Constructor Summary
FTIndex()
           
 
Method Summary
 void backupToArchive(RawDataBackup backup)
           
 boolean checkIndex(DBBroker broker)
          Convenience method that allows to check index consistency.
 void close()
          Closes the index and all associated resources.
 void configure(BrokerPool pool, String dataDir, Element config)
          Configure the index and all resources associated with it.
 BFile getBFile()
           
 IndexWorker getWorker(DBBroker broker)
          Returns a new IndexWorker, which is used to access the index in a multi-threaded environment.
 void open()
          Opens the index for writing and reading.
 void remove()
          Closes the index and removes it completely, including all resources and files associated to it.
 void sync()
          Sync the index.
 
Methods inherited from class org.exist.indexing.AbstractIndex
getBrokerPool, getDataDir, getIndexId, 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

FILE_NAME

public static final String FILE_NAME
See Also:
Constant Field Values
Constructor Detail

FTIndex

public FTIndex()
Method Detail

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 and receives the
<module id="foo" class="bar"/>
section of the configuration file.

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 (if relevant).
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
Opens the index for writing and reading. Will be called during initialization, but also if the database has 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
Closes 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
Closes the index and removes 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(DBBroker broker)
Description copied from interface: Index
Returns 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
Parameters:
broker - The DBBroker that owns this worker
Returns:
a new IndexWorker that can be used for concurrent access to the index.

checkIndex

public boolean checkIndex(DBBroker broker)
Description copied from interface: Index
Convenience method that allows to check index consistency.

Specified by:
checkIndex in interface Index
Specified by:
checkIndex in class AbstractIndex
Parameters:
broker - the broker that will perform the operation.
Returns:
whether or not the index is in a consistent state. The definition of "consistency" is left to the user.

getBFile

public BFile getBFile()

backupToArchive

public void backupToArchive(RawDataBackup backup)
                     throws IOException
Specified by:
backupToArchive in interface RawBackupSupport
Throws:
IOException


Copyright (C) Wolfgang Meier. All rights reserved.