Search in sources :

Example 1 with ClientProtoUtils

use of org.apache.ratis.client.impl.ClientProtoUtils in project incubator-ratis by apache.

the class GrpcAdminProtocolService method groupManagement.

@Override
public void groupManagement(GroupManagementRequestProto proto, StreamObserver<RaftClientReplyProto> responseObserver) {
    final GroupManagementRequest request = ClientProtoUtils.toGroupManagementRequest(proto);
    GrpcUtil.asyncCall(responseObserver, () -> protocol.groupManagementAsync(request), ClientProtoUtils::toRaftClientReplyProto);
}
Also used : GroupManagementRequest(org.apache.ratis.protocol.GroupManagementRequest) ClientProtoUtils(org.apache.ratis.client.impl.ClientProtoUtils)

Example 2 with ClientProtoUtils

use of org.apache.ratis.client.impl.ClientProtoUtils in project incubator-ratis by apache.

the class GrpcAdminProtocolService method transferLeadership.

@Override
public void transferLeadership(TransferLeadershipRequestProto proto, StreamObserver<RaftClientReplyProto> responseObserver) {
    final TransferLeadershipRequest request = ClientProtoUtils.toTransferLeadershipRequest(proto);
    GrpcUtil.asyncCall(responseObserver, () -> protocol.transferLeadershipAsync(request), ClientProtoUtils::toRaftClientReplyProto);
}
Also used : TransferLeadershipRequest(org.apache.ratis.protocol.TransferLeadershipRequest) ClientProtoUtils(org.apache.ratis.client.impl.ClientProtoUtils)

Example 3 with ClientProtoUtils

use of org.apache.ratis.client.impl.ClientProtoUtils in project incubator-ratis by apache.

the class GrpcAdminProtocolService method groupInfo.

@Override
public void groupInfo(GroupInfoRequestProto proto, StreamObserver<GroupInfoReplyProto> responseObserver) {
    final GroupInfoRequest request = ClientProtoUtils.toGroupInfoRequest(proto);
    GrpcUtil.asyncCall(responseObserver, () -> protocol.getGroupInfoAsync(request), ClientProtoUtils::toGroupInfoReplyProto);
}
Also used : GroupInfoRequest(org.apache.ratis.protocol.GroupInfoRequest) ClientProtoUtils(org.apache.ratis.client.impl.ClientProtoUtils)

Example 4 with ClientProtoUtils

use of org.apache.ratis.client.impl.ClientProtoUtils in project incubator-ratis by apache.

the class GrpcAdminProtocolService method leaderElectionManagement.

@Override
public void leaderElectionManagement(LeaderElectionManagementRequestProto proto, StreamObserver<RaftClientReplyProto> responseObserver) {
    final LeaderElectionManagementRequest request = ClientProtoUtils.toLeaderElectionManagementRequest(proto);
    GrpcUtil.asyncCall(responseObserver, () -> protocol.leaderElectionManagementAsync(request), ClientProtoUtils::toRaftClientReplyProto);
}
Also used : LeaderElectionManagementRequest(org.apache.ratis.protocol.LeaderElectionManagementRequest) ClientProtoUtils(org.apache.ratis.client.impl.ClientProtoUtils)

Example 5 with ClientProtoUtils

use of org.apache.ratis.client.impl.ClientProtoUtils in project incubator-ratis by apache.

the class GrpcAdminProtocolService method setConfiguration.

@Override
public void setConfiguration(SetConfigurationRequestProto proto, StreamObserver<RaftClientReplyProto> responseObserver) {
    final SetConfigurationRequest request = ClientProtoUtils.toSetConfigurationRequest(proto);
    GrpcUtil.asyncCall(responseObserver, () -> protocol.setConfigurationAsync(request), ClientProtoUtils::toRaftClientReplyProto);
}
Also used : ClientProtoUtils(org.apache.ratis.client.impl.ClientProtoUtils) SetConfigurationRequest(org.apache.ratis.protocol.SetConfigurationRequest)

Aggregations

ClientProtoUtils (org.apache.ratis.client.impl.ClientProtoUtils)11 CompletableFuture (java.util.concurrent.CompletableFuture)2 IOException (java.io.IOException)1 InterruptedIOException (java.io.InterruptedIOException)1 RaftClientReplyProto (org.apache.ratis.proto.RaftProtos.RaftClientReplyProto)1 RaftClientRequestProto (org.apache.ratis.proto.RaftProtos.RaftClientRequestProto)1 GroupInfoRequest (org.apache.ratis.protocol.GroupInfoRequest)1 GroupListRequest (org.apache.ratis.protocol.GroupListRequest)1 GroupManagementRequest (org.apache.ratis.protocol.GroupManagementRequest)1 LeaderElectionManagementRequest (org.apache.ratis.protocol.LeaderElectionManagementRequest)1 ReinitializeRequest (org.apache.ratis.protocol.ReinitializeRequest)1 ServerInformationRequest (org.apache.ratis.protocol.ServerInformationRequest)1 SetConfigurationRequest (org.apache.ratis.protocol.SetConfigurationRequest)1 SnapshotManagementRequest (org.apache.ratis.protocol.SnapshotManagementRequest)1 TransferLeadershipRequest (org.apache.ratis.protocol.TransferLeadershipRequest)1 AlreadyClosedException (org.apache.ratis.protocol.exceptions.AlreadyClosedException)1 RaftClientReplyProto (org.apache.ratis.shaded.proto.RaftProtos.RaftClientReplyProto)1 RaftClientRequestProto (org.apache.ratis.shaded.proto.RaftProtos.RaftClientRequestProto)1