org.sakaiproject.search.journal.api
Interface JournaledIndex

All Superinterfaces:
JournaledObject
All Known Implementing Classes:
JournaledFSIndexStorage

public interface JournaledIndex
extends JournaledObject

A Journaled index is a in index that contains a number of journaled segments. These segments may be merged into a local index periodically

Author:
ieb

Field Summary
static String DELETE_ON_CLOSE_FILE
          A file name that is used to mark if a index should be deleted when its closed.
 
Method Summary
 void addSegment(File f)
          Add a transient segment to the journal index
 org.apache.lucene.index.IndexReader getDeletionIndexReader()
          get an index reader suitable for processing deletes The underlying reader will be bound to the thread, and must be closed, but if closed and annother thread is using it, it will not be closed immediately.
 org.apache.lucene.index.IndexWriter getPermanentIndexWriter()
          Get an index writer suitable for accessing the current permanent index
 File[] getSegments()
          get a copy of the segments currently active
 String getWorkingSpace()
          The workign space associated with the index
 void loadIndexReader()
          load the shared index reader, but dont return it or bind it to the current thread
 void saveSegmentList()
           
 void setSegments(List<File> keep)
          Set the list of segments
 
Methods inherited from interface org.sakaiproject.search.journal.api.JournaledObject
aquireReadLock, aquireUpdateLock, debugLock, getJournalSavePoint, getLastJournalEntry, releaseReadLock, releaseUpdateLock, setJournalIndexEntry, setLastJournalEntry
 

Field Detail

DELETE_ON_CLOSE_FILE

static final String DELETE_ON_CLOSE_FILE
A file name that is used to mark if a index should be deleted when its closed. This MUST only be used on local files to the JVM.

See Also:
Constant Field Values
Method Detail

getWorkingSpace

String getWorkingSpace()
The workign space associated with the index

Returns:

addSegment

void addSegment(File f)
Add a transient segment to the journal index

Parameters:
f -

getDeletionIndexReader

org.apache.lucene.index.IndexReader getDeletionIndexReader()
                                                           throws IOException
get an index reader suitable for processing deletes The underlying reader will be bound to the thread, and must be closed, but if closed and annother thread is using it, it will not be closed immediately. Although this is implementation specific the implementation should be thread safe.

Returns:
Throws:
IOException

getSegments

File[] getSegments()
get a copy of the segments currently active

Returns:

getPermanentIndexWriter

org.apache.lucene.index.IndexWriter getPermanentIndexWriter()
                                                            throws IndexTransactionException
Get an index writer suitable for accessing the current permanent index

Returns:
Throws:
IndexTransactionException

setSegments

void setSegments(List<File> keep)
Set the list of segments

Parameters:
keep -

saveSegmentList

void saveSegmentList()
                     throws IOException
Throws:
IOException

loadIndexReader

void loadIndexReader()
                     throws IOException
load the shared index reader, but dont return it or bind it to the current thread

Throws:
IOException


Copyright © 2003-2012 Sakai Project. All Rights Reserved.