import java.util.Set;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnull;
+import org.opendaylight.controller.cluster.ActorSystemProvider;
import org.opendaylight.controller.cluster.access.concepts.MemberName;
import org.opendaylight.controller.cluster.databroker.actors.dds.DataStoreClient;
import org.opendaylight.controller.cluster.databroker.actors.dds.SimpleDataStoreClientActor;
private final EnumMap<LogicalDatastoreType, DistributedShardRegistration> defaultShardRegistrations =
new EnumMap<>(LogicalDatastoreType.class);
- public DistributedShardedDOMDataTree(final ActorSystem actorSystem,
+ public DistributedShardedDOMDataTree(final ActorSystemProvider actorSystemProvider,
final DistributedDataStore distributedOperDatastore,
final DistributedDataStore distributedConfigDatastore) {
- this.actorSystem = Preconditions.checkNotNull(actorSystem);
+ this.actorSystem = Preconditions.checkNotNull(actorSystemProvider).getActorSystem();
this.distributedOperDatastore = Preconditions.checkNotNull(distributedOperDatastore);
this.distributedConfigDatastore = Preconditions.checkNotNull(distributedConfigDatastore);
shardedDOMDataTree = new ShardedDOMDataTree();
final T listener, final Collection<DOMDataTreeIdentifier> subtrees,
final boolean allowRxMerges, final Collection<DOMDataTreeProducer> producers)
throws DOMDataTreeLoopException {
-
- throw new UnsupportedOperationException("Not implemented");
+ return shardedDOMDataTree.registerListener(listener, subtrees, allowRxMerges, producers);
}
@Nonnull
private DistributedShardRegistration initDefaultShard(final LogicalDatastoreType logicalDatastoreType)
throws DOMDataTreeProducerException, DOMDataTreeShardingConflictException {
final Collection<Member> members = JavaConverters.asJavaCollectionConverter(
- Cluster.get(actorSystem).state().members()).asJavaCollection();
+ Cluster.get(actorSystem).state().members()).asJavaCollection();
final Collection<MemberName> names = Collections2.transform(members,
m -> MemberName.forName(m.roles().iterator().next()));