Search in sources :

Example 41 with ConnectorId

use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.

the class TestConfidenceBasedClusterTtlProviderManager method setup.

@BeforeClass
public void setup() {
    InMemoryNodeManager nodeManager = new InMemoryNodeManager();
    nodeManager.addNode(new ConnectorId("prism"), ImmutableSet.of(node1, node2, node3));
    ConfidenceBasedNodeTtlFetcherManager nodeTtlFetcherManager = new ConfidenceBasedNodeTtlFetcherManager(nodeManager, new NodeSchedulerConfig(), new NodeTtlFetcherManagerConfig());
    NodeTtlFetcherFactory nodeTtlFetcherFactory = new TestingNodeTtlFetcherFactory(nodeToTtl);
    nodeTtlFetcherManager.addNodeTtlFetcherFactory(nodeTtlFetcherFactory);
    nodeTtlFetcherManager.load(nodeTtlFetcherFactory.getName(), ImmutableMap.of());
    nodeTtlFetcherManager.refreshTtlInfo();
    clusterTtlProviderManager = new ConfidenceBasedClusterTtlProviderManager(nodeTtlFetcherManager);
    ClusterTtlProviderFactory clusterTtlProviderFactory = new TestingClusterTtlProviderFactory();
    clusterTtlProviderManager.addClusterTtlProviderFactory(clusterTtlProviderFactory);
    clusterTtlProviderManager.load(clusterTtlProviderFactory.getName(), ImmutableMap.of());
}
Also used : ConfidenceBasedClusterTtlProviderManager(com.facebook.presto.ttl.clusterttlprovidermanagers.ConfidenceBasedClusterTtlProviderManager) NodeTtlFetcherFactory(com.facebook.presto.spi.ttl.NodeTtlFetcherFactory) TestingNodeTtlFetcherFactory(com.facebook.presto.spi.ttl.TestingNodeTtlFetcherFactory) ConfidenceBasedNodeTtlFetcherManager(com.facebook.presto.ttl.nodettlfetchermanagers.ConfidenceBasedNodeTtlFetcherManager) NodeTtlFetcherManagerConfig(com.facebook.presto.ttl.nodettlfetchermanagers.NodeTtlFetcherManagerConfig) TestingClusterTtlProviderFactory(com.facebook.presto.spi.ttl.TestingClusterTtlProviderFactory) TestingClusterTtlProviderFactory(com.facebook.presto.spi.ttl.TestingClusterTtlProviderFactory) ClusterTtlProviderFactory(com.facebook.presto.spi.ttl.ClusterTtlProviderFactory) NodeSchedulerConfig(com.facebook.presto.execution.scheduler.NodeSchedulerConfig) TestingNodeTtlFetcherFactory(com.facebook.presto.spi.ttl.TestingNodeTtlFetcherFactory) InMemoryNodeManager(com.facebook.presto.metadata.InMemoryNodeManager) ConnectorId(com.facebook.presto.spi.ConnectorId) BeforeClass(org.testng.annotations.BeforeClass)

Example 42 with ConnectorId

use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.

the class TestConfidenceBasedNodeTtlFetcherManager method setup.

@BeforeClass
public void setup() {
    nodeManager = new InMemoryNodeManager();
    nodeManager.addNode(new ConnectorId("prism"), ImmutableSet.of(node1, node2, node3));
    nodeTtlFetcherManager = new ConfidenceBasedNodeTtlFetcherManager(nodeManager, new NodeSchedulerConfig(), new NodeTtlFetcherManagerConfig());
    NodeTtlFetcherFactory factory = new TestingNodeTtlFetcherFactory(nodeToTtl);
    nodeTtlFetcherManager.addNodeTtlFetcherFactory(factory);
    nodeTtlFetcherManager.load(factory.getName(), ImmutableMap.of());
    nodeTtlFetcherManager.refreshTtlInfo();
}
Also used : NodeTtlFetcherFactory(com.facebook.presto.spi.ttl.NodeTtlFetcherFactory) TestingNodeTtlFetcherFactory(com.facebook.presto.spi.ttl.TestingNodeTtlFetcherFactory) ConfidenceBasedNodeTtlFetcherManager(com.facebook.presto.ttl.nodettlfetchermanagers.ConfidenceBasedNodeTtlFetcherManager) NodeTtlFetcherManagerConfig(com.facebook.presto.ttl.nodettlfetchermanagers.NodeTtlFetcherManagerConfig) NodeSchedulerConfig(com.facebook.presto.execution.scheduler.NodeSchedulerConfig) TestingNodeTtlFetcherFactory(com.facebook.presto.spi.ttl.TestingNodeTtlFetcherFactory) InMemoryNodeManager(com.facebook.presto.metadata.InMemoryNodeManager) ConnectorId(com.facebook.presto.spi.ConnectorId) BeforeClass(org.testng.annotations.BeforeClass)

