- ReadWriteShardDataTreeTransaction transaction = store.newReadWriteTransaction("snapshot-" + logId, null);
-
- NormalizedNode<?, ?> node = SerializationUtils.deserializeNormalizedNode(snapshotBytes);
-
- // delete everything first
- transaction.getSnapshot().delete(DATASTORE_ROOT);
-
- // Add everything from the remote node back
- transaction.getSnapshot().write(DATASTORE_ROOT, node);
- syncCommitTransaction(transaction);
- } catch (InterruptedException | ExecutionException e) {
- log.error("{}: An exception occurred when applying snapshot", logId, e);
- } finally {
- log.info("{}: Done applying snapshot", logId);
+ snapshot = ShardDataTreeSnapshot.deserialize(snapshotBytes);
+ } catch (IOException e) {
+ log.error("{}: Failed to deserialize snapshot", logId, e);
+ return;