import org.opendaylight.controller.cluster.datastore.DatastoreContext;
import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface;
+import org.opendaylight.controller.cluster.datastore.compat.LegacyDOMStoreAdapter;
import org.opendaylight.controller.config.api.DependencyResolver;
import org.opendaylight.controller.config.api.ModuleIdentifier;
import org.opendaylight.controller.config.api.osgi.WaitingServiceTracker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.osgi.framework.BundleContext;
+@Deprecated
public class DistributedConfigDataStoreProviderModule extends AbstractDistributedConfigDataStoreProviderModule {
private BundleContext bundleContext;
public DistributedConfigDataStoreProviderModule(
- org.opendaylight.controller.config.api.ModuleIdentifier identifier,
- org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
- public DistributedConfigDataStoreProviderModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver,
- DistributedConfigDataStoreProviderModule oldModule, AutoCloseable oldInstance) {
+ public DistributedConfigDataStoreProviderModule(final ModuleIdentifier identifier,
+ final DependencyResolver dependencyResolver, final DistributedConfigDataStoreProviderModule oldModule,
+ final AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}
}
@Override
- public boolean canReuseInstance(AbstractDistributedConfigDataStoreProviderModule oldModule) {
+ public boolean canReuseInstance(final AbstractDistributedConfigDataStoreProviderModule oldModule) {
return true;
}
WaitingServiceTracker<DistributedDataStoreInterface> tracker = WaitingServiceTracker.create(
DistributedDataStoreInterface.class, bundleContext, "(type=distributed-config)");
DistributedDataStoreInterface delegate = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
- return new ForwardingDistributedDataStore(delegate, tracker);
+ return new LegacyDOMStoreAdapter(delegate) {
+ @Override
+ public void close() {
+ tracker.close();
+ }
+ };
}
public static DatastoreContext newDatastoreContext() {
return newDatastoreContext(null);
}
- private static DatastoreContext newDatastoreContext(ConfigProperties inProps) {
+ private static DatastoreContext newDatastoreContext(final ConfigProperties inProps) {
ConfigProperties props = inProps;
if (props == null) {
props = new ConfigProperties();
return DatastoreContext.newBuilder()
.logicalStoreType(LogicalDatastoreType.CONFIGURATION)
+ .tempFileDirectory("./data")
+ .fileBackedStreamingThresholdInMegabytes(props.getFileBackedStreamingThresholdInMegabytes()
+ .getValue().intValue())
.maxShardDataChangeExecutorPoolSize(props.getMaxShardDataChangeExecutorPoolSize().getValue().intValue())
.maxShardDataChangeExecutorQueueSize(props.getMaxShardDataChangeExecutorQueueSize()
.getValue().intValue())
props.getShardCommitQueueExpiryTimeoutInSeconds().getValue().intValue())
.transactionDebugContextEnabled(props.getTransactionDebugContextEnabled())
.customRaftPolicyImplementation(props.getCustomRaftPolicyImplementation())
- .shardSnapshotChunkSize(props.getShardSnapshotChunkSize().getValue().intValue())
+ .maximumMessageSliceSize(props.getMaximumMessageSliceSize().getValue().intValue())
+ .useTellBasedProtocol(props.getUseTellBasedProtocol())
+ .syncIndexThreshold(props.getSyncIndexThreshold().getValue())
+ .backendAlivenessTimerIntervalInSeconds(props.getBackendAlivenessTimerIntervalInSeconds().getValue())
+ .frontendRequestTimeoutInSeconds(props.getFrontendRequestTimeoutInSeconds().getValue())
+ .frontendNoProgressTimeoutInSeconds(props.getFrontendNoProgressTimeoutInSeconds().getValue())
.build();
}
- public void setBundleContext(BundleContext bundleContext) {
+ public void setBundleContext(final BundleContext bundleContext) {
this.bundleContext = bundleContext;
}
}