Fix AR-499: Indexing of content pushed to the background for slow (>50ms) transformations.

- Made delay configurable


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3062 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-06-08 13:26:23 +00:00
parent 6fad540064
commit ea441e8f27
4 changed files with 24 additions and 7 deletions

View File

@@ -135,6 +135,9 @@ public class LuceneIndexerAndSearcherFactory implements LuceneIndexerAndSearcher
private QueryRegisterComponent queryRegister;
/** the maximum transformation time to allow atomically, defaulting to 20ms */
private long maxAtomicTransformationTime = 20;
private int indexerMaxFieldLength;
/**
@@ -187,6 +190,18 @@ public class LuceneIndexerAndSearcherFactory implements LuceneIndexerAndSearcher
this.queryRegister = queryRegister;
}
/**
* Set the maximum average transformation time allowed to a transformer in order to have
* the transformation performed in the current transaction. The default is 20ms.
*
* @param maxAtomicTransformationTime the maximum average time that a text transformation may
* take in order to be performed atomically.
*/
public void setMaxAtomicTransformationTime(long maxAtomicTransformationTime)
{
this.maxAtomicTransformationTime = maxAtomicTransformationTime;
}
/**
* Check if we are in a global transactoin according to the transaction
* manager
@@ -345,6 +360,7 @@ public class LuceneIndexerAndSearcherFactory implements LuceneIndexerAndSearcher
indexer.setLuceneIndexLock(luceneIndexLock);
indexer.setLuceneFullTextSearchIndexer(luceneFullTextSearchIndexer);
indexer.setContentService(contentService);
indexer.setMaxAtomicTransformationTime(maxAtomicTransformationTime);
return indexer;
}

View File

@@ -199,13 +199,6 @@ public class LuceneIndexerImpl extends LuceneBase implements LuceneIndexer
this.contentService = contentService;
}
/**
* Set the maximum average transformation time allowed to a transformer in order to have
* the transformation performed in the current transaction. The default is 20ms.
*
* @param maxAtomicTransformationTime the maximum average time that a text transformation may
* take in order to be performed atomically.
*/
public void setMaxAtomicTransformationTime(long maxAtomicTransformationTime)
{
this.maxAtomicTransformationTime = maxAtomicTransformationTime;