use of com.alipay.sofa.jraft.test.atomic.server.AtomicRangeGroup in project sofa-jraft by sofastack.
the class BaseAsyncUserProcessor method handleRequest.
@Override
public void handleRequest(final RpcContext rpcCtx, final T request) {
final AtomicRangeGroup group = server.getGroupBykey(request.getKey());
if (!group.getFsm().isLeader()) {
rpcCtx.sendResponse(group.redirect());
return;
}
final CommandType cmdType = getCmdType();
final Task task = createTask(rpcCtx, request, cmdType);
group.getNode().apply(task);
}
Aggregations