* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.controller.cluster.datastore;
import akka.util.Timeout;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
-import org.apache.commons.lang3.text.WordUtils;
+import org.apache.commons.text.WordUtils;
import org.opendaylight.controller.cluster.access.client.AbstractClientConnection;
import org.opendaylight.controller.cluster.access.client.ClientActorConfig;
import org.opendaylight.controller.cluster.common.actor.AkkaConfigurationReader;
import org.opendaylight.controller.cluster.raft.ConfigParams;
import org.opendaylight.controller.cluster.raft.DefaultConfigParamsImpl;
import org.opendaylight.controller.cluster.raft.PeerAddressResolver;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties;
+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;
*
* @author Thomas Pantelis
*/
+// Noo-final for mocking
public class DatastoreContext implements ClientActorConfig {
public static final String METRICS_DOMAIN = "org.opendaylight.controller.cluster.datastore";
return GLOBAL_DATASTORE_NAMES;
}
- private DatastoreContext() {
+ DatastoreContext() {
setShardJournalRecoveryLogBatchSize(DEFAULT_JOURNAL_RECOVERY_BATCH_SIZE);
setSnapshotBatchCount(DEFAULT_SNAPSHOT_BATCH_COUNT);
setHeartbeatInterval(DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS);
private int maxShardDataStoreExecutorQueueSize =
InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE;
- private Builder(final DatastoreContext datastoreContext) {
+ Builder(final DatastoreContext datastoreContext) {
this.datastoreContext = datastoreContext;
if (datastoreContext.getDataStoreProperties() != null) {
return this;
}
- public Builder maxShardDataChangeExecutorPoolSize(final int maxShardDataChangeExecutorPoolSize) {
- this.maxShardDataChangeExecutorPoolSize = maxShardDataChangeExecutorPoolSize;
+ public Builder maxShardDataChangeExecutorPoolSize(final int newMaxShardDataChangeExecutorPoolSize) {
+ this.maxShardDataChangeExecutorPoolSize = newMaxShardDataChangeExecutorPoolSize;
return this;
}
- public Builder maxShardDataChangeExecutorQueueSize(final int maxShardDataChangeExecutorQueueSize) {
- this.maxShardDataChangeExecutorQueueSize = maxShardDataChangeExecutorQueueSize;
+ public Builder maxShardDataChangeExecutorQueueSize(final int newMaxShardDataChangeExecutorQueueSize) {
+ this.maxShardDataChangeExecutorQueueSize = newMaxShardDataChangeExecutorQueueSize;
return this;
}
- public Builder maxShardDataChangeListenerQueueSize(final int maxShardDataChangeListenerQueueSize) {
- this.maxShardDataChangeListenerQueueSize = maxShardDataChangeListenerQueueSize;
+ public Builder maxShardDataChangeListenerQueueSize(final int newMaxShardDataChangeListenerQueueSize) {
+ this.maxShardDataChangeListenerQueueSize = newMaxShardDataChangeListenerQueueSize;
return this;
}
- public Builder maxShardDataStoreExecutorQueueSize(final int maxShardDataStoreExecutorQueueSize) {
- this.maxShardDataStoreExecutorQueueSize = maxShardDataStoreExecutorQueueSize;
+ public Builder maxShardDataStoreExecutorQueueSize(final int newMaxShardDataStoreExecutorQueueSize) {
+ this.maxShardDataStoreExecutorQueueSize = newMaxShardDataStoreExecutorQueueSize;
return this;
}
@Override
public DatastoreContext build() {
- datastoreContext.dataStoreProperties = InMemoryDOMDataStoreConfigProperties.create(
- maxShardDataChangeExecutorPoolSize, maxShardDataChangeExecutorQueueSize,
- maxShardDataChangeListenerQueueSize, maxShardDataStoreExecutorQueueSize);
+ datastoreContext.dataStoreProperties = InMemoryDOMDataStoreConfigProperties.builder()
+ .maxDataChangeExecutorPoolSize(maxShardDataChangeExecutorPoolSize)
+ .maxDataChangeExecutorQueueSize(maxShardDataChangeExecutorQueueSize)
+ .maxDataChangeListenerQueueSize(maxShardDataChangeListenerQueueSize)
+ .maxDataStoreExecutorQueueSize(maxShardDataStoreExecutorQueueSize)
+ .build();
if (datastoreContext.dataStoreName != null) {
GLOBAL_DATASTORE_NAMES.add(datastoreContext.dataStoreName);