Moved AVM-specific fix down into AVM-specific classes

- Could affect ALF-9458: CLONE -WCM: Lucene back job creates user sandboxes and workflow (in-flight) directories in the file system under AVM lucene-indexes directory


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28890 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2011-07-08 13:24:40 +00:00
parent 5060681197
commit f4c07c0fe9
3 changed files with 20 additions and 42 deletions

View File

@@ -657,9 +657,6 @@
</bean> </bean>
<bean id="abstractLuceneIndexerAndSearcherFactory" abstract="true"> <bean id="abstractLuceneIndexerAndSearcherFactory" abstract="true">
<property name="avmSnapShotTriggeredIndexingMethodInterceptor">
<ref bean="avmSnapShotTriggeredIndexingMethodInterceptor" />
</property>
<property name="indexRootLocation"> <property name="indexRootLocation">
<value>${dir.indexes}</value> <value>${dir.indexes}</value>
</property> </property>
@@ -890,6 +887,9 @@
<property name="threadPoolExecutor"> <property name="threadPoolExecutor">
<ref bean="indexThreadPoolExecutor"></ref> <ref bean="indexThreadPoolExecutor"></ref>
</property> </property>
<property name="avmSnapShotTriggeredIndexingMethodInterceptor">
<ref bean="avmSnapShotTriggeredIndexingMethodInterceptor" />
</property>
</bean> </bean>
<bean id="avm.luceneQueryEngineImpl" class="org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryEngine" > <bean id="avm.luceneQueryEngineImpl" class="org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryEngine" >

View File

