From e374ecff47606383dd1123c8950ce50ac0b323a7 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 30 Apr 2018 18:24:13 +0200 Subject: [PATCH] CDS should use MD-SAL InMemoryDOMDataStoreConfigProperties This moves CDS's use of InMemoryDOMDataStoreConfigProperties from controller's IMDS to MDSAL's IMDS -- eliminating all dependencies between the two. Change-Id: Id68f86ac5f1cccdb29f706b3a0bc63ae5a4987fd Signed-off-by: Robert Varga --- .../cluster/datastore/DatastoreContext.java | 12 +++++++----- .../datastore/DatastoreContextIntrospectorTest.java | 2 +- .../cluster/datastore/DatastoreContextTest.java | 3 +-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java index 764cd357e5..6584b8d5b8 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java @@ -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.datastore; import akka.util.Timeout; @@ -22,8 +21,8 @@ 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.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreConfigProperties; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -616,9 +615,12 @@ public class DatastoreContext implements ClientActorConfig { @Override public DatastoreContext build() { - datastoreContext.dataStoreProperties = InMemoryDOMDataStoreConfigProperties.create( - maxShardDataChangeExecutorPoolSize, maxShardDataChangeExecutorQueueSize, - maxShardDataChangeListenerQueueSize, maxShardDataStoreExecutorQueueSize); + datastoreContext.dataStoreProperties = InMemoryDOMDataStoreConfigProperties.builder() + .maxDataChangeExecutorPoolSize(maxShardDataChangeExecutorPoolSize) + .maxDataChangeExecutorQueueSize(maxShardDataChangeExecutorQueueSize) + .maxDataChangeListenerQueueSize(maxShardDataChangeListenerQueueSize) + .maxDataStoreExecutorQueueSize(maxShardDataStoreExecutorQueueSize) + .build(); if (datastoreContext.dataStoreName != null) { GLOBAL_DATASTORE_NAMES.add(datastoreContext.dataStoreName); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java index a735f26b4f..5d5d2f8db2 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java @@ -19,8 +19,8 @@ import java.util.HashMap; import java.util.Hashtable; import java.util.Map; import org.junit.Test; -import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreConfigProperties; /** * Unit tests for DatastoreContextIntrospector. diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextTest.java index dd117add08..c0776229e2 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextTest.java @@ -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.datastore; import static org.junit.Assert.assertEquals; @@ -30,7 +29,7 @@ import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEF import java.util.concurrent.TimeUnit; import org.junit.Assert; import org.junit.Test; -import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties; +import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreConfigProperties; public class DatastoreContextTest { -- 2.36.6