import org.opendaylight.controller.cluster.datastore.ClusterWrapper;
import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
import org.opendaylight.controller.cluster.datastore.DatastoreContext;
+import org.opendaylight.controller.cluster.datastore.DatastoreContextFactory;
import org.opendaylight.controller.cluster.datastore.config.Configuration;
import org.opendaylight.controller.cluster.datastore.exceptions.LocalShardNotFoundException;
import org.opendaylight.controller.cluster.datastore.exceptions.NoShardLeaderException;
}
}
- public void setDatastoreContext(DatastoreContext context) {
- this.datastoreContext = context;
+ public void setDatastoreContext(DatastoreContextFactory contextFactory) {
+ this.datastoreContext = contextFactory.getBaseDatastoreContext();
setCachedProperties();
// We write the 'updated' volatile to trigger a write memory barrier so that the writes above
updated = true;
if(shardManager != null) {
- shardManager.tell(context, ActorRef.noSender());
+ shardManager.tell(contextFactory, ActorRef.noSender());
}
}
* @return
*/
public Timer getOperationTimer(String operationName){
- return getOperationTimer(datastoreContext.getDataStoreType(), operationName);
+ return getOperationTimer(datastoreContext.getDataStoreName(), operationName);
}
public Timer getOperationTimer(String dataStoreType, String operationName){
return metricRegistry.timer(rate);
}
+ /**
+ * Get the name of the data store to which this ActorContext belongs
+ *
+ * @return
+ */
+ public String getDataStoreName() {
+ return datastoreContext.getDataStoreName();
+ }
+
/**
* Get the type of the data store to which this ActorContext belongs
*
* @return
+ * @deprecated Use {@link #getDataStoreName()} instead.
*/
public String getDataStoreType() {
- return datastoreContext.getDataStoreType();
+ return datastoreContext.getDataStoreName();
}
/**