import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
-import com.google.common.collect.Iterables;
import java.util.Collection;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
public void merge(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) {
checkSealed();
checkIdentifierReferencesData(path, data);
- resolveModificationFor(path).merge(data);
+ resolveModificationFor(path).merge(data, version);
}
@Override
* the requested path which has been modified. If no such node exists,
* we use the node itself.
*/
- final Entry<YangInstanceIdentifier, ModifiedNode> entry = StoreTreeNodes.findClosestsOrFirstMatch(rootNode, path, ModifiedNode.IS_TERMINAL_PREDICATE);
+ final Entry<YangInstanceIdentifier, ModifiedNode> entry = StoreTreeNodes.findClosestsOrFirstMatch(rootNode,
+ path, ModifiedNode.IS_TERMINAL_PREDICATE);
final YangInstanceIdentifier key = entry.getKey();
final ModifiedNode mod = entry.getValue();
}
try {
- return resolveModificationStrategy(path).apply(modification, modification.getOriginal(),
- version);
+ return resolveModificationStrategy(path).apply(modification, modification.getOriginal(), version);
} catch (final Exception e) {
LOG.error("Could not create snapshot for {}:{}", path, modification, e);
throw e;
final Optional<ModificationApplyOperation> potential = operation.getChild(pathArg);
if (!potential.isPresent()) {
throw new SchemaValidationFailedException(String.format("Child %s is not present in schema tree.",
- Iterables.toString(Iterables.limit(path.getPathArguments(), i))));
+ path.getAncestor(i)));
}
operation = potential.get();
++i;
- modification = modification.modifyChild(pathArg, operation.getChildPolicy());
+ modification = modification.modifyChild(pathArg, operation, version);
}
return OperationWithModification.from(operation, modification);
return openCursor(new InMemoryDataTreeModificationCursor(this, path, op));
}
+ @Override
public void ready() {
final boolean wasRunning = SEALED_UPDATER.compareAndSet(this, 0, 1);
Preconditions.checkState(wasRunning, "Attempted to seal an already-sealed Data Tree.");
AbstractReadyIterator current = AbstractReadyIterator.create(rootNode, strategyTree);
do {
- current = current.process();
+ current = current.process(version);
} while (current != null);
}
}