public void cancelRunningStatement()

in asterixdb-jdbc/asterix-jdbc-driver/src/main/java/org/apache/asterix/jdbc/ADBProtocol.java [380:405]


    public void cancelRunningStatement(UUID executionId) throws SQLException {
        HttpDelete httpDelete;
        try {
            URIBuilder uriBuilder = new URIBuilder(activeRequestsEndpoint);
            uriBuilder.setParameter(CLIENT_CONTEXT_ID, String.valueOf(executionId));
            httpDelete = new HttpDelete(uriBuilder.build());
        } catch (URISyntaxException e) {
            throw getErrorReporter().errorInRequestURIGeneration(e);
        }

        try (CloseableHttpResponse httpResponse = httpClient.execute(httpDelete, httpClientContext)) {
            int httpStatus = httpResponse.getStatusLine().getStatusCode();
            switch (httpStatus) {
                case HttpStatus.SC_OK:
                case HttpStatus.SC_NOT_FOUND:
                    break;
                case HttpStatus.SC_UNAUTHORIZED:
                case HttpStatus.SC_FORBIDDEN:
                    throw getErrorReporter().errorAuth();
                default:
                    throw getErrorReporter().errorInProtocol(httpResponse.getStatusLine().toString());
            }
        } catch (IOException e) {
            throw getErrorReporter().errorInConnection(e);
        }
    }