- TransactionContextWrapper contextAdapter = getContextAdapter(path);
- contextAdapter.maybeExecuteTransactionOperation(new TransactionOperation() {
- @Override
- public void invoke(TransactionContext transactionContext) {
- transactionContext.writeData(path, data);
- }
- });
+ // Now distribute children as needed
+ for (DataContainerChild child : rootData.body()) {
+ final String shardName = shardNameFromRootChild(child);
+ verifyNotNull(rootBuilders.get(shardName), "Failed to find builder for %s", shardName).addChild(child);
+ }
+
+ // Now dispatch all writes
+ for (Entry<String, DataContainerNodeBuilder<NodeIdentifier, ContainerNode>> entry : rootBuilders.entrySet()) {
+ getContextWrapper(entry.getKey()).maybeExecuteTransactionOperation(new WriteOperation(
+ YangInstanceIdentifier.empty(), entry.getValue().build()));
+ }
+ }
+
+ private void executeModification(final TransactionModificationOperation operation) {
+ getContextWrapper(operation.path()).maybeExecuteTransactionOperation(operation);