Search in sources :

Example 1 with MakeLeaderLocalInputBuilder

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

the class ClusterAdminRpcServiceTest method doMakeShardLeaderLocal.

private static void doMakeShardLeaderLocal(final MemberNode memberNode, String shardName, String newLeader) throws Exception {
    ClusterAdminRpcService service = new ClusterAdminRpcService(memberNode.configDataStore(), memberNode.operDataStore(), null);
    final RpcResult<Void> rpcResult = service.makeLeaderLocal(new MakeLeaderLocalInputBuilder().setDataStoreType(DataStoreType.Config).setShardName(shardName).build()).get(10, TimeUnit.SECONDS);
    verifySuccessfulRpcResult(rpcResult);
    verifyRaftState(memberNode.configDataStore(), shardName, raftState -> assertThat(raftState.getLeader(), containsString(newLeader)));
}
Also used : MakeLeaderLocalInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.MakeLeaderLocalInputBuilder)

Aggregations

MakeLeaderLocalInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.MakeLeaderLocalInputBuilder)1