class HTTPBulkLoader {

  protected BulkableAction<DocumentResult> convertToJestAction(ActionRequest req) {
    BulkableAction<DocumentResult> action;
    switch (req.key.getAction()) {
      case INDEX:
        action = getIndexAction(req);
        break;
      case UPDATE:
        action = getUpdateAction(req);
        break;
      case DELETE:
        action = getDeleteAction(req);
        break;
      default:
        throw new IllegalStateException("Unknown action: " + req.key.getAction());
    }
    return action;
  }

  public  HTTPBulkLoader(Config config, JestClient client, Optional<Consumer<BulkReport>> onFlushOpt);

}