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 a53d59139e44b007cfba7bc80006f566860d2527..045083f7d9713a9e6e9e0545758cd486e475a77e 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 f1cdcd8dda9476c65e9637968fe11480b0ae4dfe..fba71ab11771d1fd60e91c9b24e1ee4f2b7ab8b7 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 a8249611bfa7de4a7a82ac39f51fa6d7a990b7a8..6f4611f25b81f975b2b40f80e767b3d7fe7f9c1f 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 68c16dc86d4374abcaa373d372f502fdbf9ddd33..8f9002c2569f8022fcba7a05e6815a9084bd9024 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 dcbedd66500a1b71aa78eff7d0a62bdedae57e24..a58883c3e2befef45ef9237d2cb1e24df07ffa03 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;