Search in sources :

Example 1 with ThriftPlugin

use of com.facebook.presto.connector.thrift.ThriftPlugin in project presto by prestodb.

the class ThriftQueryRunner method createThriftQueryRunnerInternal.

private static DistributedQueryRunner createThriftQueryRunnerInternal(List<DriftServer> servers, int nodeCount, Map<String, String> properties) throws Exception {
    String addresses = servers.stream().map(server -> "localhost:" + driftServerPort(server)).collect(joining(","));
    Session defaultSession = testSessionBuilder().setCatalog("thrift").setSchema("tiny").build();
    DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(defaultSession).setNodeCount(nodeCount).setExtraProperties(properties).build();
    queryRunner.installPlugin(new ThriftPlugin());
    Map<String, String> connectorProperties = ImmutableMap.<String, String>builder().put("presto.thrift.client.addresses", addresses).put("presto.thrift.client.connect-timeout", "30s").put("presto-thrift.lookup-requests-concurrency", "2").build();
    queryRunner.createCatalog("thrift", "presto-thrift", connectorProperties);
    return queryRunner;
}
Also used : Logger(com.facebook.airlift.log.Logger) ThriftTpchService(com.facebook.presto.connector.thrift.server.ThriftTpchService) DriftServer(com.facebook.drift.server.DriftServer) ThriftCodecManager(com.facebook.drift.codec.ThriftCodecManager) TestingPrestoServer(com.facebook.presto.server.testing.TestingPrestoServer) QueryRunner(com.facebook.presto.testing.QueryRunner) ConnectorPlanOptimizerManager(com.facebook.presto.sql.planner.ConnectorPlanOptimizerManager) DriftNettyServerTransport(com.facebook.drift.transport.netty.server.DriftNettyServerTransport) DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) ArrayList(java.util.ArrayList) StatsCalculator(com.facebook.presto.cost.StatsCalculator) ImmutableList(com.google.common.collect.ImmutableList) ThriftIndexedTpchService(com.facebook.presto.connector.thrift.server.ThriftIndexedTpchService) PageSourceManager(com.facebook.presto.split.PageSourceManager) Map(java.util.Map) Objects.requireNonNull(java.util.Objects.requireNonNull) QualifiedObjectName(com.facebook.presto.common.QualifiedObjectName) EventListener(com.facebook.presto.spi.eventlistener.EventListener) TransactionManager(com.facebook.presto.transaction.TransactionManager) NodePartitioningManager(com.facebook.presto.sql.planner.NodePartitioningManager) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) Session(com.facebook.presto.Session) NullMethodInvocationStatsFactory(com.facebook.drift.server.stats.NullMethodInvocationStatsFactory) DriftNettyServerTransportFactory(com.facebook.drift.transport.netty.server.DriftNettyServerTransportFactory) SplitManager(com.facebook.presto.split.SplitManager) TestingSession.testSessionBuilder(com.facebook.presto.testing.TestingSession.testSessionBuilder) Closeables.closeQuietly(com.facebook.airlift.testing.Closeables.closeQuietly) Plugin(com.facebook.presto.spi.Plugin) Collectors.joining(java.util.stream.Collectors.joining) DriftService(com.facebook.drift.server.DriftService) MaterializedResult(com.facebook.presto.testing.MaterializedResult) List(java.util.List) Lock(java.util.concurrent.locks.Lock) ThriftPlugin(com.facebook.presto.connector.thrift.ThriftPlugin) TestingAccessControlManager(com.facebook.presto.testing.TestingAccessControlManager) Logging(com.facebook.airlift.log.Logging) Optional(java.util.Optional) DriftNettyServerConfig(com.facebook.drift.transport.netty.server.DriftNettyServerConfig) Metadata(com.facebook.presto.metadata.Metadata) DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) ThriftPlugin(com.facebook.presto.connector.thrift.ThriftPlugin) Session(com.facebook.presto.Session)

Aggregations

Logger (com.facebook.airlift.log.Logger)1 Logging (com.facebook.airlift.log.Logging)1 Closeables.closeQuietly (com.facebook.airlift.testing.Closeables.closeQuietly)1 ThriftCodecManager (com.facebook.drift.codec.ThriftCodecManager)1 DriftServer (com.facebook.drift.server.DriftServer)1 DriftService (com.facebook.drift.server.DriftService)1 NullMethodInvocationStatsFactory (com.facebook.drift.server.stats.NullMethodInvocationStatsFactory)1 DriftNettyServerConfig (com.facebook.drift.transport.netty.server.DriftNettyServerConfig)1 DriftNettyServerTransport (com.facebook.drift.transport.netty.server.DriftNettyServerTransport)1 DriftNettyServerTransportFactory (com.facebook.drift.transport.netty.server.DriftNettyServerTransportFactory)1 Session (com.facebook.presto.Session)1 QualifiedObjectName (com.facebook.presto.common.QualifiedObjectName)1 ThriftPlugin (com.facebook.presto.connector.thrift.ThriftPlugin)1 ThriftIndexedTpchService (com.facebook.presto.connector.thrift.server.ThriftIndexedTpchService)1 ThriftTpchService (com.facebook.presto.connector.thrift.server.ThriftTpchService)1 StatsCalculator (com.facebook.presto.cost.StatsCalculator)1 Metadata (com.facebook.presto.metadata.Metadata)1 TestingPrestoServer (com.facebook.presto.server.testing.TestingPrestoServer)1 Plugin (com.facebook.presto.spi.Plugin)1 EventListener (com.facebook.presto.spi.eventlistener.EventListener)1