diff --git a/config/alfresco/core-services-context.xml b/config/alfresco/core-services-context.xml index 79aa40b487..0776ff557b 100644 --- a/config/alfresco/core-services-context.xml +++ b/config/alfresco/core-services-context.xml @@ -585,29 +585,12 @@ - - - - - - - - - - - - - - + ${dir.indexes} - - - - - + + ${dir.indexes.lock} ${lucene.maxAtomicTransformationTime} @@ -618,8 +601,76 @@ ${lucene.indexer.batchSize} - - ${dir.indexes.lock} + + + ${lucene.indexer.cacheEnabled} + + + ${lucene.indexer.maxDocIdCacheSize} + + + ${lucene.indexer.maxDocumentCacheSize} + + + ${lucene.indexer.maxIsCategoryCacheSize} + + + ${lucene.indexer.maxLinkAspectCacheSize} + + + ${lucene.indexer.maxParentCacheSize} + + + ${lucene.indexer.maxPathCacheSize} + + + ${lucene.indexer.maxTypeCacheSize} + + + + ${lucene.indexer.mergerMaxMergeDocs} + + + ${lucene.indexer.mergerMergeFactor} + + + ${lucene.indexer.mergerMinMergeDocs} + + + + ${lucene.indexer.writerMaxMergeDocs} + + + ${lucene.indexer.writerMergeFactor} + + + ${lucene.indexer.writerMinMergeDocs} + + + + ${lucene.indexer.mergerTargetIndexCount} + + + ${lucene.indexer.mergerTargetOverlayCount} + + + ${lucene.indexer.maxDocsForInMemoryMerge} + + + + ${lucene.indexer.termIndexInterval} + + + ${lucene.indexer.useNioMemoryMapping} + + + ${lucene.indexer.postSortDateTime} + + + ${lucene.indexer.defaultMLIndexAnalysisMode} + + + ${lucene.indexer.defaultMLSearchAnalysisMode} ${lucene.indexer.maxFieldLength} @@ -633,11 +684,29 @@ ${lucene.lock.poll.interval} - - EXACT_LANGUAGE_AND_ALL + + + + + + - - EXACT_LANGUAGE_AND_ALL + + + + + + + + + + + + + + @@ -645,10 +714,6 @@ - - - true - @@ -671,6 +736,7 @@ @@ -684,45 +750,12 @@ - - ${dir.indexes} - - - ${lucene.maxAtomicTransformationTime} - - - ${lucene.query.maxClauses} - - - ${lucene.indexer.batchSize} - - - ${dir.indexes.lock} - - - ${lucene.indexer.maxFieldLength} - - - ${lucene.write.lock.timeout} - - - ${lucene.commit.lock.timeout} - - - ${lucene.lock.poll.interval} - - - EXACT_LANGUAGE_AND_ALL - - - EXACT_LANGUAGE_AND_ALL - @@ -730,6 +763,7 @@ @@ -743,9 +777,6 @@ - - ${dir.indexes} - @@ -761,43 +792,9 @@ - - ${lucene.maxAtomicTransformationTime} - - - ${lucene.query.maxClauses} - - - ${lucene.indexer.batchSize} - - - ${dir.indexes.lock} - - - ${lucene.indexer.maxFieldLength} - - - ${lucene.write.lock.timeout} - - - ${lucene.commit.lock.timeout} - - - ${lucene.lock.poll.interval} - - - EXACT_LANGUAGE_AND_ALL - - - EXACT_LANGUAGE_AND_ALL - - - - true - diff --git a/config/alfresco/messages/patch-service.properties b/config/alfresco/messages/patch-service.properties index a478b89547..ca512a6f2d 100644 --- a/config/alfresco/messages/patch-service.properties +++ b/config/alfresco/messages/patch-service.properties @@ -275,6 +275,8 @@ patch.authorityMigration.result=Migrated {0} groups and {1} group associations t patch.authorityDefaultZonesPatch.description=Adds groups and people to the appropriate zones for wcm, share and everything else. patch.authorityDefaultZonesPatch.result=Unzoned groups and people added to the default zones. +patch.authorityDefaultZonesPatch.users= Adding users to zones ... +patch.authorityDefaultZonesPatch.groups= Adding groups to zones ... patch.fixNameCrcValues.description=Fixes name CRC32 values to match UTF-8 encoding. patch.fixNameCrcValues.result=Fixed {0} name CRC32 values for UTF-8 encoding. See file {1} for details. diff --git a/config/alfresco/model/contentModel.xml b/config/alfresco/model/contentModel.xml index 670d0ce538..de9a2c17b0 100644 --- a/config/alfresco/model/contentModel.xml +++ b/config/alfresco/model/contentModel.xml @@ -80,7 +80,9 @@ d:content false - + + + true false diff --git a/config/alfresco/repository.properties b/config/alfresco/repository.properties index d1c130fb4a..910d8fa4cf 100644 --- a/config/alfresco/repository.properties +++ b/config/alfresco/repository.properties @@ -157,22 +157,52 @@ lucene.query.maxClauses=10000 # lucene.indexer.batchSize=1000000 # -# Lucene index min merge docs - the in memory size of the index +# Index cache sizes # -lucene.indexer.minMergeDocs=1000 +lucene.indexer.cacheEnabled=true +lucene.indexer.maxDocIdCacheSize=10000 +lucene.indexer.maxDocumentCacheSize=100 +lucene.indexer.maxIsCategoryCacheSize=-1 +lucene.indexer.maxLinkAspectCacheSize=10000 +lucene.indexer.maxParentCacheSize=10000 +lucene.indexer.maxPathCacheSize=10000 +lucene.indexer.maxTypeCacheSize=10000 # -# When lucene index files are merged together - it will try to keep this number of segments/files in +# Properties for merge (not this does not affect the final index segment which will be optimised) +# Max merge docs only applies to the merge process not the resulting index which will be optimised. # -lucene.indexer.mergeFactor=10 +lucene.indexer.mergerMaxMergeDocs=1000000 +lucene.indexer.mergerMergeFactor=5 +lucene.indexer.mergerMinMergeDocs=1000 # -# Roughly the maximum number of nodes indexed in one file/segment +# Properties for delta indexes (not this does not affect the final index segment which will be optimised) +# Max merge docs only applies to the index building process not the resulting index which will be optimised. # -lucene.indexer.maxMergeDocs=100000 +lucene.indexer.writerMaxMergeDocs=1000000 +lucene.indexer.writerMergeFactor=5 +lucene.indexer.writerMinMergeDocs=1000 +# +# Target number of indexes and deltas in the overall index and what index size to merge in memory +# +lucene.indexer.mergerTargetIndexCount=5 +lucene.indexer.mergerTargetOverlayCount=5 +lucene.indexer.maxDocsForInMemoryMerge=10000 +# +# Other lucene properties +# +lucene.indexer.termIndexInterval=128 +lucene.indexer.useNioMemoryMapping=true +# over-ride to false for pre 3.0 behaviour +lucene.indexer.postSortDateTime=true +lucene.indexer.defaultMLIndexAnalysisMode=EXACT_LANGUAGE_AND_ALL +lucene.indexer.defaultMLSearchAnalysisMode=EXACT_LANGUAGE_AND_ALL # # The number of terms from a document that will be indexed # lucene.indexer.maxFieldLength=10000 - +# +# Index locks (mostly deprecated and will be tidied up with the next lucene upgrade) +# lucene.write.lock.timeout=10000 lucene.commit.lock.timeout=100000 lucene.lock.poll.interval=100 diff --git a/source/java/org/alfresco/repo/admin/patch/impl/AuthorityDefaultZonesPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/AuthorityDefaultZonesPatch.java index 303adf6f2a..2ff9fb427b 100644 --- a/source/java/org/alfresco/repo/admin/patch/impl/AuthorityDefaultZonesPatch.java +++ b/source/java/org/alfresco/repo/admin/patch/impl/AuthorityDefaultZonesPatch.java @@ -29,7 +29,9 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import org.alfresco.i18n.I18NUtil; import org.alfresco.repo.admin.patch.AbstractPatch; +import org.alfresco.repo.admin.patch.PatchExecuter; import org.alfresco.repo.domain.hibernate.HibernateSessionHelper; import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.avm.AVMStoreDescriptor; @@ -37,6 +39,8 @@ import org.alfresco.service.cmr.security.AuthorityService; import org.alfresco.service.cmr.security.AuthorityType; import org.alfresco.service.cmr.site.SiteInfo; import org.alfresco.service.cmr.site.SiteService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * Patch to assign users and groups to default zones @@ -47,6 +51,9 @@ public class AuthorityDefaultZonesPatch extends AbstractPatch { /** Success message. */ private static final String MSG_SUCCESS = "patch.authorityDefaultZonesPatch.result"; + private static final String MSG_UPDATE_USERS = "patch.authorityDefaultZonesPatch.users"; + private static final String MSG_UPDATE_GROUPS = "patch.authorityDefaultZonesPatch.groups"; + private static Log progress_logger = LogFactory.getLog(PatchExecuter.class); /** The authority service. */ private AuthorityService authorityService; @@ -97,14 +104,21 @@ public class AuthorityDefaultZonesPatch extends AbstractPatch @Override protected String applyInternal() throws Exception { - setZonesForPeople(); - setZonesForGroups(); + int count = 0; + int total = authorityService.getAllAuthorities(AuthorityType.USER).size() + authorityService.getAllAuthorities(AuthorityType.GROUP).size(); + reportProgress(total, count); + String msg = I18NUtil.getMessage(MSG_UPDATE_USERS); + progress_logger.info(msg); + count = setZonesForPeople(total, count); + msg = I18NUtil.getMessage(MSG_UPDATE_GROUPS); + progress_logger.info(msg); + setZonesForGroups(total, count); return MSG_SUCCESS; } - private void setZonesForPeople() + private int setZonesForPeople(int total, int start) { Set defaultZones = new HashSet(2, 1.0f); defaultZones.add(AuthorityService.ZONE_APP_DEFAULT); @@ -113,11 +127,11 @@ public class AuthorityDefaultZonesPatch extends AbstractPatch List personActions = new ArrayList(1); personActions.add(new Action(null, defaultZones, ActionType.SET)); - setZones(AuthorityType.USER, personActions); + return setZones(AuthorityType.USER, personActions, total, start); } - private void setZonesForGroups() + private int setZonesForGroups(int total, int start) { Set defaultZones = new HashSet(2, 1.0f); defaultZones.add(AuthorityService.ZONE_APP_DEFAULT); @@ -152,13 +166,13 @@ public class AuthorityDefaultZonesPatch extends AbstractPatch } groupActions.add(new Action(null, defaultZones, ActionType.SET)); - setZones(AuthorityType.GROUP, groupActions); + return setZones(AuthorityType.GROUP, groupActions, total, start); } - private void setZones(AuthorityType authorityType, List actions) + private int setZones(AuthorityType authorityType, List actions, int total, int start) { - + int count = start; hibernateSessionHelper.mark(); Set authorities = authorityService.getAllAuthorities(authorityType); hibernateSessionHelper.reset(); @@ -181,7 +195,10 @@ public class AuthorityDefaultZonesPatch extends AbstractPatch } } hibernateSessionHelper.reset(); + count++; + reportProgress(total, count); } + return count; }