Example 43 with ConnectorId

use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.

the class TestRemoveUnsupportedDynamicFilters method setup.

@BeforeClass
public void setup() {
    metadata = getQueryRunner().getMetadata();
    logicalRowExpressions = new LogicalRowExpressions(new RowExpressionDeterminismEvaluator(metadata.getFunctionAndTypeManager()), new FunctionResolution(metadata.getFunctionAndTypeManager()), metadata.getFunctionAndTypeManager());
    builder = new PlanBuilder(getQueryRunner().getDefaultSession(), new PlanNodeIdAllocator(), metadata);
    ConnectorId connectorId = getCurrentConnectorId();
    TableHandle lineitemTableHandle = new TableHandle(connectorId, new TpchTableHandle("lineitem", 1.0), TestingTransactionHandle.create(), Optional.empty());
    lineitemOrderKeyVariable = builder.variable("LINEITEM_OK", BIGINT);
    lineitemTableScanNode = builder.tableScan(lineitemTableHandle, ImmutableList.of(lineitemOrderKeyVariable), ImmutableMap.of(lineitemOrderKeyVariable, new TpchColumnHandle("orderkey", BIGINT)));
    TableHandle ordersTableHandle = new TableHandle(connectorId, new TpchTableHandle("orders", 1.0), TestingTransactionHandle.create(), Optional.empty());
    ordersOrderKeyVariable = builder.variable("ORDERS_OK", BIGINT);
    ordersTableScanNode = builder.tableScan(ordersTableHandle, ImmutableList.of(ordersOrderKeyVariable), ImmutableMap.of(ordersOrderKeyVariable, new TpchColumnHandle("orderkey", BIGINT)));
}
Also used : RowExpressionDeterminismEvaluator(com.facebook.presto.sql.relational.RowExpressionDeterminismEvaluator) PlanNodeIdAllocator(com.facebook.presto.spi.plan.PlanNodeIdAllocator) TpchColumnHandle(com.facebook.presto.tpch.TpchColumnHandle) LogicalRowExpressions(com.facebook.presto.expressions.LogicalRowExpressions) TableHandle(com.facebook.presto.spi.TableHandle) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) FunctionResolution(com.facebook.presto.sql.relational.FunctionResolution) PlanBuilder(com.facebook.presto.sql.planner.iterative.rule.test.PlanBuilder) ConnectorId(com.facebook.presto.spi.ConnectorId) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) BeforeClass(org.testng.annotations.BeforeClass)

Example 44 with ConnectorId

use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.

the class TestDynamicFiltersChecker method setup.

