@Override public Object perform(InvocationContext ctx) { NodeSPI targetNode = peekVersioned(ctx); if (targetNode != null) { Map data = targetNode.getDataDirect(); if (data != null && !data.isEmpty()) originalData = new HashMap(data); } boolean found = (Boolean) super.perform(ctx); // now record rollback info. if (globalTransaction != null && found) { NodeSPI parentNode = targetNode.getParentDirect(); prepareForRollback(parentNode); } return found; }
private void validateNodeAndParents(NodeSPI node) { node.setValid(true, false); if (!node.getFqn().isRoot()) validateNodeAndParents(node.getParentDirect()); }
private void removeNodeLegacy(Fqn fqn) { NodeSPI targetNode = peek(fqn, false, true); if (targetNode == null) return; NodeSPI parentNode = targetNode.getParentDirect(); targetNode.setValid(false, false); if (parentNode != null) { parentNode.removeChildDirect(fqn.getLastElement()); parentNode.setChildrenLoaded(false); } }
public boolean removeChild(Fqn f) { if (f.size() == 1) { return removeChild(f.getLastElement()); } else { NodeSPI<K, V> child = getChildDirect(f); return child != null && child.getParentDirect().removeChildDirect(f.getLastElement()); } }
private void migrateDefunctData(NodeSPI backupRoot, Address dataOwner) { Fqn defunctBackupRootFqn = getDefunctBackupRootFqn(dataOwner); if (log.isDebugEnabled()) log.debug("Migrating defunct data. Backup root is " + backupRoot + ". New backup root is " + defunctBackupRootFqn); if (trace) log.trace("Children of backup root are " + backupRoot.getChildren()); String ownerName = buddyFqnTransformer.getGroupNameFromAddress(dataOwner); Set<DefunctDataHistory> newHistorySet = new ConcurrentHashSet<DefunctDataHistory>(); Set<DefunctDataHistory> historySet = defunctDataHistory.putIfAbsent(ownerName, newHistorySet); if (historySet == null) { historySet = newHistorySet; } DefunctDataHistory history = new DefunctDataHistory(dataOwner, (Integer) defunctBackupRootFqn.getLastElement(), System.currentTimeMillis()); historySet.add(history); for (Object child : backupRoot.getChildren()) { Fqn childFqn = ((Node) child).getFqn(); cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true); cache.move(childFqn, defunctBackupRootFqn); } history.recordDataMoved(); cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true); backupRoot.getParentDirect().removeChild(backupRoot.getFqn().getLastElement()); }
parent = subtreeRoot.getParentDirect(); if (parent != null) parentLocked = lockManager.lockAll(parent, WRITE, getOwnerForLock(), stateFetchTimeout);
for (NodeSPI node = n; node != null && node.isCreated(); node = node.getParentDirect())
NodeSPI parent = underlyingNode.getParentDirect(); if (parent == null)
NodeSPI oldParent = node.getParentDirect(); Object nodeName = toMoveFqn.getLastElement();