From b50a208a5984c91e2ebb20e002f2d2c4e1c0cbc3 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Tue, 4 Oct 2011 12:40:53 +0000 Subject: [PATCH] Tweaks to patch performance. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30950 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../patch/impl/AVMToADMRemoteStorePatch.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/source/java/org/alfresco/repo/admin/patch/impl/AVMToADMRemoteStorePatch.java b/source/java/org/alfresco/repo/admin/patch/impl/AVMToADMRemoteStorePatch.java index 8316091183..fce1599504 100644 --- a/source/java/org/alfresco/repo/admin/patch/impl/AVMToADMRemoteStorePatch.java +++ b/source/java/org/alfresco/repo/admin/patch/impl/AVMToADMRemoteStorePatch.java @@ -90,10 +90,10 @@ public class AVMToADMRemoteStorePatch extends AbstractPatch // name of the surf config folder private static final String SURF_CONFIG = "surf-config"; - private static final int SITE_BATCH_THREADS = 8; - private static final int SITE_BATCH_SIZE = 100; - private static final int MIGRATE_BATCH_THREADS = 8; - private static final int MIGRATE_BATCH_SIZE = 100; + private static final int SITE_BATCH_THREADS = 4; + private static final int SITE_BATCH_SIZE = 250; + private static final int MIGRATE_BATCH_THREADS = 4; + private static final int MIGRATE_BATCH_SIZE = 250; private Map siteReferenceCache = null; private SortedMap paths; @@ -205,7 +205,7 @@ public class AVMToADMRemoteStorePatch extends AbstractPatch surfConfigRef = getSurfConfigNodeRef(siteService.getSiteRoot()); // pre-create folders that may cause contention later during multi-threaded batch processing - List folderPath = new ArrayList(); + List folderPath = new ArrayList(4); folderPath.add("components"); FileFolderUtil.makeFolders(fileFolderService, surfConfigRef, folderPath, ContentModel.TYPE_FOLDER); folderPath.clear(); @@ -291,12 +291,14 @@ public class AVMToADMRemoteStorePatch extends AbstractPatch @Override public void beforeProcess() throws Throwable { + ruleService.disableRules(); AuthenticationUtil.setRunAsUser(tenantSystemUser); } @Override public void afterProcess() throws Throwable { + ruleService.enableRules(); AuthenticationUtil.clearCurrentSecurityContext(); } @@ -315,8 +317,16 @@ public class AVMToADMRemoteStorePatch extends AbstractPatch { // create the 'surf-config' folder for the site and cache the NodeRef to it NodeRef surfConfigRef = getSurfConfigNodeRef(siteRef); - // TODO: create components and pages folders here would also reduce contention siteReferenceCache.put(siteName, surfConfigRef); + + // pre-create folders that may cause contention later during multi-threaded batch processing + List folderPath = new ArrayList(4); + folderPath.add("components"); + FileFolderUtil.makeFolders(fileFolderService, surfConfigRef, folderPath, ContentModel.TYPE_FOLDER); + folderPath.clear(); + folderPath.add("pages"); + folderPath.add("site"); + FileFolderUtil.makeFolders(fileFolderService, surfConfigRef, folderPath, ContentModel.TYPE_FOLDER); } else {