-import org.opendaylight.controller.cluster.datastore.messages.DatastoreSnapshot;
-import org.opendaylight.controller.cluster.datastore.messages.DatastoreSnapshotList;
+import org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshot;
+import org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshotList;
private static final Logger LOG = LoggerFactory.getLogger(DatastoreSnapshotRestore.class);
private static AtomicReference<DatastoreSnapshotRestore> instance = new AtomicReference<>();
private static final Logger LOG = LoggerFactory.getLogger(DatastoreSnapshotRestore.class);
private static AtomicReference<DatastoreSnapshotRestore> instance = new AtomicReference<>();
private final String restoreDirectoryPath;
private final Map<String, DatastoreSnapshot> datastoreSnapshots = new ConcurrentHashMap<>();
private final String restoreDirectoryPath;
private final Map<String, DatastoreSnapshot> datastoreSnapshots = new ConcurrentHashMap<>();
for (DatastoreSnapshot snapshot: snapshots) {
datastoreSnapshots.put(snapshot.getType(), snapshot);
}
for (DatastoreSnapshot snapshot: snapshots) {
datastoreSnapshots.put(snapshot.getType(), snapshot);
}
LOG.error("Error reading clustered datastore restore file {}", restoreFile, e);
} finally {
if (!restoreFile.delete()) {
LOG.error("Error reading clustered datastore restore file {}", restoreFile, e);
} finally {
if (!restoreFile.delete()) {
throws IOException, ClassNotFoundException {
try (ObjectInputStream ois = new ObjectInputStream(inputStream)) {
return (DatastoreSnapshotList) ois.readObject();
}
}
throws IOException, ClassNotFoundException {
try (ObjectInputStream ois = new ObjectInputStream(inputStream)) {
return (DatastoreSnapshotList) ois.readObject();
}
}