use of io.airlift.drift.server.DriftServer in project trino by trinodb.
the class ThriftQueryRunner method createThriftQueryRunner.
public static QueryRunner createThriftQueryRunner(int thriftServers, boolean enableIndexJoin, Map<String, String> properties) throws Exception {
List<DriftServer> servers = null;
DistributedQueryRunner runner = null;
try {
servers = startThriftServers(thriftServers, enableIndexJoin);
runner = createThriftQueryRunnerInternal(servers, properties);
return new ThriftQueryRunnerWithServers(runner, servers);
} catch (Throwable t) {
closeAllSuppress(t, runner);
// runner might be null, so closing servers explicitly
if (servers != null) {
for (DriftServer server : servers) {
server.shutdown();
}
}
throw t;
}
}
Aggregations