private boolean isRequestEnabled(RequestOrResponseType requestType, PartitionId id) {
    if (requestType.equals(RequestOrResponseType.UndeleteRequest) && !serverConfig.serverHandleUndeleteRequestEnabled) {
      return false;
    }
    Set<PartitionId> requestDisableInfo = requestsDisableInfo.get(requestType);
    // 1. check if request is disabled by admin request
    if (requestDisableInfo != null && requestDisableInfo.contains(id)) {
      return false;
    }
    if (serverConfig.serverValidateRequestBasedOnStoreState) {
      // 2. check if request is disabled due to current state of store
      Store store = storeManager.getStore(id);
      if (requestType == RequestOrResponseType.PutRequest && !PUT_ALLOWED_STORE_STATES.contains(
          store.getCurrentState())) {
        logger.warn("{} is not allowed because current state of store {} is {}", requestType, id,
            store.getCurrentState());
        return false;
      }
      if (UPDATE_REQUEST_TYPES.contains(requestType) && !UPDATE_ALLOWED_STORE_STATES.contains(
          store.getCurrentState())) {
        logger.warn("{} is not allowed because current state of store {} is {}", requestType, id,
            store.getCurrentState());
        return false;
      }
    }
    return true;
  }
@param requestType the {@link RequestOrResponseType} of the request.
@param id the partition id that the request is targeting.
@return {@code true} if the request is enabled. {@code false} otherwise.
ambry-server/src/main/java/com/github/ambry/server/AmbryServerRequests.java