+ final NormalizedNode<?, ?> node = SerializationUtils.deserializeNormalizedNode(snapshotBytes);
+ final PruningDataTreeModification tx = new PruningDataTreeModification(store.newModification(),
+ store.getDataTree(), schemaContext);
+ tx.write(YangInstanceIdentifier.EMPTY, node);
+ try {
+ commitTransaction(tx);
+ } catch (Exception e) {
+ File file = new File(System.getProperty("karaf.data", "."),
+ "failed-recovery-snapshot-" + shardName + ".xml");
+ NormalizedNodeXMLOutput.toFile(file, node);
+ throw new RuntimeException(String.format(
+ "%s: Failed to apply recovery snapshot. Node data was written to file %s",
+ shardName, file), e);
+ }
+ }