@Override
    public void handleRequest(final RpcContext rpcCtx, final T request) {
        Requires.requireNonNull(request, "request");
        final RequestProcessClosure<BaseRequest, BaseResponse> closure = new RequestProcessClosure<>(request, rpcCtx);
        switch (request.magic()) {
            case BaseRequest.STORE_HEARTBEAT:
                this.placementDriverService.handleStoreHeartbeatRequest((StoreHeartbeatRequest) request, closure);
                break;
            case BaseRequest.REGION_HEARTBEAT:
                this.placementDriverService.handleRegionHeartbeatRequest((RegionHeartbeatRequest) request, closure);
                break;
            case BaseRequest.GET_CLUSTER_INFO:
                this.placementDriverService.handleGetClusterInfoRequest((GetClusterInfoRequest) request, closure);
                break;
            case BaseRequest.GET_STORE_INFO:
                this.placementDriverService.handleGetStoreInfoRequest((GetStoreInfoRequest) request, closure);
                break;
            case BaseRequest.SET_STORE_INFO:
                this.placementDriverService.handleSetStoreInfoRequest((SetStoreInfoRequest) request, closure);
                break;
            case BaseRequest.GET_STORE_ID:
                this.placementDriverService.handleGetStoreIdRequest((GetStoreIdRequest) request, closure);
                break;
            case BaseRequest.CREATE_REGION_ID:
                this.placementDriverService.handleCreateRegionIdRequest((CreateRegionIdRequest) request, closure);
                break;
            default:
                throw new RheaRuntimeException("Unsupported request type: " + request.getClass().getName());
        }
    }
The PD server does not actively push information to any RheaKV-node,
and all information about the cluster is reported by the RheaKV-node.

<pre>
PD server needs to handle two types of heartbeats:
 1. One case is the heartbeat of 'Store'. The PD is processed in the
     'handleStoreHeartbeat' method.  The main task is to save the
     state of current 'Store', including the number of regions, and
     how many region-leader in the 'Store', etc. This information will
     be used as scheduling reference.

 2. The other case is the heartbeat reported by the region-leader. The
     PD is processed in the 'handleRegionHeartbeat' method. Note that
     only the region-leader can report the 'Region' information, and
     the flower cant not.
</pre>

@author jiachun.fjc
jraft-rheakv/rheakv-pd/src/main/java/com/alipay/sofa/jraft/rhea/PlacementDriverProcessor.java