|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sakaiproject.search.journal.impl.JournaledFSIndexStorage
public class JournaledFSIndexStorage
This is a Journaled savePoint of the local FSIndexStorage. It will merge in new
savePoints from the journal. This is going to be performed in a non
transactional way for the moment.
The index reader must maintain a single
index reader for the JVM. When performing a read update, the single index
reader must be used, but each time the index reader is provided we should
check that the index reader has not been updated.
If the reader is being updated, then it is not safe to reload it.
| Field Summary |
|---|
| Fields inherited from interface org.sakaiproject.search.journal.api.JournaledIndex |
|---|
DELETE_ON_CLOSE_FILE |
| Constructor Summary | |
|---|---|
JournaledFSIndexStorage()
|
|
| Method Summary | |
|---|---|
void |
addIndexListener(IndexListener indexListener)
|
void |
addSegment(File f)
Add a transient segment to the journal index |
boolean |
aquireReadLock()
Aquires a lock to read the object |
boolean |
aquireUpdateLock()
get a lock on on the object for update |
boolean |
centralIndexExists()
|
void |
closeIndexReader(org.apache.lucene.index.IndexReader indexReader)
|
void |
closeIndexSearcher(org.apache.lucene.search.IndexSearcher indexSearcher)
|
void |
closeIndexWriter(org.apache.lucene.index.IndexWriter indexWrite)
|
void |
debugLock()
|
void |
destroy()
|
void |
doPostIndexUpdate()
|
void |
doPreIndexUpdate()
|
protected void |
fireIndexReaderClose(org.apache.lucene.index.IndexReader oldMultiReader)
|
protected void |
fireIndexReaderOpen(org.apache.lucene.index.IndexReader newMultiReader)
|
org.apache.lucene.analysis.Analyzer |
getAnalyzer()
|
AnalyzerFactory |
getAnalyzerFactory()
|
org.sakaiproject.cluster.api.ClusterService |
getClusterService()
|
DataSource |
getDatasource()
|
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.IndexReader |
getIndexReader()
|
org.apache.lucene.search.IndexSearcher |
getIndexSearcher()
|
org.apache.lucene.index.IndexWriter |
getIndexWriter(boolean create)
|
JournalManager |
getJournalManager()
|
long |
getJournalSavePoint()
Since this is a singleton, we can cache the savePoint only updating on change. |
JournalSettings |
getJournalSettings()
|
long |
getLastJournalEntry()
get the last journal entry we tried to migrate to |
long |
getLastLoad()
|
long |
getLastLoadTime()
|
long |
getLastUpdate()
|
org.apache.lucene.index.IndexWriter |
getPermanentIndexWriter()
Get an index writer to the permanent index, a write lock should have been taken before doing this |
List<Object[]> |
getSegmentInfoList()
|
File[] |
getSegments()
get a copy of the segments currently active |
org.sakaiproject.component.api.ServerConfigurationService |
getServerConfigurationService()
|
org.apache.lucene.store.Directory |
getSpellDirectory()
Get the SpellIndexDirectory |
org.sakaiproject.thread_local.api.ThreadLocalManager |
getThreadLocalManager()
|
String |
getWorkingSpace()
The workign space associated with the index |
boolean |
indexExists()
|
void |
init()
|
boolean |
isMultipleIndexers()
|
void |
loadIndexReader()
load the shared index reader, but dont return it or bind it to the current thread |
void |
loadSegmentList()
|
void |
markModified()
|
void |
releaseReadLock()
releases a lock to read object |
void |
releaseUpdateLock()
release the update lock |
void |
saveSegmentList()
|
void |
setAnalyzerFactory(AnalyzerFactory analzyserFactory)
|
void |
setClusterService(org.sakaiproject.cluster.api.ClusterService clusterService)
|
void |
setDatasource(DataSource datasource)
|
void |
setIndexListener(List<IndexListener> indexListeners)
|
void |
setJournalIndexEntry(long journalEntry)
Set the current index entry for the journal |
void |
setJournalManager(JournalManager journalManager)
|
void |
setJournalSettings(JournalSettings journalSettings)
|
void |
setLastJournalEntry(long lastJournalEntry)
Set the last journal entry we tried to migrate to |
void |
setRecoverCorruptedIndex(boolean recover)
|
void |
setSegments(List<File> keep)
Set the list of segments |
void |
setServerConfigurationService(org.sakaiproject.component.api.ServerConfigurationService serverConfigurationService)
|
void |
setThreadLocalManager(org.sakaiproject.thread_local.api.ThreadLocalManager threadLocalManager)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JournaledFSIndexStorage()
| Method Detail |
|---|
public void destroy()
public void init()
FSIndexStorage.init()public long getJournalSavePoint()
getJournalSavePoint in interface JournaledObjectorg.sakaiproject.search.maintanence.impl.JournaledObject#getJounalSavePoint()public boolean aquireUpdateLock()
JournaledObject
aquireUpdateLock in interface JournaledObjectJournaledObject.aquireUpdateLock()public void releaseUpdateLock()
JournaledObject
releaseUpdateLock in interface JournaledObjectJournaledObject.releaseUpdateLock()public boolean aquireReadLock()
JournaledObject
aquireReadLock in interface JournaledObjectorg.sakaiproject.search.journal.api.JournaledObject#auquireReadLock()public void releaseReadLock()
JournaledObject
releaseReadLock in interface JournaledObjectJournaledObject.releaseReadLock()public void setLastJournalEntry(long lastJournalEntry)
JournaledObject
setLastJournalEntry in interface JournaledObjectnextJournalEntry - public long getLastJournalEntry()
JournaledObject
getLastJournalEntry in interface JournaledObjectpublic void addSegment(File f)
JournaledIndex
addSegment in interface JournaledIndexJournaledIndex.addSegment(java.io.File)public String getWorkingSpace()
JournaledIndex
getWorkingSpace in interface JournaledIndexJournaledIndex.getWorkingSpace()
public org.apache.lucene.search.IndexSearcher getIndexSearcher()
throws IOException
getIndexSearcher in interface IndexStorageProviderIOExceptionBaseIndexStorage.getIndexSearcher()
public org.apache.lucene.index.IndexReader getDeletionIndexReader()
throws IOException
JournaledIndex
getDeletionIndexReader in interface JournaledIndexIOExceptionpublic boolean centralIndexExists()
public void closeIndexReader(org.apache.lucene.index.IndexReader indexReader)
throws IOException
IOExceptionpublic void closeIndexSearcher(org.apache.lucene.search.IndexSearcher indexSearcher)
public void closeIndexWriter(org.apache.lucene.index.IndexWriter indexWrite)
throws IOException
IOException
public void doPostIndexUpdate()
throws IOException
IOException
public void doPreIndexUpdate()
throws IOException
IOException
public org.apache.lucene.index.IndexReader getIndexReader()
throws IOException
getIndexReader in interface IndexStorageProviderIOException
public org.apache.lucene.index.IndexWriter getIndexWriter(boolean create)
throws IOException
IOExceptionpublic long getLastUpdate()
getLastUpdate in interface IndexStorageProviderpublic List<Object[]> getSegmentInfoList()
getSegmentInfoList in interface IndexStorageProviderpublic boolean indexExists()
public boolean isMultipleIndexers()
public void setRecoverCorruptedIndex(boolean recover)
IndexStorage.setRecoverCorruptedIndex(boolean)public DataSource getDatasource()
public void setDatasource(DataSource datasource)
datasource - the datasource to setpublic JournalManager getJournalManager()
public void setJournalManager(JournalManager journalManager)
journalMonitor - the journalMonitor to setpublic org.sakaiproject.component.api.ServerConfigurationService getServerConfigurationService()
public void setServerConfigurationService(org.sakaiproject.component.api.ServerConfigurationService serverConfigurationService)
serverConfigurationService - the serverConfigurationService to setpublic void setJournalIndexEntry(long journalEntry)
JournaledObject
setJournalIndexEntry in interface JournaledObject
protected void fireIndexReaderClose(org.apache.lucene.index.IndexReader oldMultiReader)
throws IOException
oldMultiReader -
IOExceptionprotected void fireIndexReaderOpen(org.apache.lucene.index.IndexReader newMultiReader)
newMultiReader - public void addIndexListener(IndexListener indexListener)
addIndexListener in interface IndexStorageProviderpublic void setIndexListener(List<IndexListener> indexListeners)
public org.apache.lucene.index.IndexWriter getPermanentIndexWriter()
throws IndexTransactionException
getPermanentIndexWriter in interface JournaledIndexIndexTransactionExceptionJournaledIndex.getPermanentIndexWriter()public File[] getSegments()
JournaledIndex
getSegments in interface JournaledIndexJournaledIndex.getSegments()public void setSegments(List<File> keep)
JournaledIndex
setSegments in interface JournaledIndexJournaledIndex.setSegments(java.util.List)public org.apache.lucene.analysis.Analyzer getAnalyzer()
getAnalyzer in interface IndexStorageProviderpublic AnalyzerFactory getAnalyzerFactory()
public void setAnalyzerFactory(AnalyzerFactory analzyserFactory)
analzyserFactory - The analzyserFactory to set.
public void saveSegmentList()
throws IOException
saveSegmentList in interface JournaledIndexIOException
public void loadSegmentList()
throws IOException
IOExceptionpublic org.sakaiproject.cluster.api.ClusterService getClusterService()
public void setClusterService(org.sakaiproject.cluster.api.ClusterService clusterService)
clusterService - the clusterService to set
public void loadIndexReader()
throws IOException
JournaledIndex
loadIndexReader in interface JournaledIndexIOExceptionpublic void debugLock()
debugLock in interface JournaledObjectpublic long getLastLoad()
getLastLoad in interface IndexStorageProviderpublic long getLastLoadTime()
getLastLoadTime in interface IndexStorageProviderpublic JournalSettings getJournalSettings()
public void setJournalSettings(JournalSettings journalSettings)
journalSettings - the journalSettings to set
public void markModified()
throws IOException
IOExceptionpublic org.sakaiproject.thread_local.api.ThreadLocalManager getThreadLocalManager()
public void setThreadLocalManager(org.sakaiproject.thread_local.api.ThreadLocalManager threadLocalManager)
threadLocalManager - the threadLocalManager to setpublic org.apache.lucene.store.Directory getSpellDirectory()
IndexStorageProvider
getSpellDirectory in interface IndexStorageProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||