use of com.facebook.airlift.http.client.Request in project presto by prestodb.
the class TestQueues method killQuery.
private void killQuery(String path) {
requireNonNull(path, "path is null");
Request request = preparePut().setUri(queryRunner.getCoordinator().resolve(path)).build();
Status status = fromStatusCode(client.execute(request, createStringResponseHandler()).getStatusCode());
assertEquals(Status.OK, status);
}
use of com.facebook.airlift.http.client.Request in project presto by prestodb.
the class TestQueryResource method getQueryResults.
private QueryResults getQueryResults(QueryResults queryResults) {
Request request = prepareGet().setHeader(PRESTO_USER, "user").setUri(queryResults.getNextUri()).build();
queryResults = client.execute(request, createJsonResponseHandler(jsonCodec(QueryResults.class)));
return queryResults;
}
use of com.facebook.airlift.http.client.Request in project presto by prestodb.
the class TestServerInfoResource method testGetServerStateWithoutRequiredCoordinators.
@Test(timeOut = 30_000, groups = { "getServerStateWithoutRequiredCoordinators" })
public void testGetServerStateWithoutRequiredCoordinators() {
TestingPrestoServer server = queryRunner.getCoordinator(0);
URI uri = uriBuilderFrom(server.getBaseUrl().resolve("/v1/info/state")).build();
Request request = prepareGet().setHeader(PRESTO_USER, "user").setUri(uri).build();
NodeState state = client.execute(request, createJsonResponseHandler(jsonCodec(NodeState.class)));
assertEquals(state, NodeState.INACTIVE);
}
use of com.facebook.airlift.http.client.Request in project presto by prestodb.
the class TestServerInfoResource method testGetServerStateWithoutRequiredResourceManagers.
@Test(timeOut = 30_000, groups = { "getServerStateWithoutRequiredResourceManagers" })
public void testGetServerStateWithoutRequiredResourceManagers() {
TestingPrestoServer server = queryRunner.getCoordinator(0);
URI uri = uriBuilderFrom(server.getBaseUrl().resolve("/v1/info/state")).build();
Request request = prepareGet().setHeader(PRESTO_USER, "user").setUri(uri).build();
NodeState state = client.execute(request, createJsonResponseHandler(jsonCodec(NodeState.class)));
assertEquals(state, NodeState.INACTIVE);
}
use of com.facebook.airlift.http.client.Request in project presto by prestodb.
the class TestServerInfoResource method testGetServerStateWithRequiredResourceManagerCoordinators.
@Test(timeOut = 30_000, groups = { "createQueryRunner" })
public void testGetServerStateWithRequiredResourceManagerCoordinators() {
TestingPrestoServer server = queryRunner.getCoordinator(0);
URI uri = uriBuilderFrom(server.getBaseUrl().resolve("/v1/info/state")).build();
Request request = prepareGet().setHeader(PRESTO_USER, "user").setUri(uri).build();
NodeState state = client.execute(request, createJsonResponseHandler(jsonCodec(NodeState.class)));
assertEquals(state, NodeState.ACTIVE);
}
Aggregations