mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Changed copy on write to occur during lookup, rather than after lookup.
Much carnage, but it's way faster. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3172 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -148,47 +148,6 @@ abstract class AVMNodeImpl implements AVMNode, Serializable
|
||||
return (AVMNode)query.uniqueResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a copy on write on this node and recursively
|
||||
* up to the repository root. This is a template method
|
||||
* which farms out work to possiblyCopy().
|
||||
* @param lPath The Lookup.
|
||||
*/
|
||||
public AVMNode copyOnWrite(Lookup lPath)
|
||||
{
|
||||
// Call the subclass's copy on write logic.
|
||||
AVMNode newMe = possiblyCopy(lPath);
|
||||
// No copying needed, so short circuit.
|
||||
if (newMe == null)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
String myName = lPath.getName();
|
||||
lPath.upCurrentNode();
|
||||
Repository repos = lPath.getRepository();
|
||||
newMe.setVersionID(repos.getNextVersionID());
|
||||
// Get our parent directory if we have one.
|
||||
DirectoryNode parent = null;
|
||||
if (!getIsRoot())
|
||||
{
|
||||
parent = (DirectoryNode)lPath.getCurrentNode();
|
||||
}
|
||||
if (parent != null)
|
||||
{
|
||||
// Recursive invocation.
|
||||
DirectoryNode newParent =
|
||||
(DirectoryNode)parent.copyOnWrite(lPath);
|
||||
newParent.putChild(myName, newMe);
|
||||
}
|
||||
else // Null parent means root of repository.
|
||||
{
|
||||
repos.setNewRoot((DirectoryNode)newMe);
|
||||
}
|
||||
newMe.setRepository(repos);
|
||||
newMe.setIsNew(true);
|
||||
return newMe;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the owning repository for this.
|
||||
* @param repo The owning repository.
|
||||
|
Reference in New Issue
Block a user