#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
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;
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;
}
private DatastoreContext(final DatastoreContext other) {
- this.dataStoreProperties = other.dataStoreProperties;
this.shardTransactionIdleTimeout = other.shardTransactionIdleTimeout;
this.operationTimeoutInMillis = other.operationTimeoutInMillis;
this.dataStoreMXBeanType = other.dataStoreMXBeanType;
return new Builder(new DatastoreContext(context));
}
- public InMemoryDOMDataStoreConfigProperties getDataStoreProperties() {
- return dataStoreProperties;
- }
-
public FiniteDuration getShardTransactionIdleTimeout() {
return shardTransactionIdleTimeout;
}
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) {
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;
}
@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);
}
boolean getTransactionContextDebugEnabled();
+ @Deprecated(forRemoval = true)
int getMaxShardDataChangeExecutorPoolSize();
+ @Deprecated(forRemoval = true)
int getMaxShardDataChangeExecutorQueueSize();
+ @Deprecated(forRemoval = true)
int getMaxShardDataChangeListenerQueueSize();
+ @Deprecated(forRemoval = true)
int getMaxShardDataStoreExecutorQueueSize();
int getMaximumMessageSliceSize();
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;
}
}
@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
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;
/**
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());
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);
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
assertEquals(33, operContext.getShardTransactionIdleTimeout().toMinutes());
assertTrue(operContext.isPersistent());
- assertEquals(333, operContext.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
final DatastoreContextIntrospector configIntrospector = INTROSPECTOR_FACTORY.newInstance(CONFIGURATION);
updated = configIntrospector.update(properties);
assertEquals(44, configContext.getShardTransactionIdleTimeout().toMinutes());
assertFalse(configContext.isPersistent());
- assertEquals(444, configContext.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
}
@Test
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());
}
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,
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());