use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.AddShardReplicaInputBuilder in project controller by opendaylight.
the class ClusterAdminRpcServiceTest method testAddShardReplicaFailures.
@Test
public void testAddShardReplicaFailures() throws Exception {
String name = "testAddShardReplicaFailures";
MemberNode memberNode = MemberNode.builder(memberNodes).akkaConfig("Member1").testName(name).moduleShardsConfig("module-shards-cars-member-1.conf").build();
ClusterAdminRpcService service = new ClusterAdminRpcService(memberNode.configDataStore(), memberNode.operDataStore(), null);
RpcResult<Void> rpcResult = service.addShardReplica(new AddShardReplicaInputBuilder().setDataStoreType(DataStoreType.Config).build()).get(10, TimeUnit.SECONDS);
verifyFailedRpcResult(rpcResult);
rpcResult = service.addShardReplica(new AddShardReplicaInputBuilder().setShardName("cars").build()).get(10, TimeUnit.SECONDS);
verifyFailedRpcResult(rpcResult);
rpcResult = service.addShardReplica(new AddShardReplicaInputBuilder().setShardName("people").setDataStoreType(DataStoreType.Config).build()).get(10, TimeUnit.SECONDS);
verifyFailedRpcResult(rpcResult);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.AddShardReplicaInputBuilder in project controller by opendaylight.
the class ClusterAdminRpcServiceTest method doAddShardReplica.
private static void doAddShardReplica(MemberNode memberNode, String shardName, String... peerMemberNames) throws Exception {
memberNode.waitForMembersUp(peerMemberNames);
ClusterAdminRpcService service = new ClusterAdminRpcService(memberNode.configDataStore(), memberNode.operDataStore(), null);
RpcResult<Void> rpcResult = service.addShardReplica(new AddShardReplicaInputBuilder().setShardName(shardName).setDataStoreType(DataStoreType.Config).build()).get(10, TimeUnit.SECONDS);
verifySuccessfulRpcResult(rpcResult);
verifyRaftPeersPresent(memberNode.configDataStore(), shardName, peerMemberNames);
Optional<ActorRef> optional = memberNode.operDataStore().getActorContext().findLocalShard(shardName);
assertFalse("Oper shard present", optional.isPresent());
rpcResult = service.addShardReplica(new AddShardReplicaInputBuilder().setShardName(shardName).setDataStoreType(DataStoreType.Operational).build()).get(10, TimeUnit.SECONDS);
verifySuccessfulRpcResult(rpcResult);
verifyRaftPeersPresent(memberNode.operDataStore(), shardName, peerMemberNames);
}
Aggregations