mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Moved dangerous helper methods out of AVMService.
Reworked handling of path lookup failures to not throw exceptions internally, to improve performance of certain layered directory operations. Unfortunately there remains at least one scenario, handling of bulk loads, and promotions of deeply nested directories in layered contexts, in which performance is considerably less than ideal. Made AVMService.createBranch() and AVMSyncService.update() perform implicit snapshots of source tree's stores before proceeding. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3812 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,7 +25,6 @@ import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.alfresco.service.cmr.avm.AVMBadArgumentException;
|
||||
import org.alfresco.service.cmr.avm.AVMCycleException;
|
||||
import org.alfresco.service.cmr.avm.AVMException;
|
||||
import org.alfresco.service.cmr.avm.AVMExistsException;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
@@ -316,18 +315,14 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
Lookup lookup = AVMRepository.GetInstance().lookupDirectory(-1, getUnderlying(lPath));
|
||||
if (lookup != null)
|
||||
{
|
||||
Lookup lookup = AVMRepository.GetInstance().lookupDirectory(-1, getUnderlying(lPath));
|
||||
DirectoryNode dir = (DirectoryNode)lookup.getCurrentNode();
|
||||
listing = dir.getListing(lookup, includeDeleted);
|
||||
}
|
||||
catch (AVMException re)
|
||||
else
|
||||
{
|
||||
if (re instanceof AVMCycleException)
|
||||
{
|
||||
throw re;
|
||||
}
|
||||
// It's OK for an indirection to dangle.
|
||||
listing = new HashMap<String, AVMNode>();
|
||||
}
|
||||
@@ -406,9 +401,9 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
// If we are not opaque, get the underlying base listing.
|
||||
if (!fOpacity)
|
||||
{
|
||||
try
|
||||
Lookup lookup = AVMRepository.GetInstance().lookupDirectory(-1, dir.getIndirection());
|
||||
if (lookup != null)
|
||||
{
|
||||
Lookup lookup = AVMRepository.GetInstance().lookupDirectory(-1, dir.getIndirection());
|
||||
DirectoryNode dirNode = (DirectoryNode)lookup.getCurrentNode();
|
||||
Map<String, AVMNode> listing = dirNode.getListing(lookup, includeDeleted);
|
||||
for (String name : listing.keySet())
|
||||
@@ -418,13 +413,6 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
lookup.getCurrentIndirection()));
|
||||
}
|
||||
}
|
||||
catch (AVMException e)
|
||||
{
|
||||
if (e instanceof AVMCycleException)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
List<ChildEntry> children = AVMContext.fgInstance.fChildEntryDAO.getByParent(this);
|
||||
for (ChildEntry child : children)
|
||||
@@ -489,20 +477,16 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
return null;
|
||||
}
|
||||
// Not here so check our indirection.
|
||||
try
|
||||
Lookup lookup = AVMRepository.GetInstance().lookupDirectory(-1, getUnderlying(lPath));
|
||||
if (lookup != null)
|
||||
{
|
||||
Lookup lookup = AVMRepository.GetInstance().lookupDirectory(-1, getUnderlying(lPath));
|
||||
DirectoryNode dir = (DirectoryNode)lookup.getCurrentNode();
|
||||
AVMNode retVal = dir.lookupChild(lookup, name, -1, false, includeDeleted);
|
||||
lPath.setFinalStore(lookup.getFinalStore());
|
||||
return retVal;
|
||||
}
|
||||
catch (AVMException re)
|
||||
else
|
||||
{
|
||||
if (re instanceof AVMCycleException)
|
||||
{
|
||||
throw re;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -535,9 +519,9 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
{
|
||||
return null;
|
||||
}
|
||||
try
|
||||
Lookup lookup = AVMRepository.GetInstance().lookupDirectory(-1, mine.getIndirection());
|
||||
if (lookup != null)
|
||||
{
|
||||
Lookup lookup = AVMRepository.GetInstance().lookupDirectory(-1, mine.getIndirection());
|
||||
DirectoryNode dir = (DirectoryNode)lookup.getCurrentNode();
|
||||
AVMNode child = dir.lookupChild(lookup, name, -1, false, includeDeleted);
|
||||
if (child == null)
|
||||
@@ -546,12 +530,8 @@ class LayeredDirectoryNodeImpl extends DirectoryNodeImpl implements LayeredDirec
|
||||
}
|
||||
return child.getDescriptor(lookup);
|
||||
}
|
||||
catch (AVMException e)
|
||||
else
|
||||
{
|
||||
if (e instanceof AVMCycleException)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user