Search in sources :

Example 1 with AddPrefixShardReplicaInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.AddPrefixShardReplicaInputBuilder in project controller by opendaylight.

the class ClusterAdminRpcServiceTest method addPrefixShardReplica.

private void addPrefixShardReplica(final MemberNode memberNode, final InstanceIdentifier<?> identifier, final BindingNormalizedNodeSerializer serializer, final String shardName, final String... peerMemberNames) throws Exception {
    final AddPrefixShardReplicaInput input = new AddPrefixShardReplicaInputBuilder().setShardPrefix(identifier).setDataStoreType(DataStoreType.Config).build();
    final ClusterAdminRpcService service = new ClusterAdminRpcService(memberNode.configDataStore(), memberNode.operDataStore(), serializer);
    final RpcResult<Void> rpcResult = service.addPrefixShardReplica(input).get(10, TimeUnit.SECONDS);
    verifySuccessfulRpcResult(rpcResult);
    verifyRaftPeersPresent(memberNode.configDataStore(), shardName, peerMemberNames);
    Optional<ActorRef> optional = memberNode.configDataStore().getActorContext().findLocalShard(shardName);
    assertTrue("Replica shard not present", optional.isPresent());
}
Also used : AddPrefixShardReplicaInput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.AddPrefixShardReplicaInput) AddPrefixShardReplicaInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.AddPrefixShardReplicaInputBuilder) ActorRef(akka.actor.ActorRef)

Aggregations

ActorRef (akka.actor.ActorRef)1 AddPrefixShardReplicaInput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.AddPrefixShardReplicaInput)1 AddPrefixShardReplicaInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.AddPrefixShardReplicaInputBuilder)1