@BeforeClass
public void setup() {
    metadata = getQueryRunner().getMetadata();
    logicalRowExpressions = new LogicalRowExpressions(new RowExpressionDeterminismEvaluator(metadata.getFunctionAndTypeManager()), new FunctionResolution(metadata.getFunctionAndTypeManager()), metadata.getFunctionAndTypeManager());
    builder = new PlanBuilder(getQueryRunner().getDefaultSession(), new PlanNodeIdAllocator(), metadata);
    ConnectorId connectorId = getCurrentConnectorId();
    TableHandle lineitemTableHandle = new TableHandle(connectorId, new TpchTableHandle("lineitem", 1.0), TestingTransactionHandle.create(), Optional.empty());
    lineitemOrderKeyVariable = builder.variable("LINEITEM_OK", BIGINT);
    lineitemTableScanNode = builder.tableScan(lineitemTableHandle, ImmutableList.of(lineitemOrderKeyVariable), ImmutableMap.of(lineitemOrderKeyVariable, new TpchColumnHandle("orderkey", BIGINT)));
    TableHandle ordersTableHandle = new TableHandle(connectorId, new TpchTableHandle("orders", 1.0), TestingTransactionHandle.create(), Optional.empty());
    ordersOrderKeyVariable = builder.variable("ORDERS_OK", BIGINT);
    ordersTableScanNode = builder.tableScan(ordersTableHandle, ImmutableList.of(ordersOrderKeyVariable), ImmutableMap.of(ordersOrderKeyVariable, new TpchColumnHandle("orderkey", BIGINT)));
}
Also used : RowExpressionDeterminismEvaluator(com.facebook.presto.sql.relational.RowExpressionDeterminismEvaluator) PlanNodeIdAllocator(com.facebook.presto.spi.plan.PlanNodeIdAllocator) TpchColumnHandle(com.facebook.presto.tpch.TpchColumnHandle) LogicalRowExpressions(com.facebook.presto.expressions.LogicalRowExpressions) TableHandle(com.facebook.presto.spi.TableHandle) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) FunctionResolution(com.facebook.presto.sql.relational.FunctionResolution) PlanBuilder(com.facebook.presto.sql.planner.iterative.rule.test.PlanBuilder) ConnectorId(com.facebook.presto.spi.ConnectorId) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) BeforeClass(org.testng.annotations.BeforeClass)

Example 45 with ConnectorId

use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.

the class TestValidateStreamingAggregations method setup.

@BeforeClass
public void setup() {
    metadata = getQueryRunner().getMetadata();
    sqlParser = getQueryRunner().getSqlParser();
    TpchTableHandle nationTpchTableHandle = new TpchTableHandle("nation", 1.0);
    ConnectorId connectorId = getCurrentConnectorId();
    nationTableHandle = new TableHandle(connectorId, nationTpchTableHandle, TestingTransactionHandle.create(), Optional.of(new TpchTableLayoutHandle(nationTpchTableHandle, TupleDomain.all())));
}
Also used : TableHandle(com.facebook.presto.spi.TableHandle) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) TpchTableLayoutHandle(com.facebook.presto.tpch.TpchTableLayoutHandle) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) ConnectorId(com.facebook.presto.spi.ConnectorId) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

ConnectorId (com.facebook.presto.spi.ConnectorId)162 ConnectorMetadata (com.facebook.presto.spi.connector.ConnectorMetadata)75 TableHandle (com.facebook.presto.spi.TableHandle)33 Test (org.testng.annotations.Test)29 ConnectorSession (com.facebook.presto.spi.ConnectorSession)26 ConnectorTableHandle (com.facebook.presto.spi.ConnectorTableHandle)18 PrestoException (com.facebook.presto.spi.PrestoException)18 ConnectorTransactionHandle (com.facebook.presto.spi.connector.ConnectorTransactionHandle)18 Session (com.facebook.presto.Session)16 ImmutableList (com.google.common.collect.ImmutableList)16 QualifiedObjectName (com.facebook.presto.common.QualifiedObjectName)15 List (java.util.List)15 PlanNodeId (com.facebook.presto.spi.plan.PlanNodeId)14 Map (java.util.Map)12 Optional (java.util.Optional)12 InMemoryNodeManager (com.facebook.presto.metadata.InMemoryNodeManager)11 ConnectorOutputTableHandle (com.facebook.presto.spi.ConnectorOutputTableHandle)11 SchemaTableName (com.facebook.presto.spi.SchemaTableName)11 ImmutableMap (com.google.common.collect.ImmutableMap)11 ConnectorInsertTableHandle (com.facebook.presto.spi.ConnectorInsertTableHandle)10