import java.util.Hashtable;
import java.util.Map;
import org.checkerframework.checker.lock.qual.GuardedBy;
+import org.gaul.modernizer_maven_annotations.SuppressModernizer;
import org.opendaylight.controller.cluster.ActorSystemProvider;
import org.opendaylight.controller.cluster.datastore.config.Configuration;
import org.opendaylight.controller.cluster.datastore.config.ConfigurationImpl;
private final String serviceType;
@GuardedBy("this")
- private ComponentInstance component;
+ private ComponentInstance<OSGiDOMStore> component;
@GuardedBy("this")
private boolean stopped;
synchronized void updateProperties(final Map<String, Object> properties) {
if (introspector.update(properties)) {
+ LOG.info("Distributed Datastore type {} updating context", datastoreType);
datastore.onDatastoreContextUpdated(introspector.newContextFactory());
}
}
}
@Override
+ @SuppressModernizer
public void onSuccess(final Object result) {
LOG.debug("Distributed Datastore type {} reached initial settle", datastoreType);
@Reference
ModuleShardConfigProvider configProvider = null;
@Reference(target = "(component.factory=" + OSGiDOMStore.FACTORY_NAME + ")")
- ComponentFactory datastoreFactory = null;
+ ComponentFactory<OSGiDOMStore> datastoreFactory = null;
private DatastoreState configDatastore;
private DatastoreState operDatastore;
@Activate
void activate(final Map<String, Object> properties) {
- configDatastore = createDatastore(LogicalDatastoreType.CONFIGURATION, "distributed-config", null);
- operDatastore = createDatastore(LogicalDatastoreType.OPERATIONAL, "distributed-operational",
+ configDatastore = createDatastore(LogicalDatastoreType.CONFIGURATION, "distributed-config", properties, null);
+ operDatastore = createDatastore(LogicalDatastoreType.OPERATIONAL, "distributed-operational", properties,
new ConfigurationImpl(configProvider));
- modified(properties);
}
@Modified
}
private DatastoreState createDatastore(final LogicalDatastoreType datastoreType, final String serviceType,
- final Configuration config) {
+ final Map<String, Object> properties, final Configuration config) {
LOG.info("Distributed Datastore type {} starting", datastoreType);
- final DatastoreContextIntrospector introspector = introspectorFactory.newInstance(datastoreType);
+ final DatastoreContextIntrospector introspector = introspectorFactory.newInstance(datastoreType, properties);
final AbstractDataStore datastore = DistributedDataStoreFactory.createInstance(actorSystemProvider,
introspector.getContext(), introspector, snapshotRestore, config);
datastore.setCloseable(schemaService.registerSchemaContextListener(datastore));