T
- -
the type used to generate the key in the index filepublic abstract class AbstractLuceneIndexerImpl<T> 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<S> |
protected static class |
AbstractLuceneIndexerImpl.FTSStatus |
protected static class |
AbstractLuceneIndexerImpl.IndexUpdateStatus |
Modifier and Type | Field and Description |
---|---|
protected NodeBulkLoader |
bulkLoader |
protected List<AbstractLuceneIndexerImpl.Command<T>> |
commandList
List of pending indexing commands.
|
protected Set<String> |
containerDeletions
A list of cascading container deletions we have made - at merge these deletions need to be made against the main index.
|
protected Set<String> |
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 String |
NOT_INDEXED_CONTENT_MISSING
No content
|
static String |
NOT_INDEXED_NO_TRANSFORMATION
No transform available
|
static String |
NOT_INDEXED_NO_TYPE_CONVERSION
No type conversion
|
static 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(T ref) |
protected static Set<String> |
deleteContainerAndBelow(String nodeRef,
org.apache.lucene.index.IndexReader reader,
boolean delete,
boolean cascade) |
protected static Set<String> |
deletePrimary(Collection<String> nodeRefs,
org.apache.lucene.index.IndexReader reader,
boolean delete) |
protected static Set<String> |
deleteReference(Collection<String> nodeRefs,
org.apache.lucene.index.IndexReader reader,
boolean delete) |
protected abstract void |
doCommit() |
protected <T2> T2 |
doInReadthroughTransaction(RetryingTransactionHelper.RetryingTransactionCallback<T2> callback) |
protected abstract void |
doPrepare() |
protected abstract void |
doRollBack() |
protected abstract void |
doSetRollbackOnly() |
Set<String> |
getContainerDeletions()
Get the container deletions
|
Set<String> |
getDeletions()
Get the deletions
|
protected void |
index(T ref) |
boolean |
isModified()
Has this index been modified?
|
protected boolean |
locateContainer(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(T 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, setStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createChildRelationship, createNode, deleteChildRelationship, deleteIndex, deleteNode, detectNodeChanges, flushPending, updateChildRelationship, updateNode
protected long docs
protected TransactionService transactionService
protected NodeBulkLoader bulkLoader
public static final String NOT_INDEXED_NO_TRANSFORMATION
public static final String NOT_INDEXED_TRANSFORMATION_FAILED
public static final String NOT_INDEXED_CONTENT_MISSING
public static final String NOT_INDEXED_NO_TYPE_CONVERSION
protected long maxAtomicTransformationTime
protected Set<String> deletions
protected Set<String> containerDeletions
protected List<AbstractLuceneIndexerImpl.Command<T>> commandList
protected AbstractLuceneIndexerImpl.IndexUpdateStatus indexUpdateStatus
public void setReadThrough(boolean isReadThrough)
Indexer
setReadThrough
in interface Indexer
isReadThrough
- booleanpublic void setTransactionService(TransactionService transactionService)
public void setBulkLoader(NodeBulkLoader bulkLoader)
bulkLoader
- object to provide node loading optionsprotected static Set<String> deletePrimary(Collection<String> nodeRefs, org.apache.lucene.index.IndexReader reader, boolean delete) throws LuceneIndexException
LuceneIndexException
protected static Set<String> deleteReference(Collection<String> nodeRefs, org.apache.lucene.index.IndexReader reader, boolean delete) throws LuceneIndexException
LuceneIndexException
protected static Set<String> deleteContainerAndBelow(String nodeRef, org.apache.lucene.index.IndexReader reader, boolean delete, boolean cascade) throws LuceneIndexException
LuceneIndexException
protected boolean locateContainer(String nodeRef, org.apache.lucene.index.IndexReader reader)
public void setMaxAtomicTransformationTime(long maxAtomicTransformationTime)
maxAtomicTransformationTime
- longprotected void checkAbleToDoWork(AbstractLuceneIndexerImpl.IndexUpdateStatus indexUpdateStatus)
IndexerException
LuceneIndexException
public void commit() throws LuceneIndexException
LuceneIndexException
public int prepare() throws LuceneIndexException
LuceneIndexException
public boolean isModified()
public void rollback() throws LuceneIndexException
LuceneIndexException
public void setRollbackOnly()
protected abstract void doPrepare() throws IOException
IOException
protected abstract void doCommit() throws IOException
IOException
protected abstract void doRollBack() throws IOException
IOException
protected abstract void doSetRollbackOnly() throws IOException
IOException
protected <T2> T2 doInReadthroughTransaction(RetryingTransactionHelper.RetryingTransactionCallback<T2> callback)
protected void index(T ref) throws LuceneIndexException
LuceneIndexException
protected void reindex(T ref, boolean cascadeReindexDirectories) throws LuceneIndexException
LuceneIndexException
protected void delete(T ref) throws LuceneIndexException
LuceneIndexException
Copyright © 2005–2017 Alfresco Software. All rights reserved.