use of org.apache.ratis.protocol.GroupManagementRequest 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);
}
use of org.apache.ratis.protocol.GroupManagementRequest in project ozone by apache.
the class XceiverServerRatis method removeGroup.
@Override
public void removeGroup(HddsProtos.PipelineID pipelineId) throws IOException {
// if shouldDeleteRatisLogDirectory is set to false, the raft log
// directory will be renamed and kept aside for debugging.
// In case, its set to true, the raft log directory will be removed
GroupManagementRequest request = GroupManagementRequest.newRemove(clientId, server.getId(), nextCallId(), RaftGroupId.valueOf(PipelineID.getFromProtobuf(pipelineId).getId()), shouldDeleteRatisLogDirectory, !shouldDeleteRatisLogDirectory);
RaftClientReply reply;
try {
reply = server.groupManagement(request);
} catch (Exception e) {
throw new IOException(e.getMessage(), e);
}
processReply(reply);
}
use of org.apache.ratis.protocol.GroupManagementRequest in project ozone by apache.
the class XceiverServerRatis method addGroup.
@Override
public void addGroup(HddsProtos.PipelineID pipelineId, List<DatanodeDetails> peers, List<Integer> priorityList) throws IOException {
final PipelineID pipelineID = PipelineID.getFromProtobuf(pipelineId);
final RaftGroupId groupId = RaftGroupId.valueOf(pipelineID.getId());
final RaftGroup group = RatisHelper.newRaftGroup(groupId, peers, priorityList);
GroupManagementRequest request = GroupManagementRequest.newAdd(clientId, server.getId(), nextCallId(), group);
RaftClientReply reply;
LOG.debug("Received addGroup request for pipeline {}", pipelineID);
try {
reply = server.groupManagement(request);
} catch (Exception e) {
throw new IOException(e.getMessage(), e);
}
processReply(reply);
LOG.info("Created group {}", pipelineID);
}
Aggregations