Search in sources :

Example 1 with TemporalFunction

use of com.facebook.presto.raptor.storage.organization.TemporalFunction in project presto by prestodb.

the class TestRaptorConnector method setup.

@BeforeMethod
public void setup() throws Exception {
    FunctionAndTypeManager functionAndTypeManager = createTestFunctionAndTypeManager();
    DBI dbi = new DBI("jdbc:h2:mem:test" + System.nanoTime() + "_" + ThreadLocalRandom.current().nextInt());
    dbi.registerMapper(new TableColumn.Mapper(functionAndTypeManager));
    dummyHandle = dbi.open();
    metadataDao = dbi.onDemand(MetadataDao.class);
    createTablesWithRetry(dbi);
    dataDir = Files.createTempDir();
    RaptorConnectorId connectorId = new RaptorConnectorId("test");
    NodeManager nodeManager = new TestingNodeManager();
    NodeSupplier nodeSupplier = nodeManager::getWorkerNodes;
    ShardManager shardManager = createShardManager(dbi);
    StorageManager storageManager = createOrcStorageManager(dbi, dataDir);
    StorageManagerConfig config = new StorageManagerConfig();
    connector = new RaptorConnector(new LifeCycleManager(ImmutableList.of(), null), new TestingNodeManager(), new RaptorMetadataFactory(connectorId, dbi, shardManager, functionAndTypeManager), new RaptorSplitManager(connectorId, nodeSupplier, shardManager, false), new RaptorPageSourceProvider(storageManager), new RaptorPageSinkProvider(storageManager, new PagesIndexPageSorter(new PagesIndex.TestingFactory(false)), new TemporalFunction(DateTimeZone.forID("America/Los_Angeles")), config), new RaptorNodePartitioningProvider(nodeSupplier), new RaptorSessionProperties(config), new RaptorTableProperties(functionAndTypeManager), ImmutableSet.of(), new AllowAllAccessControl(), dbi, ImmutableSet.of());
}
Also used : StorageManager(com.facebook.presto.raptor.storage.StorageManager) TestOrcStorageManager.createOrcStorageManager(com.facebook.presto.raptor.storage.TestOrcStorageManager.createOrcStorageManager) DBI(org.skife.jdbi.v2.DBI) ShardManager(com.facebook.presto.raptor.metadata.ShardManager) TestDatabaseShardManager.createShardManager(com.facebook.presto.raptor.metadata.TestDatabaseShardManager.createShardManager) StorageManagerConfig(com.facebook.presto.raptor.storage.StorageManagerConfig) TemporalFunction(com.facebook.presto.raptor.storage.organization.TemporalFunction) PagesIndexPageSorter(com.facebook.presto.PagesIndexPageSorter) FunctionAndTypeManager(com.facebook.presto.metadata.FunctionAndTypeManager) FunctionAndTypeManager.createTestFunctionAndTypeManager(com.facebook.presto.metadata.FunctionAndTypeManager.createTestFunctionAndTypeManager) TestingNodeManager(com.facebook.presto.testing.TestingNodeManager) AllowAllAccessControl(com.facebook.presto.plugin.base.security.AllowAllAccessControl) MetadataDao(com.facebook.presto.raptor.metadata.MetadataDao) TableColumn(com.facebook.presto.raptor.metadata.TableColumn) NodeManager(com.facebook.presto.spi.NodeManager) TestingNodeManager(com.facebook.presto.testing.TestingNodeManager) LifeCycleManager(com.facebook.airlift.bootstrap.LifeCycleManager) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

LifeCycleManager (com.facebook.airlift.bootstrap.LifeCycleManager)1 PagesIndexPageSorter (com.facebook.presto.PagesIndexPageSorter)1 FunctionAndTypeManager (com.facebook.presto.metadata.FunctionAndTypeManager)1 FunctionAndTypeManager.createTestFunctionAndTypeManager (com.facebook.presto.metadata.FunctionAndTypeManager.createTestFunctionAndTypeManager)1 AllowAllAccessControl (com.facebook.presto.plugin.base.security.AllowAllAccessControl)1 MetadataDao (com.facebook.presto.raptor.metadata.MetadataDao)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 StorageManagerConfig (com.facebook.presto.raptor.storage.StorageManagerConfig)1 TestOrcStorageManager.createOrcStorageManager (com.facebook.presto.raptor.storage.TestOrcStorageManager.createOrcStorageManager)1 TemporalFunction (com.facebook.presto.raptor.storage.organization.TemporalFunction)1 NodeManager (com.facebook.presto.spi.NodeManager)1 TestingNodeManager (com.facebook.presto.testing.TestingNodeManager)1 DBI (org.skife.jdbi.v2.DBI)1 BeforeMethod (org.testng.annotations.BeforeMethod)1