X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FDatastoreContextTest.java;h=4d47f7fd516e57f9c980dcec855275263b8a43f4;hb=1413d39efa41e0b3926e400dbd7ef5e3fac694c2;hp=504618cd1fa94a777afe0252a60b2db0f3e317a7;hpb=b65f82f3c6e6e4c53ea2efa4dba30ddf82d61616;p=controller.git 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..4d47f7fd51 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 @@ -17,10 +17,12 @@ import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEF import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_MAX_MESSAGE_SLICE_SIZE; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_OPERATION_TIMEOUT_IN_MS; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_PERSISTENT; +import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_RECOVERY_SNAPSHOT_INTERVAL_SECONDS; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_ELECTION_TIMEOUT_FACTOR; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_INITIALIZATION_TIMEOUT; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_LEADER_ELECTION_TIMEOUT; +import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD_PERCENTAGE; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_TX_COMMIT_QUEUE_CAPACITY; @@ -60,18 +62,12 @@ public class DatastoreContextTest { context.getShardRaftConfig().getIsolatedCheckIntervalInMillis()); assertEquals(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD_PERCENTAGE, context.getShardRaftConfig().getSnapshotDataThresholdPercentage()); + assertEquals(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD, + context.getShardRaftConfig().getSnapshotDataThreshold()); assertEquals(DEFAULT_SHARD_ELECTION_TIMEOUT_FACTOR, context.getShardRaftConfig().getElectionTimeoutFactor()); 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()); } @@ -85,6 +81,7 @@ public class DatastoreContextTest { builder.shardTransactionCommitTimeoutInSeconds(DEFAULT_SHARD_TX_COMMIT_TIMEOUT_IN_SECONDS + 1); builder.shardJournalRecoveryLogBatchSize(DEFAULT_JOURNAL_RECOVERY_BATCH_SIZE + 1); builder.shardSnapshotBatchCount(DEFAULT_SNAPSHOT_BATCH_COUNT + 1); + builder.recoverySnapshotIntervalSeconds(DEFAULT_RECOVERY_SNAPSHOT_INTERVAL_SECONDS + 1); builder.shardHeartbeatIntervalInMillis(DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS + 1); builder.shardTransactionCommitQueueCapacity(DEFAULT_SHARD_TX_COMMIT_QUEUE_CAPACITY + 1); builder.shardInitializationTimeout(DEFAULT_SHARD_INITIALIZATION_TIMEOUT @@ -97,6 +94,7 @@ public class DatastoreContextTest { builder.persistent(!DEFAULT_PERSISTENT); builder.shardIsolatedLeaderCheckIntervalInMillis(DEFAULT_ISOLATED_LEADER_CHECK_INTERVAL_IN_MILLIS + 1); builder.shardSnapshotDataThresholdPercentage(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD_PERCENTAGE + 1); + builder.shardSnapshotDataThreshold(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD + 1); builder.shardElectionTimeoutFactor(DEFAULT_SHARD_ELECTION_TIMEOUT_FACTOR + 1); builder.transactionCreationInitialRateLimit(DEFAULT_TX_CREATION_INITIAL_RATE_LIMIT + 1); builder.shardBatchedModificationCount(DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT + 1); @@ -124,7 +122,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, @@ -134,6 +132,8 @@ public class DatastoreContextTest { assertEquals(DEFAULT_JOURNAL_RECOVERY_BATCH_SIZE + 1, context.getShardRaftConfig().getJournalRecoveryLogBatchSize()); assertEquals(DEFAULT_SNAPSHOT_BATCH_COUNT + 1, context.getShardRaftConfig().getSnapshotBatchCount()); + assertEquals(DEFAULT_RECOVERY_SNAPSHOT_INTERVAL_SECONDS + 1, + context.getShardRaftConfig().getRecoverySnapshotIntervalSeconds()); assertEquals(DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS + 1, context.getShardRaftConfig().getHeartBeatInterval().length()); assertEquals(DEFAULT_SHARD_TX_COMMIT_QUEUE_CAPACITY + 1, context.getShardTransactionCommitQueueCapacity()); @@ -149,19 +149,13 @@ public class DatastoreContextTest { context.getShardRaftConfig().getIsolatedCheckIntervalInMillis()); assertEquals(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD_PERCENTAGE + 1, context.getShardRaftConfig().getSnapshotDataThresholdPercentage()); + assertEquals(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD + 1, + context.getShardRaftConfig().getSnapshotDataThreshold()); assertEquals(DEFAULT_SHARD_ELECTION_TIMEOUT_FACTOR + 1, context.getShardRaftConfig().getElectionTimeoutFactor()); 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());