Package io.airlift.http.client.StatusResponseHandler

Examples of io.airlift.http.client.StatusResponseHandler.StatusResponse


        assertEquals(countPositions(pages), 0);

        assertQueryStatus(location, QueryState.FINISHED);

        // cancel the query
        StatusResponse cancelResponse = client.execute(prepareDelete().setUri(location).build(), createStatusResponseHandler());
        assertQueryStatus(location, QueryState.FINISHED);
        assertEquals(cancelResponse.getStatusCode(), HttpStatus.NO_CONTENT.code());
    }
View Full Code Here


        assertEquals(countPositions(pages), 0);

        assertQueryStatus(location, QueryState.FINISHED);

        // cancel the query
        StatusResponse cancelResponse = client.execute(prepareDelete().setUri(location).build(), createStatusResponseHandler());
        assertQueryStatus(location, QueryState.FINISHED);
        assertEquals(cancelResponse.getStatusCode(), HttpStatus.NO_CONTENT.code());
    }
View Full Code Here

        }

        public void execute(String query)
        {
            Request request = buildQueryRequest(session, query);
            StatusResponse response = httpClient.execute(request, createStatusResponseHandler());
            if (response.getStatusCode() != 200) {
                throw new RuntimeException("Query failed: [" + response.getStatusCode() + "] " + response.getStatusMessage());
            }
        }
View Full Code Here

        assertEquals(countPositions(pages), 0);

        assertQueryStatus(location, QueryState.FINISHED);

        // cancel the query
        StatusResponse cancelResponse = client.execute(prepareDelete().setUri(location).build(), createStatusResponseHandler());
        assertQueryStatus(location, QueryState.FINISHED);
        assertEquals(cancelResponse.getStatusCode(), HttpStatus.NO_CONTENT.code());
    }
View Full Code Here

        Request request = prepareDelete()
                .setHeader(USER_AGENT, USER_AGENT_VALUE)
                .setUri(uri)
                .build();
        StatusResponse status = httpClient.execute(request, createStatusResponseHandler());
        return familyForStatusCode(status.getStatusCode()) == Family.SUCCESSFUL;
    }
View Full Code Here

        private boolean dropShardRequest()
        {
            URI shardUri = uriAppendPaths(node.getHttpUri(), "/v1/shard/" + shardId);
            Request request = Builder.prepareDelete().setUri(shardUri).build();

            StatusResponse response;
            try {
                response = httpClient.execute(request, createStatusResponseHandler());
            }
            catch (RuntimeException e) {
                log.warn("drop request failed: %s. Cause: %s", shardId, e.getMessage());
                return false;
            }

            if (response.getStatusCode() != HttpStatus.ACCEPTED.code()) {
                log.warn("unexpected response status: %s: %s", shardId, response.getStatusCode());
                return false;
            }

            log.debug("initiated drop shard: %s", shardId);
            return true;
View Full Code Here

        }

        public void execute(String query)
        {
            Request request = buildQueryRequest(session, query);
            StatusResponse response = httpClient.execute(request, createStatusResponseHandler());
            if (response.getStatusCode() != 200) {
                throw new RuntimeException("Query failed: [" + response.getStatusCode() + "] " + response.getStatusMessage());
            }
        }
View Full Code Here

        assertEquals(countPositions(pages), 0);

        assertQueryStatus(location, QueryState.FINISHED);

        // cancel the query
        StatusResponse cancelResponse = client.execute(prepareDelete().setUri(location).build(), createStatusResponseHandler());
        assertQueryStatus(location, QueryState.FINISHED);
        assertEquals(cancelResponse.getStatusCode(), HttpStatus.NO_CONTENT.code());
    }
View Full Code Here

        Request request = prepareDelete()
                .setHeader(USER_AGENT, USER_AGENT_VALUE)
                .setUri(uri)
                .build();
        StatusResponse status = httpClient.execute(request, createStatusResponseHandler());
        return familyForStatusCode(status.getStatusCode()) == Family.SUCCESSFUL;
    }
View Full Code Here

        assertEquals(countPositions(pages), 0);

        assertQueryStatus(location, QueryState.FINISHED);

        // cancel the query
        StatusResponse cancelResponse = client.execute(prepareDelete().setUri(location).build(), createStatusResponseHandler());
        assertQueryStatus(location, QueryState.FINISHED);
        assertEquals(cancelResponse.getStatusCode(), HttpStatus.NO_CONTENT.code());
    }
View Full Code Here

TOP

Related Classes of io.airlift.http.client.StatusResponseHandler.StatusResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.