@Override
  public void deleteRangerPolicy(String policyName, String baseUrl, String rangerHiveServiceName,
                                 HiveConf hiveConf) throws Exception {
    String finalUrl = getRangerDeleteUrl(baseUrl, policyName, rangerHiveServiceName);
    LOG.debug("URL to delete policy on target Ranger: {}", finalUrl);
    Retryable retryable = Retryable.builder()
            .withHiveConf(hiveConf).withFailOnException(RuntimeException.class)
            .withRetryOnException(Exception.class).build();
    try {
      retryable.executeCallable(() -> {
        ClientResponse clientResp = null;
        WebResource.Builder builder = getRangerResourceBuilder(finalUrl, hiveConf);
        clientResp = builder.delete(ClientResponse.class);
        if (clientResp != null) {
          switch (clientResp.getStatus()) {
            case HttpServletResponse.SC_NO_CONTENT:
              LOG.debug("Ranger policy: {} deleted successfully", policyName);
              break;
            case HttpServletResponse.SC_NOT_FOUND:
              LOG.debug("Ranger policy: {} not found.", policyName);
              break;
            case HttpServletResponse.SC_FORBIDDEN:
              throw new RuntimeException(ErrorMsg.RANGER_AUTHORIZATION_FAILED.getMsg());
            case HttpServletResponse.SC_UNAUTHORIZED:
              throw new RuntimeException(ErrorMsg.RANGER_AUTHENTICATION_FAILED.getMsg());
            default:
              throw new SemanticException("Ranger policy deletion failed, Please refer target Ranger admin logs.");
          }
        }
        return null;
      });
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new SemanticException(ErrorMsg.REPL_RETRY_EXHAUSTED.format(e.getMessage()), e);
    }
  }
RangerRestClientImpl to connect to Ranger and export policies.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerRestClientImpl.java