- log.debug("{}: Applying current log recovery batch with size {}", shardName, size);
- try {
- commitTransaction(transaction);
- } catch (Exception e) {
- File file = new File(System.getProperty("karaf.data", "."),
- "failed-recovery-batch-" + shardName + ".out");
- DataTreeModificationOutput.toFile(file, transaction.getResultingModification());
- throw new RuntimeException(String.format(
- "%s: Failed to apply recovery batch. Modification data was written to file %s",
- shardName, file), e);
- }
- transaction = null;
+ private File writeRoot(final String kind, final NormalizedNode<?, ?> node) {
+ final File file = new File(System.getProperty("karaf.data", "."),
+ "failed-recovery-" + kind + "-" + shardName + ".xml");
+ NormalizedNodeXMLOutput.toFile(file, node);
+ return file;