Remove use of InMemoryDOMDataStoreConfigProperties 13/90113/2
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 29 May 2020 19:40:09 +0000 (21:40 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 29 May 2020 19:44:18 +0000 (21:44 +0200)
CDS does not use original IMDS tuning, as we have not used a captive
IMDS instance for almost five years now.

Remove references InMemoryDOMDataStoreConfigProperties and turn the
knobs to no-ops.

JIRA: CONTROLLER-1940
Change-Id: I527b8ba407f7de4ecadb82f7c24d6a782722f683
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg
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/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBean.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBeanImpl.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/DatastoreContextTest.java

index afceb37f7ac7ba825e5e4e9381ccad003738cde4..727aa5ddaed51b3e6da9867fc6fb5ebf4a22f7db 100644 (file)
@@ -73,15 +73,19 @@ operational.persistent=false
 #transaction-creation-initial-rate-limit=100
 
 # The maximum thread pool size for each shard's data store data change notification executor.
+# THIS SETTING HAS HAD NO EFFECT FOR A LONG TIME, IS DEPRECATED, AND WILL BE REMOVED IN A FUTURE RELEASE
 #max-shard-data-change-executor-pool-size=20
 
 # The maximum queue size for each shard's data store data change notification executor.
+# THIS SETTING HAS HAD NO EFFECT FOR A LONG TIME, IS DEPRECATED, AND WILL BE REMOVED IN A FUTURE RELEASE
 #max-shard-data-change-executor-queue-size=1000
 
 # The maximum queue size for each shard's data store data change listener.
+# THIS SETTING HAS HAD NO EFFECT FOR A LONG TIME, IS DEPRECATED, AND WILL BE REMOVED IN A FUTURE RELEASE
 #max-shard-data-change-listener-queue-size=1000
 
 # The maximum queue size for each shard's data store executor.
+# THIS SETTING HAS HAD NO EFFECT FOR A LONG TIME, IS DEPRECATED, AND WILL BE REMOVED IN A FUTURE RELEASE
 #max-shard-data-store-executor-queue-size=5000
 
 # A fully qualified java class name. The class should implement
index e6d8ed84573d0094e222b38f0088a8175c953280..54a14ff9dfafdbcd42353e40f22d41b9a3eecb00 100644 (file)
@@ -24,7 +24,6 @@ import org.opendaylight.controller.cluster.raft.ConfigParams;
 import org.opendaylight.controller.cluster.raft.DefaultConfigParamsImpl;
 import org.opendaylight.controller.cluster.raft.PeerAddressResolver;
 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;
@@ -73,7 +72,6 @@ public class DatastoreContext implements ClientActorConfig {
 
     private final DefaultConfigParamsImpl raftConfig = new DefaultConfigParamsImpl();
 
-    private InMemoryDOMDataStoreConfigProperties dataStoreProperties;
     private FiniteDuration shardTransactionIdleTimeout = DatastoreContext.DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT;
     private long operationTimeoutInMillis = DEFAULT_OPERATION_TIMEOUT_IN_MS;
     private String dataStoreMXBeanType;
@@ -117,7 +115,6 @@ public class DatastoreContext implements ClientActorConfig {
     }
 
     private DatastoreContext(final DatastoreContext other) {
-        this.dataStoreProperties = other.dataStoreProperties;
         this.shardTransactionIdleTimeout = other.shardTransactionIdleTimeout;
         this.operationTimeoutInMillis = other.operationTimeoutInMillis;
         this.dataStoreMXBeanType = other.dataStoreMXBeanType;
@@ -167,10 +164,6 @@ public class DatastoreContext implements ClientActorConfig {
         return new Builder(new DatastoreContext(context));
     }
 
-    public InMemoryDOMDataStoreConfigProperties getDataStoreProperties() {
-        return dataStoreProperties;
-    }
-
     public FiniteDuration getShardTransactionIdleTimeout() {
         return shardTransactionIdleTimeout;
     }
@@ -367,28 +360,9 @@ public class DatastoreContext implements ClientActorConfig {
 
     public static class Builder implements org.opendaylight.yangtools.concepts.Builder<DatastoreContext> {
         private final DatastoreContext datastoreContext;
-        private int maxShardDataChangeExecutorPoolSize =
-                InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE;
-        private int maxShardDataChangeExecutorQueueSize =
-                InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE;
-        private int maxShardDataChangeListenerQueueSize =
-                InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE;
-        private int maxShardDataStoreExecutorQueueSize =
-                InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE;
 
         Builder(final DatastoreContext datastoreContext) {
             this.datastoreContext = datastoreContext;
-
-            if (datastoreContext.getDataStoreProperties() != null) {
-                maxShardDataChangeExecutorPoolSize =
-                        datastoreContext.getDataStoreProperties().getMaxDataChangeExecutorPoolSize();
-                maxShardDataChangeExecutorQueueSize =
-                        datastoreContext.getDataStoreProperties().getMaxDataChangeExecutorQueueSize();
-                maxShardDataChangeListenerQueueSize =
-                        datastoreContext.getDataStoreProperties().getMaxDataChangeListenerQueueSize();
-                maxShardDataStoreExecutorQueueSize =
-                        datastoreContext.getDataStoreProperties().getMaxDataStoreExecutorQueueSize();
-            }
         }
 
         public Builder boundedMailboxCapacity(final int boundedMailboxCapacity) {
@@ -565,23 +539,23 @@ public class DatastoreContext implements ClientActorConfig {
             return this;
         }
 
+        @Deprecated(forRemoval = true)
         public Builder maxShardDataChangeExecutorPoolSize(final int newMaxShardDataChangeExecutorPoolSize) {
-            this.maxShardDataChangeExecutorPoolSize = newMaxShardDataChangeExecutorPoolSize;
             return this;
         }
 
+        @Deprecated(forRemoval = true)
         public Builder maxShardDataChangeExecutorQueueSize(final int newMaxShardDataChangeExecutorQueueSize) {
-            this.maxShardDataChangeExecutorQueueSize = newMaxShardDataChangeExecutorQueueSize;
             return this;
         }
 
+        @Deprecated(forRemoval = true)
         public Builder maxShardDataChangeListenerQueueSize(final int newMaxShardDataChangeListenerQueueSize) {
-            this.maxShardDataChangeListenerQueueSize = newMaxShardDataChangeListenerQueueSize;
             return this;
         }
 
+        @Deprecated(forRemoval = true)
         public Builder maxShardDataStoreExecutorQueueSize(final int newMaxShardDataStoreExecutorQueueSize) {
-            this.maxShardDataStoreExecutorQueueSize = newMaxShardDataStoreExecutorQueueSize;
             return this;
         }
 
@@ -659,13 +633,6 @@ public class DatastoreContext implements ClientActorConfig {
 
         @Override
         public DatastoreContext build() {
-            datastoreContext.dataStoreProperties = InMemoryDOMDataStoreConfigProperties.builder()
-                    .maxDataChangeExecutorPoolSize(maxShardDataChangeExecutorPoolSize)
-                    .maxDataChangeExecutorQueueSize(maxShardDataChangeExecutorQueueSize)
-                    .maxDataChangeListenerQueueSize(maxShardDataChangeListenerQueueSize)
-                    .maxDataStoreExecutorQueueSize(maxShardDataStoreExecutorQueueSize)
-                    .build();
-
             if (datastoreContext.dataStoreName != null) {
                 GLOBAL_DATASTORE_NAMES.add(datastoreContext.dataStoreName);
             }
index 3abdafd983bfa05b0929f5c11bb6ac9d44eb82e5..7a83b0c9b0cead06847638c6a60f62d61a9c6d79 100644 (file)
@@ -46,12 +46,16 @@ public interface DatastoreConfigurationMXBean {
 
     boolean getTransactionContextDebugEnabled();
 
+    @Deprecated(forRemoval = true)
     int getMaxShardDataChangeExecutorPoolSize();
 
+    @Deprecated(forRemoval = true)
     int getMaxShardDataChangeExecutorQueueSize();
 
+    @Deprecated(forRemoval = true)
     int getMaxShardDataChangeListenerQueueSize();
 
+    @Deprecated(forRemoval = true)
     int getMaxShardDataStoreExecutorQueueSize();
 
     int getMaximumMessageSliceSize();
index 20b6e79e075fb4674f4ff3e6e73f76b6d61c45cb..e17f40323572c9e7c7c8116e99dc95d737c85daf 100644 (file)
@@ -21,11 +21,11 @@ public class DatastoreConfigurationMXBeanImpl extends AbstractMXBean implements
 
     private DatastoreContext context;
 
-    public DatastoreConfigurationMXBeanImpl(String mxBeanType) {
+    public DatastoreConfigurationMXBeanImpl(final String mxBeanType) {
         super("Datastore", mxBeanType, JMX_CATEGORY_CONFIGURATION);
     }
 
-    public void setContext(DatastoreContext context) {
+    public void setContext(final DatastoreContext context) {
         this.context = context;
     }
 
@@ -110,23 +110,27 @@ public class DatastoreConfigurationMXBeanImpl extends AbstractMXBean implements
     }
 
     @Override
+    @Deprecated(forRemoval = true)
     public int getMaxShardDataChangeExecutorPoolSize() {
-        return context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize();
+        return 0;
     }
 
     @Override
+    @Deprecated(forRemoval = true)
     public int getMaxShardDataChangeExecutorQueueSize() {
-        return context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize();
+        return 0;
     }
 
     @Override
+    @Deprecated(forRemoval = true)
     public int getMaxShardDataChangeListenerQueueSize() {
-        return context.getDataStoreProperties().getMaxDataChangeListenerQueueSize();
+        return 0;
     }
 
     @Override
+    @Deprecated(forRemoval = true)
     public int getMaxShardDataStoreExecutorQueueSize() {
-        return context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize();
+        return 0;
     }
 
     @Override
index 2d6e4ebcbcaa02736c43f339a8fcb3a0f651c7e0..06e865b91c4fb3719f9bd6550dfef37aad8afc6c 100644 (file)
@@ -24,7 +24,6 @@ import java.util.Map;
 import org.junit.Test;
 import org.opendaylight.binding.runtime.spi.BindingRuntimeHelpers;
 import org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext;
-import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreConfigProperties;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.distributed.datastore.provider.rev140612.DataStorePropertiesContainer;
 
 /**
@@ -93,10 +92,6 @@ public class DatastoreContextIntrospectorTest {
         assertEquals(21, context.getShardRaftConfig().getElectionTimeoutFactor());
         assertEquals(901, context.getShardBatchedModificationCount());
         assertEquals(200, context.getTransactionCreationInitialRateLimit());
-        assertEquals(41, context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
-        assertEquals(1111, context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize());
-        assertEquals(2222, context.getDataStoreProperties().getMaxDataChangeListenerQueueSize());
-        assertEquals(3333, context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize());
         assertEquals(600, context.getInitialPayloadSerializedBufferCapacity());
         assertFalse(context.isPersistent());
 
@@ -127,10 +122,6 @@ public class DatastoreContextIntrospectorTest {
         assertEquals(100, context.getShardRaftConfig().getSnapshotDataThresholdPercentage());
         assertEquals(22, context.getShardRaftConfig().getElectionTimeoutFactor());
         assertEquals(200, context.getTransactionCreationInitialRateLimit());
-        assertEquals(42, context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
-        assertEquals(1111, context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize());
-        assertEquals(2222, context.getDataStoreProperties().getMaxDataChangeListenerQueueSize());
-        assertEquals(4444, context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize());
         assertTrue(context.isPersistent());
 
         updated = introspector.update(null);
@@ -173,8 +164,6 @@ public class DatastoreContextIntrospectorTest {
         assertEquals(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD_PERCENTAGE,
                 context.getShardRaftConfig().getSnapshotDataThresholdPercentage());
         assertEquals(DEFAULT_SHARD_INITIALIZATION_TIMEOUT, context.getShardInitializationTimeout());
-        assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE,
-                context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
     }
 
     @Test
@@ -198,7 +187,6 @@ public class DatastoreContextIntrospectorTest {
 
         assertEquals(33, operContext.getShardTransactionIdleTimeout().toMinutes());
         assertTrue(operContext.isPersistent());
-        assertEquals(333, operContext.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
 
         final DatastoreContextIntrospector configIntrospector = INTROSPECTOR_FACTORY.newInstance(CONFIGURATION);
         updated = configIntrospector.update(properties);
@@ -207,7 +195,6 @@ public class DatastoreContextIntrospectorTest {
 
         assertEquals(44, configContext.getShardTransactionIdleTimeout().toMinutes());
         assertFalse(configContext.isPersistent());
-        assertEquals(444, configContext.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
     }
 
     @Test
index 504618cd1fa94a777afe0252a60b2db0f3e317a7..42b1cf79d079fe600901c2989ab41d6614206cf8 100644 (file)
@@ -64,14 +64,6 @@ public class DatastoreContextTest {
         assertEquals(DEFAULT_TX_CREATION_INITIAL_RATE_LIMIT, context.getTransactionCreationInitialRateLimit());
         assertEquals(DatastoreContext.DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT,
                 context.getShardBatchedModificationCount());
-        assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE,
-                context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
-        assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE,
-                context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize());
-        assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE,
-                context.getDataStoreProperties().getMaxDataChangeListenerQueueSize());
-        assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE,
-                context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize());
         assertEquals(DEFAULT_MAX_MESSAGE_SLICE_SIZE, context.getMaximumMessageSliceSize());
     }
 
@@ -124,7 +116,7 @@ public class DatastoreContextTest {
         Assert.assertNotSame(context, newContext);
     }
 
-    private static void verifyCustomSettings(DatastoreContext context) {
+    private static void verifyCustomSettings(final DatastoreContext context) {
         assertEquals(DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT.toMillis() + 1,
                 context.getShardTransactionIdleTimeout().toMillis());
         assertEquals(TimeUnit.MILLISECONDS.toSeconds(DEFAULT_OPERATION_TIMEOUT_IN_MS) + 1,
@@ -154,14 +146,6 @@ public class DatastoreContextTest {
         assertEquals(DEFAULT_TX_CREATION_INITIAL_RATE_LIMIT + 1, context.getTransactionCreationInitialRateLimit());
         assertEquals(DatastoreContext.DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT + 1,
                 context.getShardBatchedModificationCount());
-        assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE + 1,
-                context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
-        assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE + 1,
-                context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize());
-        assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE + 1,
-                context.getDataStoreProperties().getMaxDataChangeListenerQueueSize());
-        assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE + 1,
-                context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize());
         assertEquals(DEFAULT_MAX_MESSAGE_SLICE_SIZE + 1, context.getMaximumMessageSliceSize());
         assertEquals(DEFAULT_INITIAL_PAYLOAD_SERIALIZED_BUFFER_CAPACITY + 1,
                 context.getInitialPayloadSerializedBufferCapacity());