use of com.facebook.presto.server.thrift.ThriftServerInfoClient in project presto by prestodb.
the class TestThriftServerInfoIntegration method testServer.
@Test
public void testServer() {
AddressSelector<SimpleAddressSelector.SimpleAddress> addressSelector = new SimpleAddressSelector(ImmutableSet.of(HostAndPort.fromParts("localhost", thriftServerPort)), true);
try (DriftNettyMethodInvokerFactory<?> invokerFactory = createStaticDriftNettyMethodInvokerFactory(new DriftNettyClientConfig())) {
DriftClientFactory clientFactory = new DriftClientFactory(new ThriftCodecManager(), invokerFactory, addressSelector, NORMAL_RESULT);
ThriftServerInfoClient client = clientFactory.createDriftClient(ThriftServerInfoClient.class).get();
// get buffer result
NodeState state = NodeState.valueOf(client.getServerState().get());
assertEquals(state, ACTIVE);
} catch (Exception e) {
fail();
}
}
Aggregations