X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FDatastoreContext.java;h=cf14ebe28d11b0c39e105ab6396f8aff4c37903a;hb=92f2f20ea21e4e92d6407cd687d7dc34854e330a;hp=8c01110f5caca322bcea29c83642ce9a4d6d0061;hpb=0e1824a2f55e35c5b6cfd0407e27dbe1a7c54cf3;p=controller.git 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 8c01110f5c..cf14ebe28d 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 @@ -36,7 +36,7 @@ public class DatastoreContext { public static final Duration DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT = Duration.create(10, TimeUnit.MINUTES); public static final int DEFAULT_OPERATION_TIMEOUT_IN_MS = 5000; public static final int DEFAULT_SHARD_TX_COMMIT_TIMEOUT_IN_SECONDS = 30; - public static final int DEFAULT_JOURNAL_RECOVERY_BATCH_SIZE = 1000; + public static final int DEFAULT_JOURNAL_RECOVERY_BATCH_SIZE = 1; public static final int DEFAULT_SNAPSHOT_BATCH_COUNT = 20000; public static final int DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS = 500; public static final int DEFAULT_ISOLATED_LEADER_CHECK_INTERVAL_IN_MILLIS = DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS * 10; @@ -53,7 +53,7 @@ public class DatastoreContext { public static final long DEFAULT_SHARD_COMMIT_QUEUE_EXPIRY_TIMEOUT_IN_MS = TimeUnit.MILLISECONDS.convert(2, TimeUnit.MINUTES); public static final int DEFAULT_SHARD_SNAPSHOT_CHUNK_SIZE = 2048000; - private static final Set globalDatastoreTypes = Sets.newConcurrentHashSet(); + private static final Set globalDatastoreNames = Sets.newConcurrentHashSet(); private InMemoryDOMDataStoreConfigProperties dataStoreProperties; private Duration shardTransactionIdleTimeout = DatastoreContext.DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT; @@ -75,8 +75,8 @@ public class DatastoreContext { private boolean transactionDebugContextEnabled = false; private String shardManagerPersistenceId; - public static Set getGlobalDatastoreTypes() { - return globalDatastoreTypes; + public static Set getGlobalDatastoreNames() { + return globalDatastoreNames; } private DatastoreContext() { @@ -220,6 +220,8 @@ public class DatastoreContext { } private void setSnapshotDataThresholdPercentage(int shardSnapshotDataThresholdPercentage) { + Preconditions.checkArgument(shardSnapshotDataThresholdPercentage >= 0 + && shardSnapshotDataThresholdPercentage <= 100); raftConfig.setSnapshotDataThresholdPercentage(shardSnapshotDataThresholdPercentage); } @@ -385,14 +387,6 @@ public class DatastoreContext { return this; } - /** - * @deprecated Use {@link #logicalStoreType(LogicalDatastoreType)} or {@link #dataStoreName(String)}. - */ - @Deprecated - public Builder dataStoreType(String dataStoreType){ - return dataStoreName(dataStoreType); - } - public Builder logicalStoreType(LogicalDatastoreType logicalStoreType){ datastoreContext.logicalStoreType = Preconditions.checkNotNull(logicalStoreType); @@ -478,7 +472,7 @@ public class DatastoreContext { maxShardDataChangeListenerQueueSize, maxShardDataStoreExecutorQueueSize); if(datastoreContext.dataStoreName != null) { - globalDatastoreTypes.add(datastoreContext.dataStoreName); + globalDatastoreNames.add(datastoreContext.dataStoreName); } return datastoreContext;