Search in sources :

Example 31 with ConnectorSplitSource

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

the class TestRaptorSplitManager method testNoHostForShard.

@Test(expectedExceptions = PrestoException.class, expectedExceptionsMessageRegExp = "No host for shard .* found: \\[\\]")
public void testNoHostForShard() {
    deleteShardNodes();
    ConnectorTableLayoutResult layout = getOnlyElement(metadata.getTableLayouts(SESSION, tableHandle, Constraint.alwaysTrue(), Optional.empty()));
    ConnectorSplitSource splitSource = getSplits(raptorSplitManager, layout);
    getSplits(splitSource, 1000);
}
Also used : ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) ConnectorSplitSource(com.facebook.presto.spi.ConnectorSplitSource) Test(org.testng.annotations.Test)

Example 32 with ConnectorSplitSource

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

the class TestRaptorSplitManager method testNoNodes.

@Test(expectedExceptions = PrestoException.class, expectedExceptionsMessageRegExp = "No nodes available to run query")
public void testNoNodes() {
    deleteShardNodes();
    RaptorSplitManager raptorSplitManagerWithBackup = new RaptorSplitManager(new RaptorConnectorId("fbraptor"), ImmutableSet::of, shardManager, true);
    ConnectorTableLayoutResult layout = getOnlyElement(metadata.getTableLayouts(SESSION, tableHandle, Constraint.alwaysTrue(), Optional.empty()));
    ConnectorSplitSource splitSource = getSplits(raptorSplitManagerWithBackup, layout);
    getSplits(splitSource, 1000);
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) ConnectorTableLayoutResult(com.facebook.presto.spi.ConnectorTableLayoutResult) ConnectorSplitSource(com.facebook.presto.spi.ConnectorSplitSource) RaptorConnectorId(com.facebook.presto.raptor.RaptorConnectorId) RaptorSplitManager(com.facebook.presto.raptor.RaptorSplitManager) Test(org.testng.annotations.Test)

Aggregations

ConnectorSplitSource (com.facebook.presto.spi.ConnectorSplitSource)32 ConnectorSplit (com.facebook.presto.spi.ConnectorSplit)17 Test (org.testng.annotations.Test)17 ColumnHandle (com.facebook.presto.spi.ColumnHandle)16 ConnectorSession (com.facebook.presto.spi.ConnectorSession)16 TestingConnectorSession (com.facebook.presto.testing.TestingConnectorSession)11 ConnectorTableHandle (com.facebook.presto.spi.ConnectorTableHandle)9 ConnectorTableLayoutHandle (com.facebook.presto.spi.ConnectorTableLayoutHandle)9 ConnectorMetadata (com.facebook.presto.spi.connector.ConnectorMetadata)9 ConnectorTableLayoutResult (com.facebook.presto.spi.ConnectorTableLayoutResult)8 ConnectorSplitManager (com.facebook.presto.spi.connector.ConnectorSplitManager)8 SchemaTableName (com.facebook.presto.spi.SchemaTableName)6 ImmutableList (com.google.common.collect.ImmutableList)6 FixedSplitSource (com.facebook.presto.spi.FixedSplitSource)5 ConnectorTransactionHandle (com.facebook.presto.spi.connector.ConnectorTransactionHandle)5 ImmutableMap (com.google.common.collect.ImmutableMap)5 List (java.util.List)5 HiveTransaction (com.facebook.presto.hive.AbstractTestHiveClient.HiveTransaction)4 Transaction (com.facebook.presto.hive.AbstractTestHiveClient.Transaction)4 ConnectorPageSource (com.facebook.presto.spi.ConnectorPageSource)4