Integrate MRI projects for Neon
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 6 Aug 2018 13:27:49 +0000 (15:27 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 24 Oct 2018 16:34:41 +0000 (16:34 +0000)
This patch bumps:
- odlparent to 4.0.2
- yangtools to 2.1.2
- mdsal to 3.0.1

It also deals with:
- DOMRpcError.getErrors() changing
- java.util.Optional being used in MD-SAL
- xmlunit upgrade via xmlunit-legacy
- any(Class) not matching nulls
- lists disappearing and hence requiring at least one item
- remove explicit <null/> in blueprints, as that breaks blueprint-core
- adjust sal-binding-it to include byte-buddy, which is a mockito dependency
- adjust dependencies to account for ietf-{inet,yang}-types movement
- moving to tech.pantheon.triemap
- mdsal.common.api removals

JIRA: CONTROLLER-1860
Change-Id: I31b2d011015846537a99f963ded1d38e7b29d71e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
java/org/opendaylight/controller/cluster/persistence/LocalSnapshotStore.java

index e1589ffb899a955be8fdcf26fa70565b249a8ab8..1ceba1cd1320e9790e99f44a046e0522d592c319 100644 (file)
@@ -15,6 +15,7 @@ import akka.persistence.SnapshotSelectionCriteria;
 import akka.persistence.serialization.Snapshot;
 import akka.persistence.serialization.SnapshotSerializer;
 import akka.persistence.snapshot.japi.SnapshotStore;
+import akka.serialization.JavaSerializer;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.io.ByteStreams;
 import com.typesafe.config.Config;
@@ -39,6 +40,7 @@ import java.util.Collections;
 import java.util.Deque;
 import java.util.List;
 import java.util.Optional;
+import java.util.concurrent.Callable;
 import java.util.stream.Collector;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -133,15 +135,17 @@ public class LocalSnapshotStore extends SnapshotStore {
     }
 
     private Object deserialize(final File file) throws IOException {
-        try (ObjectInputStream in = new ObjectInputStream(new FileInputStream(file))) {
-            return in.readObject();
-        } catch (ClassNotFoundException e) {
-            throw new IOException("Error loading snapshot file " + file, e);
-        } catch (IOException e) {
-            LOG.debug("Error loading snapshot file {}", file, e);
-
-            return tryDeserializeAkkaSnapshot(file);
-        }
+        return JavaSerializer.currentSystem().withValue((ExtendedActorSystem) context().system(),
+            (Callable<Object>) () -> {
+                try (ObjectInputStream in = new ObjectInputStream(new FileInputStream(file))) {
+                    return in.readObject();
+                } catch (ClassNotFoundException e) {
+                    throw new IOException("Error loading snapshot file " + file, e);
+                } catch (IOException e) {
+                    LOG.debug("Error loading snapshot file {}", file, e);
+                    return tryDeserializeAkkaSnapshot(file);
+                }
+            });
     }
 
     private Object tryDeserializeAkkaSnapshot(final File file) throws IOException {