public abstract class AbstractLuceneIndexerImpl extends AbstractLuceneBase implements Indexer
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractLuceneIndexerImpl.Action
Enum for indexing actions against a node
|
protected static class |
AbstractLuceneIndexerImpl.Command |
protected static class |
AbstractLuceneIndexerImpl.FTSStatus |
protected static class |
AbstractLuceneIndexerImpl.IndexUpdateStatus |
| Modifier and Type | Field and Description |
|---|---|
protected NodeBulkLoader |
bulkLoader |
protected java.util.List |
commandList
List of pending indexing commands.
|
protected java.util.Set |
containerDeletions
A list of cascading container deletions we have made - at merge these deletions need to be made against the main index.
|
protected java.util.Set |
deletions
A list of all deletions we have made - at merge these deletions need to be made against the main index.
|
protected long |
docs |
protected AbstractLuceneIndexerImpl.IndexUpdateStatus |
indexUpdateStatus
Flag to indicte if we are doing an in transactional delta or a batch update to the index.
|
protected long |
maxAtomicTransformationTime
the maximum transformation time to allow atomically, defaulting to 20ms
|
static java.lang.String |
NOT_INDEXED_CONTENT_MISSING
No content
|
static java.lang.String |
NOT_INDEXED_NO_TRANSFORMATION
No transform available
|
static java.lang.String |
NOT_INDEXED_NO_TYPE_CONVERSION
No type conversion
|
static java.lang.String |
NOT_INDEXED_TRANSFORMATION_FAILED
Tranfrom failed
|
protected TransactionService |
transactionService |
deltaId, store| Constructor and Description |
|---|
AbstractLuceneIndexerImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkAbleToDoWork(AbstractLuceneIndexerImpl.IndexUpdateStatus indexUpdateStatus)
Utility method to check we are in the correct state to do work Also keeps track of the dirty flag.
|
void |
commit()
Commit this index
|
protected void |
delete(java.lang.Object ref) |
protected static java.util.Set |
deleteContainerAndBelow(java.lang.String nodeRef,
org.apache.lucene.index.IndexReader reader,
boolean delete,
boolean cascade) |
protected boolean |
deleteLeafOnly(java.lang.String nodeRef,
org.apache.lucene.index.IndexReader reader,
boolean delete) |
protected static java.util.Set |
deletePrimary(java.util.Collection nodeRefs,
org.apache.lucene.index.IndexReader reader,
boolean delete) |
protected static java.util.Set |
deleteReference(java.util.Collection nodeRefs,
org.apache.lucene.index.IndexReader reader,
boolean delete) |
protected abstract void |
doCommit() |
protected java.lang.Object |
doInReadthroughTransaction(RetryingTransactionHelper.RetryingTransactionCallback callback) |
protected abstract void |
doPrepare() |
protected abstract void |
doRollBack() |
protected abstract void |
doSetRollbackOnly() |
java.util.Set |
getContainerDeletions()
Get the container deletions
|
java.util.Set |
getDeletions()
Get the deletions
|
protected void |
index(java.lang.Object ref) |
boolean |
isModified()
Has this index been modified?
|
protected boolean |
locateContainer(java.lang.String nodeRef,
org.apache.lucene.index.IndexReader reader) |
int |
prepare()
Prepare to commit At the moment this makes sure we have all the locks TODO: This is not doing proper
serialisation against the index as would a data base transaction.
|
protected void |
reindex(java.lang.Object ref,
boolean cascadeReindexDirectories) |
void |
rollback()
Roll back the index changes (this just means they are never added)
|
void |
setBulkLoader(NodeBulkLoader bulkLoader) |
void |
setMaxAtomicTransformationTime(long maxAtomicTransformationTime)
Set the max time allowed to transform content atomically
|
void |
setReadThrough(boolean isReadThrough)
Activates 'read through' behaviour for this indexer.
|
void |
setRollbackOnly()
Mark this index for roll back only.
|
void |
setTransactionService(TransactionService transactionService) |
closeDeltaReader, closeDeltaWriter, deleteIndex, doReadOnly, getDeltaId, getDeltaReader, getDeltaWriter, getDictionaryService, getLuceneConfig, getReader, getSearcher, getSearcher, getStatus, initialise, saveDelta, setDictionaryService, setInfo, setLuceneConfig, setStatusclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateChildRelationship, createNode, deleteChildRelationship, deleteIndex, deleteNode, detectNodeChanges, flushPending, updateChildRelationship, updateNodeprotected long docs
protected TransactionService transactionService
protected NodeBulkLoader bulkLoader
public static final java.lang.String NOT_INDEXED_NO_TRANSFORMATION
public static final java.lang.String NOT_INDEXED_TRANSFORMATION_FAILED
public static final java.lang.String NOT_INDEXED_CONTENT_MISSING
public static final java.lang.String NOT_INDEXED_NO_TYPE_CONVERSION
protected long maxAtomicTransformationTime
protected java.util.Set deletions
protected java.util.Set containerDeletions
protected java.util.List commandList
protected AbstractLuceneIndexerImpl.IndexUpdateStatus indexUpdateStatus
public void setReadThrough(boolean isReadThrough)
IndexersetReadThrough in interface Indexerpublic void setTransactionService(TransactionService transactionService)
public void setBulkLoader(NodeBulkLoader bulkLoader)
bulkLoader - object to provide node loading optionsprotected static java.util.Set deletePrimary(java.util.Collection nodeRefs,
org.apache.lucene.index.IndexReader reader,
boolean delete)
throws LuceneIndexException
LuceneIndexExceptionprotected static java.util.Set deleteReference(java.util.Collection nodeRefs,
org.apache.lucene.index.IndexReader reader,
boolean delete)
throws LuceneIndexException
LuceneIndexExceptionprotected static java.util.Set deleteContainerAndBelow(java.lang.String nodeRef,
org.apache.lucene.index.IndexReader reader,
boolean delete,
boolean cascade)
throws LuceneIndexException
LuceneIndexExceptionprotected boolean locateContainer(java.lang.String nodeRef,
org.apache.lucene.index.IndexReader reader)
protected boolean deleteLeafOnly(java.lang.String nodeRef,
org.apache.lucene.index.IndexReader reader,
boolean delete)
throws LuceneIndexException
LuceneIndexExceptionpublic void setMaxAtomicTransformationTime(long maxAtomicTransformationTime)
maxAtomicTransformationTime - protected void checkAbleToDoWork(AbstractLuceneIndexerImpl.IndexUpdateStatus indexUpdateStatus)
java.io.IOExceptionpublic void commit()
throws LuceneIndexException
LuceneIndexExceptionpublic int prepare()
throws LuceneIndexException
LuceneIndexExceptionpublic boolean isModified()
public void rollback()
throws LuceneIndexException
LuceneIndexExceptionpublic void setRollbackOnly()
protected abstract void doPrepare()
throws java.io.IOException
java.io.IOExceptionprotected abstract void doCommit()
throws java.io.IOException
java.io.IOExceptionprotected abstract void doRollBack()
throws java.io.IOException
java.io.IOExceptionprotected abstract void doSetRollbackOnly()
throws java.io.IOException
java.io.IOExceptionprotected java.lang.Object doInReadthroughTransaction(RetryingTransactionHelper.RetryingTransactionCallback callback)
protected void index(java.lang.Object ref)
throws LuceneIndexException
LuceneIndexExceptionprotected void reindex(java.lang.Object ref,
boolean cascadeReindexDirectories)
throws LuceneIndexException
LuceneIndexExceptionprotected void delete(java.lang.Object ref)
throws LuceneIndexException
LuceneIndexExceptionpublic java.util.Set getDeletions()
public java.util.Set getContainerDeletions()
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.