|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.lucene.engine.store.AbstractLuceneSearchEngineStore
public abstract class AbstractLuceneSearchEngineStore
| Nested Class Summary | |
|---|---|
protected class |
AbstractLuceneSearchEngineStore.CopyFromHolder
|
| Nested classes/interfaces inherited from interface org.compass.core.lucene.engine.store.LuceneSearchEngineStore |
|---|
LuceneSearchEngineStore.LuceneStoreCallback |
| Field Summary | |
|---|---|
protected String |
connectionString
|
protected org.apache.commons.logging.Log |
log
|
protected String |
subContext
|
protected LuceneStoreTemplate |
template
|
| Constructor Summary | |
|---|---|
AbstractLuceneSearchEngineStore(String connectionString,
String subContext)
|
|
| Method Summary | |
|---|---|
String[] |
calcSubIndexes(String[] subIndexes,
String[] aliases)
Returns the sub indexes that intersect with the given sub indexes and aliases provided. |
void |
close()
Closes the store. |
protected void |
closeDirectories()
|
void |
closeDirectory(String subIndex,
Directory dir)
Closes the given directory. |
void |
configure(LuceneSearchEngineFactory searchEngineFactory,
CompassSettings settings,
CompassMapping mapping)
Configures the store. |
void |
copyFrom(LuceneSearchEngineStore searchEngineStore)
Copies the index from the given store into the current store. |
void |
createIndex()
Creates the index (if it is already exists, delets it first). |
void |
deleteIndex()
Deletes the index. |
protected void |
doAfterFailedCopyFrom(AbstractLuceneSearchEngineStore.CopyFromHolder holder)
|
protected void |
doAfterSuccessfulCopyFrom(AbstractLuceneSearchEngineStore.CopyFromHolder holder)
|
protected AbstractLuceneSearchEngineStore.CopyFromHolder |
doBeforeCopyFrom()
|
protected void |
doClose()
|
protected abstract void |
doDeleteIndex()
|
protected abstract Directory |
doOpenDirectoryBySubIndex(String subIndex,
boolean create)
|
Directory |
getDirectoryBySubIndex(String subIndex,
boolean create)
Returns the directory that match the given sub index. |
LuceneSettings |
getLuceneSettings()
Returns the lucene settings. |
int |
getNumberOfAliasesBySubIndex(String subIndex)
Returns the number of aliases that map to the given sub index. |
String[] |
getSubIndexes()
Returns all the sub indexes defined within the store. |
boolean |
indexExists()
Returns true if one of the sub indexes index does not
exists. |
protected Boolean |
indexExists(Directory dir)
|
protected boolean |
indexExists(String subIndex)
|
boolean |
isLocked()
Returns true if any sub index is locked. |
boolean |
isLocked(String subIndex)
Returns true if the sub index is locked (both Lucene write and commit locks). |
void |
performScheduledTasks()
Performs any scheduled tasks, managed by the index manager. |
void |
registerEventListeners(SearchEngine searchEngine,
SearchEngineEventManager eventManager)
A callback to register event listeners when a SearchEngine is
created. |
void |
releaseLock(String subIndex)
Releases the lock for the given sub index. |
void |
releaseLocks()
Releases all the locks on all the sub indexes. |
String |
toString()
|
boolean |
verifyIndex()
Verify that the index exists. |
protected boolean |
verifyIndex(String subIndex)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.commons.logging.Log log
protected LuceneStoreTemplate template
protected String connectionString
protected String subContext
| Constructor Detail |
|---|
public AbstractLuceneSearchEngineStore(String connectionString,
String subContext)
| Method Detail |
|---|
public void configure(LuceneSearchEngineFactory searchEngineFactory,
CompassSettings settings,
CompassMapping mapping)
LuceneSearchEngineStore
configure in interface LuceneSearchEngineStorepublic void close()
LuceneSearchEngineStore
close in interface LuceneSearchEngineStoreprotected void closeDirectories()
protected void doClose()
public void performScheduledTasks()
LuceneSearchEngineStore
performScheduledTasks in interface LuceneSearchEngineStore
public void closeDirectory(String subIndex,
Directory dir)
throws SearchEngineException
LuceneSearchEngineStore
closeDirectory in interface LuceneSearchEngineStoreSearchEngineExceptionpublic int getNumberOfAliasesBySubIndex(String subIndex)
LuceneSearchEngineStore
getNumberOfAliasesBySubIndex in interface LuceneSearchEngineStore
public Directory getDirectoryBySubIndex(String subIndex,
boolean create)
throws SearchEngineException
LuceneSearchEngineStore
getDirectoryBySubIndex in interface LuceneSearchEngineStoreSearchEngineException
protected abstract Directory doOpenDirectoryBySubIndex(String subIndex,
boolean create)
throws SearchEngineException
SearchEngineException
protected boolean indexExists(String subIndex)
throws SearchEngineException
SearchEngineException
protected Boolean indexExists(Directory dir)
throws IOException
IOException
protected boolean verifyIndex(String subIndex)
throws SearchEngineException
SearchEngineException
public void createIndex()
throws SearchEngineException
LuceneSearchEngineStore
createIndex in interface LuceneSearchEngineStoreSearchEngineException
public boolean verifyIndex()
throws SearchEngineException
LuceneSearchEngineStore
verifyIndex in interface LuceneSearchEngineStoreSearchEngineException
public boolean indexExists()
throws SearchEngineException
LuceneSearchEngineStoretrue if one of the sub indexes index does not
exists.
indexExists in interface LuceneSearchEngineStoreSearchEngineException
public void deleteIndex()
throws SearchEngineException
LuceneSearchEngineStore
deleteIndex in interface LuceneSearchEngineStoreSearchEngineException
protected abstract void doDeleteIndex()
throws SearchEngineException
SearchEngineExceptionpublic String[] getSubIndexes()
LuceneSearchEngineStore
getSubIndexes in interface LuceneSearchEngineStore
public String[] calcSubIndexes(String[] subIndexes,
String[] aliases)
LuceneSearchEngineStorenull,
return all the sub indexes.
calcSubIndexes in interface LuceneSearchEngineStore
public boolean isLocked()
throws SearchEngineException
LuceneSearchEngineStoretrue if any sub index is locked.
isLocked in interface LuceneSearchEngineStoreSearchEngineException
public boolean isLocked(String subIndex)
throws SearchEngineException
LuceneSearchEngineStoretrue if the sub index is locked (both Lucene write and commit locks).
isLocked in interface LuceneSearchEngineStoreSearchEngineException
public void releaseLocks()
throws SearchEngineException
LuceneSearchEngineStore
releaseLocks in interface LuceneSearchEngineStoreSearchEngineException
public void releaseLock(String subIndex)
throws SearchEngineException
LuceneSearchEngineStore
releaseLock in interface LuceneSearchEngineStoreSearchEngineException
public void registerEventListeners(SearchEngine searchEngine,
SearchEngineEventManager eventManager)
LuceneSearchEngineStoreSearchEngine is
created.
registerEventListeners in interface LuceneSearchEngineStoresearchEngine - The search engine createdeventManager - The event manager to register events with
public void copyFrom(LuceneSearchEngineStore searchEngineStore)
throws SearchEngineException
LuceneSearchEngineStore
copyFrom in interface LuceneSearchEngineStoresearchEngineStore - The store to copy from
SearchEngineException
protected AbstractLuceneSearchEngineStore.CopyFromHolder doBeforeCopyFrom()
throws SearchEngineException
SearchEngineException
protected void doAfterSuccessfulCopyFrom(AbstractLuceneSearchEngineStore.CopyFromHolder holder)
throws SearchEngineException
SearchEngineException
protected void doAfterFailedCopyFrom(AbstractLuceneSearchEngineStore.CopyFromHolder holder)
throws SearchEngineException
SearchEngineExceptionpublic LuceneSettings getLuceneSettings()
LuceneSearchEngineStore
getLuceneSettings in interface LuceneSearchEngineStorepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||