Search in sources :

Example 21 with CatalogName

use of io.trino.plugin.base.CatalogName in project trino by trinodb.

the class TestRaptorSplitManager method testNoNodes.

@Test(expectedExceptions = TrinoException.class, expectedExceptionsMessageRegExp = "No nodes available to run query")
public void testNoNodes() {
    deleteShardNodes();
    RaptorSplitManager raptorSplitManagerWithBackup = new RaptorSplitManager(new CatalogName("fbraptor"), ImmutableSet::of, shardManager, true);
    ConnectorSplitSource splitSource = getSplits(raptorSplitManagerWithBackup, tableHandle);
    getSplits(splitSource, 1000);
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) CatalogName(io.trino.plugin.base.CatalogName) ConnectorSplitSource(io.trino.spi.connector.ConnectorSplitSource) RaptorSplitManager(io.trino.plugin.raptor.legacy.RaptorSplitManager) Test(org.testng.annotations.Test)

Example 22 with CatalogName

use of io.trino.plugin.base.CatalogName in project trino by trinodb.

the class TestRaptorSplitManager method testAssignRandomNodeWhenBackupAvailable.

@Test
public void testAssignRandomNodeWhenBackupAvailable() throws URISyntaxException {
    TestingNodeManager nodeManager = new TestingNodeManager();
    CatalogName connectorId = new CatalogName("raptor");
    NodeSupplier nodeSupplier = nodeManager::getWorkerNodes;
    InternalNode node = new InternalNode(UUID.randomUUID().toString(), new URI("http://127.0.0.1/"), NodeVersion.UNKNOWN, false);
    nodeManager.addNode(node);
    RaptorSplitManager raptorSplitManagerWithBackup = new RaptorSplitManager(connectorId, nodeSupplier, shardManager, true);
    deleteShardNodes();
    ConnectorSplitSource partitionSplit = getSplits(raptorSplitManagerWithBackup, tableHandle);
    List<ConnectorSplit> batch = getSplits(partitionSplit, 1);
    assertEquals(getOnlyElement(getOnlyElement(batch).getAddresses()), node.getHostAndPort());
}
Also used : TestingNodeManager(io.trino.testing.TestingNodeManager) CatalogName(io.trino.plugin.base.CatalogName) InternalNode(io.trino.metadata.InternalNode) ConnectorSplitSource(io.trino.spi.connector.ConnectorSplitSource) URI(java.net.URI) ConnectorSplit(io.trino.spi.connector.ConnectorSplit) NodeSupplier(io.trino.plugin.raptor.legacy.NodeSupplier) RaptorSplitManager(io.trino.plugin.raptor.legacy.RaptorSplitManager) Test(org.testng.annotations.Test)

Aggregations

CatalogName (io.trino.plugin.base.CatalogName)22 HdfsEnvironment (io.trino.plugin.hive.HdfsEnvironment)7 TestingNodeManager (io.trino.testing.TestingNodeManager)7 Injector (com.google.inject.Injector)6 Bootstrap (io.airlift.bootstrap.Bootstrap)6 JsonModule (io.airlift.json.JsonModule)6 NoHdfsAuthentication (io.trino.plugin.hive.authentication.NoHdfsAuthentication)6 TypeManager (io.trino.spi.type.TypeManager)6 ImmutableSet (com.google.common.collect.ImmutableSet)5 HdfsConfigurationInitializer (io.trino.plugin.hive.HdfsConfigurationInitializer)5 HiveMetastore (io.trino.plugin.hive.metastore.HiveMetastore)5 ThreadContextClassLoader (io.trino.spi.classloader.ThreadContextClassLoader)5 LifeCycleManager (io.airlift.bootstrap.LifeCycleManager)4 NodeVersion (io.trino.plugin.hive.NodeVersion)4 MetastoreConfig (io.trino.plugin.hive.metastore.MetastoreConfig)4 ConnectorPageSinkProvider (io.trino.spi.connector.ConnectorPageSinkProvider)4 ConnectorSplitManager (io.trino.spi.connector.ConnectorSplitManager)4 Procedure (io.trino.spi.procedure.Procedure)4 Set (java.util.Set)4 ImmutableList (com.google.common.collect.ImmutableList)3