- final ReadWriteShardDataTreeTransaction transaction = store.newReadWriteTransaction(
- new TransactionIdentifier(applyHistoryId, applyCounter++));
-
- // delete everything first
- transaction.getSnapshot().delete(YangInstanceIdentifier.EMPTY);
-
- final Optional<NormalizedNode<?, ?>> maybeNode = snapshot.getRootNode();
- if (maybeNode.isPresent()) {
- // Add everything from the remote node back
- transaction.getSnapshot().write(YangInstanceIdentifier.EMPTY, maybeNode.get());
- }
-
- store.applyRecoveryTransaction(transaction);