BUG-1014: clean up DatastoreContext.dataStoreType() 68/29668/12
authorRobert Varga <rovarga@cisco.com>
Fri, 13 Nov 2015 17:15:08 +0000 (18:15 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 14 Dec 2015 09:20:31 +0000 (09:20 +0000)
This is not really a type, but rather a name. Introduce
logicalStoreType() and dataStoreName() to disambiguate the two uses.

Change-Id: Ibd454ce1dd4428908ada92cb504c478d10ace779
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedConfigDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedOperationalDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardManagerTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipServiceTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java

index c8be6aba9dc51f79493925d66a3d80ab27546737..cb65d5f7e1ea94987a0d0685802e9d7843a838f4 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.cluster.datastore;
 
 import akka.util.Timeout;
 import com.google.common.annotations.VisibleForTesting;
 
 import akka.util.Timeout;
 import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Preconditions;
 import com.google.common.collect.Sets;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import com.google.common.collect.Sets;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
@@ -19,6 +20,7 @@ import org.opendaylight.controller.cluster.common.actor.FileAkkaConfigurationRea
 import org.opendaylight.controller.cluster.raft.ConfigParams;
 import org.opendaylight.controller.cluster.raft.DefaultConfigParamsImpl;
 import org.opendaylight.controller.cluster.raft.PeerAddressResolver;
 import org.opendaylight.controller.cluster.raft.ConfigParams;
 import org.opendaylight.controller.cluster.raft.DefaultConfigParamsImpl;
 import org.opendaylight.controller.cluster.raft.PeerAddressResolver;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties;
 import scala.concurrent.duration.Duration;
 import scala.concurrent.duration.FiniteDuration;
 import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties;
 import scala.concurrent.duration.Duration;
 import scala.concurrent.duration.FiniteDuration;
@@ -51,7 +53,7 @@ public class DatastoreContext {
     public static final long DEFAULT_SHARD_COMMIT_QUEUE_EXPIRY_TIMEOUT_IN_MS = TimeUnit.MILLISECONDS.convert(2, TimeUnit.MINUTES);
     public static final int DEFAULT_SHARD_SNAPSHOT_CHUNK_SIZE = 2048000;
 
     public static final long DEFAULT_SHARD_COMMIT_QUEUE_EXPIRY_TIMEOUT_IN_MS = TimeUnit.MILLISECONDS.convert(2, TimeUnit.MINUTES);
     public static final int DEFAULT_SHARD_SNAPSHOT_CHUNK_SIZE = 2048000;
 
-    private static Set<String> globalDatastoreTypes = Sets.newConcurrentHashSet();
+    private static final Set<String> globalDatastoreTypes = Sets.newConcurrentHashSet();
 
     private InMemoryDOMDataStoreConfigProperties dataStoreProperties;
     private Duration shardTransactionIdleTimeout = DatastoreContext.DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT;
 
     private InMemoryDOMDataStoreConfigProperties dataStoreProperties;
     private Duration shardTransactionIdleTimeout = DatastoreContext.DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT;
@@ -65,7 +67,8 @@ public class DatastoreContext {
     private AkkaConfigurationReader configurationReader = DEFAULT_CONFIGURATION_READER;
     private long transactionCreationInitialRateLimit = DEFAULT_TX_CREATION_INITIAL_RATE_LIMIT;
     private final DefaultConfigParamsImpl raftConfig = new DefaultConfigParamsImpl();
     private AkkaConfigurationReader configurationReader = DEFAULT_CONFIGURATION_READER;
     private long transactionCreationInitialRateLimit = DEFAULT_TX_CREATION_INITIAL_RATE_LIMIT;
     private final DefaultConfigParamsImpl raftConfig = new DefaultConfigParamsImpl();
-    private String dataStoreType = UNKNOWN_DATA_STORE_TYPE;
+    private String dataStoreName = UNKNOWN_DATA_STORE_TYPE;
+    private LogicalDatastoreType logicalStoreType = LogicalDatastoreType.OPERATIONAL;
     private int shardBatchedModificationCount = DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT;
     private boolean writeOnlyTransactionOptimizationsEnabled = true;
     private long shardCommitQueueExpiryTimeoutInMillis = DEFAULT_SHARD_COMMIT_QUEUE_EXPIRY_TIMEOUT_IN_MS;
     private int shardBatchedModificationCount = DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT;
     private boolean writeOnlyTransactionOptimizationsEnabled = true;
     private long shardCommitQueueExpiryTimeoutInMillis = DEFAULT_SHARD_COMMIT_QUEUE_EXPIRY_TIMEOUT_IN_MS;
@@ -98,7 +101,8 @@ public class DatastoreContext {
         this.persistent = other.persistent;
         this.configurationReader = other.configurationReader;
         this.transactionCreationInitialRateLimit = other.transactionCreationInitialRateLimit;
         this.persistent = other.persistent;
         this.configurationReader = other.configurationReader;
         this.transactionCreationInitialRateLimit = other.transactionCreationInitialRateLimit;
-        this.dataStoreType = other.dataStoreType;
+        this.dataStoreName = other.dataStoreName;
+        this.logicalStoreType = other.logicalStoreType;
         this.shardBatchedModificationCount = other.shardBatchedModificationCount;
         this.writeOnlyTransactionOptimizationsEnabled = other.writeOnlyTransactionOptimizationsEnabled;
         this.shardCommitQueueExpiryTimeoutInMillis = other.shardCommitQueueExpiryTimeoutInMillis;
         this.shardBatchedModificationCount = other.shardBatchedModificationCount;
         this.writeOnlyTransactionOptimizationsEnabled = other.writeOnlyTransactionOptimizationsEnabled;
         this.shardCommitQueueExpiryTimeoutInMillis = other.shardCommitQueueExpiryTimeoutInMillis;
@@ -172,8 +176,20 @@ public class DatastoreContext {
         return raftConfig.getElectionTimeoutFactor();
     }
 
         return raftConfig.getElectionTimeoutFactor();
     }
 
+    public String getDataStoreName(){
+        return dataStoreName;
+    }
+
+    public LogicalDatastoreType getLogicalStoreType() {
+        return logicalStoreType;
+    }
+
+    /**
+     * @deprecated Use {@link #getDataStoreName()} or {@link #getLogicalStoreType()} instead.
+     */
+    @Deprecated
     public String getDataStoreType(){
     public String getDataStoreType(){
-        return dataStoreType;
+        return getDataStoreName();
     }
 
     public long getTransactionCreationInitialRateLimit() {
     }
 
     public long getTransactionCreationInitialRateLimit() {
@@ -377,9 +393,35 @@ public class DatastoreContext {
             return this;
         }
 
             return this;
         }
 
+        /**
+         * @deprecated Use {@link #logicalStoreType(LogicalDatastoreType)} or {@link #dataStoreName(String)}.
+         */
+        @Deprecated
         public Builder dataStoreType(String dataStoreType){
         public Builder dataStoreType(String dataStoreType){
-            datastoreContext.dataStoreType = dataStoreType;
-            datastoreContext.dataStoreMXBeanType = "Distributed" + WordUtils.capitalize(dataStoreType) + "Datastore";
+            return dataStoreName(dataStoreType);
+        }
+
+        public Builder logicalStoreType(LogicalDatastoreType logicalStoreType){
+            datastoreContext.logicalStoreType = Preconditions.checkNotNull(logicalStoreType);
+
+            // Retain compatible naming
+            switch (logicalStoreType) {
+            case CONFIGURATION:
+                dataStoreName("config");
+                break;
+            case OPERATIONAL:
+                dataStoreName("operational");
+                break;
+            default:
+                dataStoreName(logicalStoreType.name());
+            }
+
+            return this;
+        }
+
+        public Builder dataStoreName(String dataStoreName){
+            datastoreContext.dataStoreName = Preconditions.checkNotNull(dataStoreName);
+            datastoreContext.dataStoreMXBeanType = "Distributed" + WordUtils.capitalize(dataStoreName) + "Datastore";
             return this;
         }
 
             return this;
         }
 
@@ -443,8 +485,8 @@ public class DatastoreContext {
                     maxShardDataChangeExecutorPoolSize, maxShardDataChangeExecutorQueueSize,
                     maxShardDataChangeListenerQueueSize, maxShardDataStoreExecutorQueueSize);
 
                     maxShardDataChangeExecutorPoolSize, maxShardDataChangeExecutorQueueSize,
                     maxShardDataChangeListenerQueueSize, maxShardDataStoreExecutorQueueSize);
 
-            if(datastoreContext.dataStoreType != null) {
-                globalDatastoreTypes.add(datastoreContext.dataStoreType);
+            if(datastoreContext.dataStoreName != null) {
+                globalDatastoreTypes.add(datastoreContext.dataStoreName);
             }
 
             return datastoreContext;
             }
 
             return datastoreContext;
index e028887a3c1dc0896f11387b1481e2785bb184fd..43e6723e8d2ae52e8848017998638452e93e5b8d 100644 (file)
@@ -3,6 +3,7 @@ package org.opendaylight.controller.config.yang.config.distributed_datastore_pro
 import org.opendaylight.controller.cluster.datastore.DatastoreContext;
 import org.opendaylight.controller.cluster.datastore.DatastoreSnapshotRestore;
 import org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory;
 import org.opendaylight.controller.cluster.datastore.DatastoreContext;
 import org.opendaylight.controller.cluster.datastore.DatastoreSnapshotRestore;
 import org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.osgi.framework.BundleContext;
 
 public class DistributedConfigDataStoreProviderModule extends
 import org.osgi.framework.BundleContext;
 
 public class DistributedConfigDataStoreProviderModule extends
@@ -41,7 +42,7 @@ public class DistributedConfigDataStoreProviderModule extends
         }
 
         DatastoreContext datastoreContext = DatastoreContext.newBuilder()
         }
 
         DatastoreContext datastoreContext = DatastoreContext.newBuilder()
-                .dataStoreType("config")
+                .logicalStoreType(LogicalDatastoreType.CONFIGURATION)
                 .maxShardDataChangeExecutorPoolSize(props.getMaxShardDataChangeExecutorPoolSize().getValue().intValue())
                 .maxShardDataChangeExecutorQueueSize(props.getMaxShardDataChangeExecutorQueueSize().getValue().intValue())
                 .maxShardDataChangeListenerQueueSize(props.getMaxShardDataChangeListenerQueueSize().getValue().intValue())
                 .maxShardDataChangeExecutorPoolSize(props.getMaxShardDataChangeExecutorPoolSize().getValue().intValue())
                 .maxShardDataChangeExecutorQueueSize(props.getMaxShardDataChangeExecutorQueueSize().getValue().intValue())
                 .maxShardDataChangeListenerQueueSize(props.getMaxShardDataChangeListenerQueueSize().getValue().intValue())
index e89708f211e1a85a8657190c87c33cc8d57e1f30..d9225ab265ebe6a52475c48b5d609e9fc836ff44 100644 (file)
@@ -3,6 +3,7 @@ package org.opendaylight.controller.config.yang.config.distributed_datastore_pro
 import org.opendaylight.controller.cluster.datastore.DatastoreContext;
 import org.opendaylight.controller.cluster.datastore.DatastoreSnapshotRestore;
 import org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory;
 import org.opendaylight.controller.cluster.datastore.DatastoreContext;
 import org.opendaylight.controller.cluster.datastore.DatastoreSnapshotRestore;
 import org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.osgi.framework.BundleContext;
 
 public class DistributedOperationalDataStoreProviderModule extends
 import org.osgi.framework.BundleContext;
 
 public class DistributedOperationalDataStoreProviderModule extends
@@ -42,7 +43,7 @@ public class DistributedOperationalDataStoreProviderModule extends
         }
 
         DatastoreContext datastoreContext = DatastoreContext.newBuilder()
         }
 
         DatastoreContext datastoreContext = DatastoreContext.newBuilder()
