Search in sources :

Example 6 with DriftServer

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;
    }
}
Also used : DistributedQueryRunner(io.trino.testing.DistributedQueryRunner) DriftServer(io.airlift.drift.server.DriftServer)

Aggregations

DriftServer (io.airlift.drift.server.DriftServer)6 DriftService (io.airlift.drift.server.DriftService)4 NullMethodInvocationStatsFactory (io.airlift.drift.server.stats.NullMethodInvocationStatsFactory)4 DriftNettyServerConfig (io.airlift.drift.transport.netty.server.DriftNettyServerConfig)4 DriftNettyServerTransportFactory (io.airlift.drift.transport.netty.server.DriftNettyServerTransportFactory)4 ArrayList (java.util.ArrayList)4 ImmutableList (com.google.common.collect.ImmutableList)2 ImmutableMap (com.google.common.collect.ImmutableMap)2 ImmutableSet (com.google.common.collect.ImmutableSet)2 ThriftCodecManager (io.airlift.drift.codec.ThriftCodecManager)2 DriftNettyServerTransport (io.airlift.drift.transport.netty.server.DriftNettyServerTransport)2 Logger (io.airlift.log.Logger)2 Logging (io.airlift.log.Logging)2 ThriftIndexedTpchService (io.prestosql.plugin.thrift.server.ThriftIndexedTpchService)2 ThriftTpchService (io.prestosql.plugin.thrift.server.ThriftTpchService)2 ThriftIndexedTpchService (io.trino.plugin.thrift.server.ThriftIndexedTpchService)2 ThriftTpchService (io.trino.plugin.thrift.server.ThriftTpchService)2 List (java.util.List)2 Map (java.util.Map)2 Objects.requireNonNull (java.util.Objects.requireNonNull)2