Split DistributedShardRegistration into its own file 44/85144/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 16 Oct 2019 10:32:42 +0000 (12:32 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 16 Oct 2019 10:39:18 +0000 (12:39 +0200)
This interface is holding us back at Java 10 due to ARIES-1923,
as blueprint fails to process DistributedShardFactory. As this
interface really is private, factor DistributedShardRegistration
into its own file and move to Java 11.

Change-Id: Idea1c31b7e82a9df5cef34da8e2bd95bb51d4f00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/pom.xml
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardFactory.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardRegistration.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTreeRemotingTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTreeTest.java
opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/PrefixShardHandler.java

index a53d591..045083f 100644 (file)
   <version>1.11.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
-  <properties>
-    <!-- FIXME: Workaround for https://issues.apache.org/jira/browse/ARIES-1923 -->
-    <maven.compiler.release>10</maven.compiler.release>
-  </properties>
-
   <dependencies>
     <!-- Java -->
     <dependency>
index f1cdcd8..fba71ab 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.controller.cluster.sharding;
 
 import com.google.common.annotations.Beta;
@@ -22,7 +21,6 @@ import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException;
  */
 @Beta
 public interface DistributedShardFactory {
-
     /**
      * Register a new shard that is rooted at the desired prefix with replicas on the provided members.
      * Note to register a shard without replicas you still need to provide at least one Member for the shard.
@@ -38,17 +36,4 @@ public interface DistributedShardFactory {
     CompletionStage<DistributedShardRegistration>
         createDistributedShard(DOMDataTreeIdentifier prefix, Collection<MemberName> replicaMembers)
             throws DOMDataTreeShardingConflictException;
-
-    /**
-     * Registration of the CDS shard that allows you to remove the shard from the system by closing the registration.
-     * This removal is done asynchronously.
-     */
-    interface DistributedShardRegistration {
-
-        /**
-         *  Removes the shard from the system, this removal is done asynchronously, the future completes once the
-         *  backend shard is no longer present.
-         */
-        CompletionStage<Void> close();
-    }
 }
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardRegistration.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardRegistration.java
new file mode 100644 (file)
index 0000000..0f94bc5
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.cluster.sharding;
+
+import com.google.common.annotations.Beta;
+import java.util.concurrent.CompletionStage;
+
+/**
+ * Registration of the CDS shard that allows you to remove the shard from the system by closing the registration.
+ * This removal is done asynchronously.
+ */
+@Beta
+public interface DistributedShardRegistration {
+
+    /**
+     *  Removes the shard from the system, this removal is done asynchronously, the future completes once the
+     *  backend shard is no longer present.
+     */
+    CompletionStage<Void> close();
+}
index a824961..6f4611f 100644 (file)
@@ -41,7 +41,6 @@ import org.opendaylight.controller.cluster.datastore.IntegrationTestKit;
 import org.opendaylight.controller.cluster.datastore.utils.ClusterUtils;
 import org.opendaylight.controller.cluster.raft.utils.InMemoryJournal;
 import org.opendaylight.controller.cluster.raft.utils.InMemorySnapshotStore;
-import org.opendaylight.controller.cluster.sharding.DistributedShardFactory.DistributedShardRegistration;
 import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelper;
 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
index 68c16dc..8f9002c 100644 (file)
@@ -68,7 +68,6 @@ import org.opendaylight.controller.cluster.dom.api.CDSDataTreeProducer;
 import org.opendaylight.controller.cluster.dom.api.CDSShardAccess;
 import org.opendaylight.controller.cluster.raft.utils.InMemoryJournal;
 import org.opendaylight.controller.cluster.raft.utils.InMemorySnapshotStore;
-import org.opendaylight.controller.cluster.sharding.DistributedShardFactory.DistributedShardRegistration;
 import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelper;
 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
index dcbedd6..a58883c 100644 (file)
@@ -24,7 +24,7 @@ import java.util.concurrent.CompletionStage;
 import java.util.stream.Collectors;
 import org.opendaylight.controller.cluster.access.concepts.MemberName;
 import org.opendaylight.controller.cluster.sharding.DistributedShardFactory;
-import org.opendaylight.controller.cluster.sharding.DistributedShardFactory.DistributedShardRegistration;
+import org.opendaylight.controller.cluster.sharding.DistributedShardRegistration;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeCursorAwareTransaction;

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.