use of org.opendaylight.controller.cluster.datastore.messages.PrimaryShardInfo in project controller by opendaylight.
the class AbstractClientHistoryTest method createActorContextMock.
protected static ActorContext createActorContextMock(final ActorSystem system, final ActorRef actor) {
final ActorContext mock = mock(ActorContext.class);
final Promise<PrimaryShardInfo> promise = new DefaultPromise<>();
final ActorSelection selection = system.actorSelection(actor.path());
final PrimaryShardInfo shardInfo = new PrimaryShardInfo(selection, (short) 0);
promise.success(shardInfo);
when(mock.findPrimaryShardAsync(any())).thenReturn(promise.future());
return mock;
}
use of org.opendaylight.controller.cluster.datastore.messages.PrimaryShardInfo in project controller by opendaylight.
the class AbstractDataStoreClientBehaviorTest method createActorContextMock.
private static ActorContext createActorContextMock(final ActorSystem system, final ActorRef actor) {
final ActorContext mock = mock(ActorContext.class);
final Promise<PrimaryShardInfo> promise = new scala.concurrent.impl.Promise.DefaultPromise<>();
final ActorSelection selection = system.actorSelection(actor.path());
final PrimaryShardInfo shardInfo = new PrimaryShardInfo(selection, (short) 0);
promise.success(shardInfo);
when(mock.findPrimaryShardAsync(SHARD)).thenReturn(promise.future());
return mock;
}
use of org.opendaylight.controller.cluster.datastore.messages.PrimaryShardInfo in project controller by opendaylight.
the class ActorContext method onPrimaryShardFound.
private PrimaryShardInfo onPrimaryShardFound(String shardName, String primaryActorPath, short primaryVersion, DataTree localShardDataTree) {
ActorSelection actorSelection = actorSystem.actorSelection(primaryActorPath);
PrimaryShardInfo info = localShardDataTree == null ? new PrimaryShardInfo(actorSelection, primaryVersion) : new PrimaryShardInfo(actorSelection, primaryVersion, localShardDataTree);
primaryShardInfoCache.putSuccessful(shardName, info);
return info;
}
Aggregations