mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-29 04:57:48 +01:00
some fixes
This commit is contained in:
@@ -171,7 +171,8 @@ public class KleppmannTree<TimestampT extends Comparable<TimestampT>, PeerIdT ex
|
||||
var node = _storage.getById(n);
|
||||
node.rwLock();
|
||||
try {
|
||||
trash.getNode().getChildren().remove(node.getNode().getMeta().getName());
|
||||
if (trash.getNode().getChildren().remove(n.toString()) == null)
|
||||
LOGGER.severe("Node " + node.getNode().getId() + " not found in trash but should be there");
|
||||
node.notifyRmRef(trash.getNode().getId());
|
||||
} finally {
|
||||
node.rwUnlock();
|
||||
@@ -369,6 +370,9 @@ public class KleppmannTree<TimestampT extends Comparable<TimestampT>, PeerIdT ex
|
||||
}
|
||||
|
||||
newParentNode.getNode().getChildren().put(effect.newMeta().getName(), effect.childId());
|
||||
if (effect.newParentId().equals(_storage.getTrashId()) &&
|
||||
!Objects.equals(effect.newMeta().getName(), effect.childId()))
|
||||
throw new IllegalArgumentException("Move to trash should have id of node as name");
|
||||
node.getNode().setParent(effect.newParentId());
|
||||
node.getNode().setMeta(effect.newMeta());
|
||||
node.getNode().setLastEffectiveOp(effect.effectiveOp());
|
||||
|
||||
@@ -60,7 +60,7 @@ public class JKleppmannTree implements OpObject {
|
||||
}
|
||||
|
||||
public void trash(JKleppmannTreeNodeMeta newMeta, String node) {
|
||||
_tree.move(_storageInterface.getTrashId(), newMeta, node);
|
||||
_tree.move(_storageInterface.getTrashId(), newMeta.withName(node), node);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user