@@ -21,13 +21,13 @@ package org.alfresco.repo.search.impl.lucene;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.alfresco.cmis.CMISQueryService;
import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.content.ContentStore; import org.alfresco.repo.content.ContentStore;
import org.alfresco.repo.search.AVMSnapShotTriggeredIndexingMethodInterceptor;
import org.alfresco.repo.search.IndexMode;
import org.alfresco.repo.search.SearcherException; import org.alfresco.repo.search.SearcherException;
import org.alfresco.repo.search.SupportsBackgroundIndexing; import org.alfresco.repo.search.SupportsBackgroundIndexing;
import org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexer; import org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexer;
import org.alfresco.repo.search.impl.querymodel.QueryEngine;
import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.avm.AVMStoreDescriptor; import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
import org.alfresco.service.cmr.avmsync.AVMSyncService; import org.alfresco.service.cmr.avmsync.AVMSyncService;
@@ -46,24 +46,16 @@ import org.alfresco.service.namespace.NamespaceService;
*/ */
public class AVMLuceneIndexerAndSearcherFactory extends AbstractLuceneIndexerAndSearcherFactory implements SupportsBackgroundIndexing public class AVMLuceneIndexerAndSearcherFactory extends AbstractLuceneIndexerAndSearcherFactory implements SupportsBackgroundIndexing
{ {
//private static Log s_logger = LogFactory.getLog(AVMLuceneIndexerAndSearcherFactory.class);
private DictionaryService dictionaryService; private DictionaryService dictionaryService;
private NamespaceService nameSpaceService; private NamespaceService nameSpaceService;
private ContentService contentService; private ContentService contentService;
private AVMService avmService; private AVMService avmService;
private AVMSyncService avmSyncService; private AVMSyncService avmSyncService;
private NodeService nodeService; private NodeService nodeService;
private ContentStore contentStore; private ContentStore contentStore;
private FullTextSearchIndexer fullTextSearchIndexer; private FullTextSearchIndexer fullTextSearchIndexer;
private AVMSnapShotTriggeredIndexingMethodInterceptor avmSnapShotTriggeredIndexingMethodInterceptor;
public AVMLuceneIndexerAndSearcherFactory() public AVMLuceneIndexerAndSearcherFactory()
{ {
//s_logger.error("Creating AVMLuceneIndexerAndSearcherFactory"); //s_logger.error("Creating AVMLuceneIndexerAndSearcherFactory");
@@ -71,7 +63,6 @@ public class AVMLuceneIndexerAndSearcherFactory extends AbstractLuceneIndexerAnd
/** /**
* Set the dictionary service * Set the dictionary service
* @param dictionaryService
*/ */
public void setDictionaryService(DictionaryService dictionaryService) public void setDictionaryService(DictionaryService dictionaryService)
{ {
@@ -80,7 +71,6 @@ public class AVMLuceneIndexerAndSearcherFactory extends AbstractLuceneIndexerAnd
/** /**
* Set the name space service * Set the name space service
* @param nameSpaceService
*/ */
public void setNameSpaceService(NamespaceService nameSpaceService) public void setNameSpaceService(NamespaceService nameSpaceService)
{ {
@@ -89,7 +79,6 @@ public class AVMLuceneIndexerAndSearcherFactory extends AbstractLuceneIndexerAnd
/** /**
* Set the content service * Set the content service
* @param contentService
*/ */
public void setContentService(ContentService contentService) public void setContentService(ContentService contentService)
{ {
@@ -98,7 +87,6 @@ public class AVMLuceneIndexerAndSearcherFactory extends AbstractLuceneIndexerAnd
/** /**
* Set the AVM service * Set the AVM service
* @param avmService
*/ */
public void setAvmService(AVMService avmService) public void setAvmService(AVMService avmService)
{ {
@@ -107,7 +95,6 @@ public class AVMLuceneIndexerAndSearcherFactory extends AbstractLuceneIndexerAnd
/** /**
* Set the AVM sync service * Set the AVM sync service
* @param avmSyncService
*/ */
public void setAvmSyncService(AVMSyncService avmSyncService) public void setAvmSyncService(AVMSyncService avmSyncService)
{ {
@@ -116,24 +103,28 @@ public class AVMLuceneIndexerAndSearcherFactory extends AbstractLuceneIndexerAnd
/** /**
* Set the node service * Set the node service
* @param nodeService
*/ */
public void setNodeService(NodeService nodeService) public void setNodeService(NodeService nodeService)
{ {
this.nodeService = nodeService; this.nodeService = nodeService;
} }
/** /**
* Set the content service * Set the content service
* @param contentStore
*/ */
public void setContentStore(ContentStore contentStore) public void setContentStore(ContentStore contentStore)
{ {
this.contentStore = contentStore; this.contentStore = contentStore;
} }
/**
* @param avmSnapShotTriggeredIndexingMethodInterceptor the avmSnapShotTriggeredIndexingMethodInterceptor to set
*/
public void setAvmSnapShotTriggeredIndexingMethodInterceptor(AVMSnapShotTriggeredIndexingMethodInterceptor avmSnapShotTriggeredIndexingMethodInterceptor)
{
this.avmSnapShotTriggeredIndexingMethodInterceptor = avmSnapShotTriggeredIndexingMethodInterceptor;
}
@Override @Override
protected LuceneIndexer createIndexer(StoreRef storeRef, String deltaId) protected LuceneIndexer createIndexer(StoreRef storeRef, String deltaId)
{ {
@@ -156,6 +147,11 @@ public class AVMLuceneIndexerAndSearcherFactory extends AbstractLuceneIndexerAnd
for(AVMStoreDescriptor storeDesc : stores) for(AVMStoreDescriptor storeDesc : stores)
{ {
StoreRef storeRef = AVMNodeConverter.ToStoreRef(storeDesc.getName()); StoreRef storeRef = AVMNodeConverter.ToStoreRef(storeDesc.getName());
if (avmSnapShotTriggeredIndexingMethodInterceptor.getIndexMode(storeRef.getIdentifier()) == IndexMode.UNINDEXED)
{
// ALF-5722 fix
continue;
}
storeRefs.add(storeRef); storeRefs.add(storeRef);
} }
return storeRefs; return storeRefs;

View File

@@ -42,8 +42,6 @@ import javax.transaction.xa.Xid;
import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.node.NodeBulkLoader; import org.alfresco.repo.node.NodeBulkLoader;
import org.alfresco.repo.search.AVMSnapShotTriggeredIndexingMethodInterceptor;
import org.alfresco.repo.search.IndexMode;
import org.alfresco.repo.search.IndexerException; import org.alfresco.repo.search.IndexerException;
import org.alfresco.repo.search.MLAnalysisMode; import org.alfresco.repo.search.MLAnalysisMode;
import org.alfresco.repo.search.QueryRegisterComponent; import org.alfresco.repo.search.QueryRegisterComponent;
@@ -90,8 +88,6 @@ public abstract class AbstractLuceneIndexerAndSearcherFactory implements LuceneI
private int indexerBatchSize; private int indexerBatchSize;
private AVMSnapShotTriggeredIndexingMethodInterceptor avmSnapShotTriggeredIndexingMethodInterceptor;
protected Map<String, LuceneQueryLanguageSPI> queryLanguages = new HashMap<String, LuceneQueryLanguageSPI>(); protected Map<String, LuceneQueryLanguageSPI> queryLanguages = new HashMap<String, LuceneQueryLanguageSPI>();
/** /**
@@ -224,14 +220,6 @@ public abstract class AbstractLuceneIndexerAndSearcherFactory implements LuceneI
} }
/**
* @param avmSnapShotTriggeredIndexingMethodInterceptor the avmSnapShotTriggeredIndexingMethodInterceptor to set
*/
public void setAvmSnapShotTriggeredIndexingMethodInterceptor(AVMSnapShotTriggeredIndexingMethodInterceptor avmSnapShotTriggeredIndexingMethodInterceptor)
{
this.avmSnapShotTriggeredIndexingMethodInterceptor = avmSnapShotTriggeredIndexingMethodInterceptor;
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@@ -1940,12 +1928,6 @@ public abstract class AbstractLuceneIndexerAndSearcherFactory implements LuceneI
{ {
StoreRef currentStore = storeRefs.get(i); StoreRef currentStore = storeRefs.get(i);
if (avmSnapShotTriggeredIndexingMethodInterceptor.getIndexMode(currentStore.getIdentifier()) == IndexMode.UNINDEXED)
{
// ALF-5722 fix
continue;
}
if (currentLockWork == null) if (currentLockWork == null)
{ {
currentLockWork = new CoreReadOnlyWork<R>(getIndexer(currentStore), lockWork); currentLockWork = new CoreReadOnlyWork<R>(getIndexer(currentStore), lockWork);