From: Robert Varga Date: Fri, 29 May 2020 19:40:09 +0000 (+0200) Subject: Remove use of InMemoryDOMDataStoreConfigProperties X-Git-Tag: v2.0.1~3 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=e88a8dbc9f2ff411afd735d9804576587f4b5c2f Remove use of InMemoryDOMDataStoreConfigProperties 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 --- diff --git a/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg b/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg index afceb37f7a..727aa5ddae 100644 --- a/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg +++ b/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg @@ -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 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 e6d8ed8457..54a14ff9df 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 @@ -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 { 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); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBean.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBean.java index 3abdafd983..7a83b0c9b0 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBean.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBean.java @@ -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(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBeanImpl.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBeanImpl.java index 20b6e79e07..e17f403235 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBeanImpl.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBeanImpl.java @@ -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 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 2d6e4ebcbc..06e865b91c 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 @@ -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 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 504618cd1f..42b1cf79d0 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 @@ -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());