-                .dataStoreType("operational")
+                .logicalStoreType(LogicalDatastoreType.OPERATIONAL)
                 .maxShardDataChangeExecutorPoolSize(props.getMaxShardDataChangeExecutorPoolSize().getValue().intValue())
                 .maxShardDataChangeExecutorQueueSize(props.getMaxShardDataChangeExecutorQueueSize().getValue().intValue())
                 .maxShardDataChangeListenerQueueSize(props.getMaxShardDataChangeListenerQueueSize().getValue().intValue())
                 .maxShardDataChangeExecutorPoolSize(props.getMaxShardDataChangeExecutorPoolSize().getValue().intValue())
                 .maxShardDataChangeExecutorQueueSize(props.getMaxShardDataChangeExecutorQueueSize().getValue().intValue())
                 .maxShardDataChangeListenerQueueSize(props.getMaxShardDataChangeListenerQueueSize().getValue().intValue())
index 2bd2e61296daec3f41d9264b78d8652d3159c762..9ae1e0a9a884b501ccae6487f232f310a66eaf7f 100644 (file)
@@ -17,6 +17,7 @@ import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEF
 import java.util.Dictionary;
 import java.util.Hashtable;
 import org.junit.Test;
 import java.util.Dictionary;
 import java.util.Hashtable;
 import org.junit.Test;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties;
 
 /**
 import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties;
 
 /**
@@ -28,7 +29,8 @@ public class DatastoreContextIntrospectorTest {
 
     @Test
     public void testUpdate() {
 
     @Test
     public void testUpdate() {
-        DatastoreContext context = DatastoreContext.newBuilder().dataStoreType("operational").build();
+        DatastoreContext context = DatastoreContext.newBuilder().
+                logicalStoreType(LogicalDatastoreType.OPERATIONAL).build();
         DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(context );
 
         Dictionary<String, Object> properties = new Hashtable<>();
         DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(context );
 
         Dictionary<String, Object> properties = new Hashtable<>();
@@ -117,7 +119,8 @@ public class DatastoreContextIntrospectorTest {
 
     @Test
     public void testUpdateWithInvalidValues() {
 
     @Test
     public void testUpdateWithInvalidValues() {
-        DatastoreContext context = DatastoreContext.newBuilder().dataStoreType("operational").build();
+        DatastoreContext context = DatastoreContext.newBuilder().
+                logicalStoreType(LogicalDatastoreType.OPERATIONAL).build();
         DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(context );
 
         Dictionary<String, Object> properties = new Hashtable<>();
         DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(context );
 
         Dictionary<String, Object> properties = new Hashtable<>();
@@ -165,7 +168,8 @@ public class DatastoreContextIntrospectorTest {
         properties.put("persistent", "false"); // global setting
         properties.put("operational.Persistent", "true"); // operational override
 
         properties.put("persistent", "false"); // global setting
         properties.put("operational.Persistent", "true"); // operational override
 
-        DatastoreContext operContext = DatastoreContext.newBuilder().dataStoreType("operational").build();
+        DatastoreContext operContext = DatastoreContext.newBuilder().
+                logicalStoreType(LogicalDatastoreType.OPERATIONAL).build();
         DatastoreContextIntrospector operIntrospector = new DatastoreContextIntrospector(operContext);
         boolean updated = operIntrospector.update(properties);
         assertEquals("updated", true, updated);
         DatastoreContextIntrospector operIntrospector = new DatastoreContextIntrospector(operContext);
         boolean updated = operIntrospector.update(properties);
         assertEquals("updated", true, updated);
@@ -175,7 +179,8 @@ public class DatastoreContextIntrospectorTest {
         assertEquals(true, operContext.isPersistent());
         assertEquals(333, operContext.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
 
         assertEquals(true, operContext.isPersistent());
         assertEquals(333, operContext.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
 
-        DatastoreContext configContext = DatastoreContext.newBuilder().dataStoreType("config").build();
+        DatastoreContext configContext = DatastoreContext.newBuilder()
+                .logicalStoreType(LogicalDatastoreType.CONFIGURATION).build();
         DatastoreContextIntrospector configIntrospector = new DatastoreContextIntrospector(configContext);
         updated = configIntrospector.update(properties);
         assertEquals("updated", true, updated);
         DatastoreContextIntrospector configIntrospector = new DatastoreContextIntrospector(configContext);
         updated = configIntrospector.update(properties);
         assertEquals("updated", true, updated);
@@ -194,7 +199,8 @@ public class DatastoreContextIntrospectorTest {
         properties.put("config.shard-transaction-idle-timeout-in-minutes", "44"); // config override
         properties.put("topology.shard-transaction-idle-timeout-in-minutes", "55"); // global shard override
 
         properties.put("config.shard-transaction-idle-timeout-in-minutes", "44"); // config override
         properties.put("topology.shard-transaction-idle-timeout-in-minutes", "55"); // global shard override
 
-        DatastoreContext operContext = DatastoreContext.newBuilder().dataStoreType("operational").build();
+        DatastoreContext operContext = DatastoreContext.newBuilder().
+                logicalStoreType(LogicalDatastoreType.OPERATIONAL).build();
         DatastoreContextIntrospector operIntrospector = new DatastoreContextIntrospector(operContext);
 
         DatastoreContext shardContext = operIntrospector.newContextFactory().getShardDatastoreContext("topology");
         DatastoreContextIntrospector operIntrospector = new DatastoreContextIntrospector(operContext);
 
         DatastoreContext shardContext = operIntrospector.newContextFactory().getShardDatastoreContext("topology");
@@ -207,7 +213,8 @@ public class DatastoreContextIntrospectorTest {
         shardContext = operIntrospector.newContextFactory().getShardDatastoreContext("topology");
         assertEquals(55, shardContext.getShardTransactionIdleTimeout().toMinutes());
 
         shardContext = operIntrospector.newContextFactory().getShardDatastoreContext("topology");
         assertEquals(55, shardContext.getShardTransactionIdleTimeout().toMinutes());
 
-        DatastoreContext configContext = DatastoreContext.newBuilder().dataStoreType("config").build();
+        DatastoreContext configContext = DatastoreContext.newBuilder().
+                logicalStoreType(LogicalDatastoreType.CONFIGURATION).build();
         DatastoreContextIntrospector configIntrospector = new DatastoreContextIntrospector(configContext);
         configIntrospector.update(properties);
         configContext = configIntrospector.getContext();
         DatastoreContextIntrospector configIntrospector = new DatastoreContextIntrospector(configContext);
         configIntrospector.update(properties);
         configContext = configIntrospector.getContext();
index 9cc6d838c8c547a59384b97a63ea36fbb26e1909..ada0fba10eb5227f8bb2860ead76a600ccfaa7a4 100644 (file)
@@ -68,7 +68,7 @@ public class IntegrationTestKit extends ShardTestKit {
         ClusterWrapper cluster = new ClusterWrapperImpl(getSystem());
         Configuration config = new ConfigurationImpl(moduleShardsConfig, "modules.conf");
 
         ClusterWrapper cluster = new ClusterWrapperImpl(getSystem());
         Configuration config = new ConfigurationImpl(moduleShardsConfig, "modules.conf");
 
-        datastoreContextBuilder.dataStoreType(typeName);
+        datastoreContextBuilder.dataStoreName(typeName);
 
         DatastoreContext datastoreContext = datastoreContextBuilder.build();
         DatastoreContextFactory mockContextFactory = Mockito.mock(DatastoreContextFactory.class);
 
         DatastoreContext datastoreContext = datastoreContextBuilder.build();
         DatastoreContextFactory mockContextFactory = Mockito.mock(DatastoreContextFactory.class);
index 5bccee198d37f83db680b74a80dee3f600b35d30..cef38b9c1b176268ce184156fae51fc14690fb9e 100644 (file)
@@ -137,7 +137,7 @@ public class ShardManagerTest extends AbstractActorTest {
     private static String mockShardName;
 
     private final DatastoreContext.Builder datastoreContextBuilder = DatastoreContext.newBuilder().
     private static String mockShardName;
 
     private final DatastoreContext.Builder datastoreContextBuilder = DatastoreContext.newBuilder().
-            dataStoreType(shardMrgIDSuffix).shardInitializationTimeout(600, TimeUnit.MILLISECONDS)
+            dataStoreName(shardMrgIDSuffix).shardInitializationTimeout(600, TimeUnit.MILLISECONDS)
                    .shardHeartbeatIntervalInMillis(100).shardElectionTimeoutFactor(6);
 
     private final Collection<ActorSystem> actorSystems = new ArrayList<>();
                    .shardHeartbeatIntervalInMillis(100).shardElectionTimeoutFactor(6);
 
     private final Collection<ActorSystem> actorSystems = new ArrayList<>();
index 31accd12eea75761ec2f0e07c3cad970dca52111..63e576944b985b0d8272fd533cd8a02be95b5650 100644 (file)
@@ -78,12 +78,12 @@ public class DistributedEntityOwnershipServiceTest extends AbstractEntityOwnersh
     static int ID_COUNTER = 1;
     static final QName QNAME = QName.create("test", "2015-08-11", "foo");
 
     static int ID_COUNTER = 1;
     static final QName QNAME = QName.create("test", "2015-08-11", "foo");
 
-    private final String dataStoreType = "config" + ID_COUNTER++;
+    private final String dataStoreName = "config" + ID_COUNTER++;
     private DistributedDataStore dataStore;
 
     @Before
     public void setUp() {
     private DistributedDataStore dataStore;
 
     @Before
     public void setUp() {
-        DatastoreContext datastoreContext = DatastoreContext.newBuilder().dataStoreType(dataStoreType).
+        DatastoreContext datastoreContext = DatastoreContext.newBuilder().dataStoreName(dataStoreName).
                 shardInitializationTimeout(10, TimeUnit.SECONDS).build();
 
         Configuration configuration = new ConfigurationImpl(new EmptyModuleShardConfigProvider()) {
                 shardInitializationTimeout(10, TimeUnit.SECONDS).build();
 
         Configuration configuration = new ConfigurationImpl(new EmptyModuleShardConfigProvider()) {
index 093f0fa6df046ba333858117e385a2a971e12fe6..a2794bde9cbfdcbe28ffd63819b193aef2db97ab 100644 (file)
@@ -56,6 +56,7 @@ import org.opendaylight.controller.cluster.datastore.messages.PrimaryShardInfo;
 import org.opendaylight.controller.cluster.datastore.messages.RemotePrimaryShardFound;
 import org.opendaylight.controller.cluster.raft.utils.EchoActor;
 import org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor;
 import org.opendaylight.controller.cluster.datastore.messages.RemotePrimaryShardFound;
 import org.opendaylight.controller.cluster.raft.utils.EchoActor;
 import org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -397,7 +398,8 @@ public class ActorContextTest extends AbstractActorTest{
             TestActorRef<MessageCollectorActor> shardManager =
                     TestActorRef.create(getSystem(), Props.create(MessageCollectorActor.class));
 
             TestActorRef<MessageCollectorActor> shardManager =
                     TestActorRef.create(getSystem(), Props.create(MessageCollectorActor.class));
 
-            DatastoreContext dataStoreContext = DatastoreContext.newBuilder().dataStoreType("config").
+            DatastoreContext dataStoreContext = DatastoreContext.newBuilder().
+                    logicalStoreType(LogicalDatastoreType.CONFIGURATION).
                     shardLeaderElectionTimeout(100, TimeUnit.MILLISECONDS).build();
 
             final String expPrimaryPath = "akka://test-system/find-primary-shard";
                     shardLeaderElectionTimeout(100, TimeUnit.MILLISECONDS).build();
 
             final String expPrimaryPath = "akka://test-system/find-primary-shard";
@@ -439,7 +441,8 @@ public class ActorContextTest extends AbstractActorTest{
             TestActorRef<MessageCollectorActor> shardManager =
                     TestActorRef.create(getSystem(), Props.create(MessageCollectorActor.class));
 
             TestActorRef<MessageCollectorActor> shardManager =
                     TestActorRef.create(getSystem(), Props.create(MessageCollectorActor.class));
 
-            DatastoreContext dataStoreContext = DatastoreContext.newBuilder().dataStoreType("config").
+            DatastoreContext dataStoreContext = DatastoreContext.newBuilder().
+                    logicalStoreType(LogicalDatastoreType.CONFIGURATION).
                     shardLeaderElectionTimeout(100, TimeUnit.MILLISECONDS).build();
 
             final DataTree mockDataTree = Mockito.mock(DataTree.class);
                     shardLeaderElectionTimeout(100, TimeUnit.MILLISECONDS).build();
 
             final DataTree mockDataTree = Mockito.mock(DataTree.class);
@@ -490,7 +493,8 @@ public class ActorContextTest extends AbstractActorTest{
         TestActorRef<MessageCollectorActor> shardManager =
             TestActorRef.create(getSystem(), Props.create(MessageCollectorActor.class));
 
         TestActorRef<MessageCollectorActor> shardManager =
             TestActorRef.create(getSystem(), Props.create(MessageCollectorActor.class));
 
-        DatastoreContext dataStoreContext = DatastoreContext.newBuilder().dataStoreType("config").
+        DatastoreContext dataStoreContext = DatastoreContext.newBuilder().
+            logicalStoreType(LogicalDatastoreType.CONFIGURATION).
             shardLeaderElectionTimeout(100, TimeUnit.MILLISECONDS).build();
 
         ActorContext actorContext =
             shardLeaderElectionTimeout(100, TimeUnit.MILLISECONDS).build();
 
         ActorContext actorContext =