Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

93084: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud)
      93040: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.1)
         92868: Merged DEV (4.2.5) to V4.2-BUG-FIX (4.2.5)
            92789: MNT-12832: Excessive startup time when using MySQL when many nodes found at first level in Stores and using Lucene search engine.
            FIxed IndexConfigurationCheckerImpl to use count of child assocs.
      93050: MNT-12832: Excessive startup time when using MySQL when many nodes found at first level in Stores and using Lucene search engine.
          - Added PROTOCOL_AVM constant to resolve compilation error in 5.0.N (build #34)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94934 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 12:10:16 +00:00
parent 9d0a74cbc0
commit 66f799f3c6

View File

@@ -101,8 +101,45 @@ public class IndexConfigurationCheckerImpl implements IndexConfigurationChecker
// Are we creating the store - in which case we do not check
// See MNT-11612
List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(rootNodeRef, RegexQNamePattern.MATCH_ALL, RegexQNamePattern.MATCH_ALL, 1, false);
if(childAssocs.size() == 0)
int countChildAssoc = 0;
if (storeRef.getProtocol().equals(StoreRef.PROTOCOL_AVM))
{
// AVM does not support nodeService.countChildAssocs()
long start = 0;
if (logger.isDebugEnabled())
{
logger.debug("Counting childAssocs for store: " + storeRef);
start = System.currentTimeMillis();
}
List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(rootNodeRef,
RegexQNamePattern.MATCH_ALL, RegexQNamePattern.MATCH_ALL, 1, false);
countChildAssoc = childAssocs.size();
if (logger.isDebugEnabled())
{
logger.debug("Time for counting childAssocs for : " + storeRef + " time="
+ (System.currentTimeMillis() - start));
}
}
else
{
long start = 0;
if (logger.isDebugEnabled())
{
logger.debug("Counting childAssocs for store: " + storeRef);
start = System.currentTimeMillis();
}
countChildAssoc = nodeService.countChildAssocs(rootNodeRef, true);
if (logger.isDebugEnabled())
{
logger.debug("Time for counting childAssocs for : " + storeRef + " time="
+ (System.currentTimeMillis() - start));
}
}
if (logger.isDebugEnabled())
{
logger.debug("Counting childAssocs for store: " + storeRef + " countChildAssoc = " + countChildAssoc);
}
if (countChildAssoc == 0)
{
continue;
}