use of org.opendaylight.controller.cluster.sharding.messages.ProducerCreated in project controller by opendaylight.
the class DistributedShardedDOMDataTree method createProducer.
@Nonnull
@Override
public DOMDataTreeProducer createProducer(@Nonnull final Collection<DOMDataTreeIdentifier> subtrees) {
LOG.debug("{} - Creating producer for {}", memberName, subtrees);
final DOMDataTreeProducer producer = shardedDOMDataTree.createProducer(subtrees);
final Object response = distributedConfigDatastore.getActorContext().executeOperation(shardedDataTreeActor, new ProducerCreated(subtrees));
if (response == null) {
LOG.debug("{} - Received success from remote nodes, creating producer:{}", memberName, subtrees);
return new ProxyProducer(producer, subtrees, shardedDataTreeActor, distributedConfigDatastore.getActorContext(), shards);
}
closeProducer(producer);
if (response instanceof Throwable) {
Throwables.throwIfUnchecked((Throwable) response);
throw new RuntimeException((Throwable) response);
}
throw new RuntimeException("Unexpected response to create producer received." + response);
}
Aggregations