Search in sources :

Example 6 with NodeManager

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

the class TestRaptorMetadata method setupDatabase.

@BeforeMethod
public void setupDatabase() throws Exception {
    TypeRegistry typeRegistry = new TypeRegistry();
    dbi = new DBI("jdbc:h2:mem:test" + System.nanoTime());
    dbi.registerMapper(new TableColumn.Mapper(typeRegistry));
    dbi.registerMapper(new Distribution.Mapper(typeRegistry));
    dummyHandle = dbi.open();
    createTablesWithRetry(dbi);
    RaptorConnectorId connectorId = new RaptorConnectorId("raptor");
    NodeManager nodeManager = new TestingNodeManager();
    NodeSupplier nodeSupplier = nodeManager::getWorkerNodes;
    shardManager = createShardManager(dbi, nodeSupplier, systemTicker());
    metadata = new RaptorMetadata(connectorId.toString(), dbi, shardManager);
}
Also used : NodeManager(com.facebook.presto.spi.NodeManager) TestingNodeManager(com.facebook.presto.testing.TestingNodeManager) TestingNodeManager(com.facebook.presto.testing.TestingNodeManager) RaptorMetadata(com.facebook.presto.raptor.RaptorMetadata) DBI(org.skife.jdbi.v2.DBI) TypeRegistry(com.facebook.presto.type.TypeRegistry) RaptorConnectorId(com.facebook.presto.raptor.RaptorConnectorId) NodeSupplier(com.facebook.presto.raptor.NodeSupplier) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

NodeManager (com.facebook.presto.spi.NodeManager)6 TestingNodeManager (com.facebook.presto.testing.TestingNodeManager)3 Connector (com.facebook.presto.spi.connector.Connector)2 ConnectorTransactionHandle (com.facebook.presto.spi.connector.ConnectorTransactionHandle)2 IsolationLevel (com.facebook.presto.spi.transaction.IsolationLevel)2 TypeRegistry (com.facebook.presto.type.TypeRegistry)2 DBI (org.skife.jdbi.v2.DBI)2 BeforeMethod (org.testng.annotations.BeforeMethod)2 PagesIndexPageSorter (com.facebook.presto.PagesIndexPageSorter)1 NodeSupplier (com.facebook.presto.raptor.NodeSupplier)1 RaptorConnectorId (com.facebook.presto.raptor.RaptorConnectorId)1 RaptorMetadata (com.facebook.presto.raptor.RaptorMetadata)1 BackupModule (com.facebook.presto.raptor.backup.BackupModule)1 ColumnInfo (com.facebook.presto.raptor.metadata.ColumnInfo)1 MetadataDao (com.facebook.presto.raptor.metadata.MetadataDao)1 ShardInfo (com.facebook.presto.raptor.metadata.ShardInfo)1 ShardManager (com.facebook.presto.raptor.metadata.ShardManager)1 TableColumn (com.facebook.presto.raptor.metadata.TableColumn)1 TestDatabaseShardManager.createShardManager (com.facebook.presto.raptor.metadata.TestDatabaseShardManager.createShardManager)1 StorageManager (com.facebook.presto.raptor.storage.StorageManager)1