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());
}
Aggregations