Search in sources :

Example 1 with StorageManagerConfig

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

the class RaptorQueryRunner method createSession.

public static Session createSession(String schema) {
    SessionPropertyManager sessionPropertyManager = new SessionPropertyManager();
    sessionPropertyManager.addConnectorSessionProperties(new ConnectorId("raptor"), new RaptorSessionProperties(new StorageManagerConfig()).getSessionProperties());
    return testSessionBuilder(sessionPropertyManager).setCatalog("raptor").setSchema(schema).setSystemProperty("processing_optimization", "columnar_dictionary").setSystemProperty("dictionary_aggregation", "true").build();
}
Also used : SessionPropertyManager(com.facebook.presto.metadata.SessionPropertyManager) ConnectorId(com.facebook.presto.connector.ConnectorId) StorageManagerConfig(com.facebook.presto.raptor.storage.StorageManagerConfig)

Example 2 with StorageManagerConfig

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

the class TestRaptorConnector method setup.

@BeforeMethod
public void setup() throws Exception {
    TypeRegistry typeRegistry = new TypeRegistry();
    DBI dbi = new DBI("jdbc:h2:mem:test" + System.nanoTime());
    dbi.registerMapper(new TableColumn.Mapper(typeRegistry));
    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().setDataDirectory(dataDir);
    connector = new RaptorConnector(new LifeCycleManager(ImmutableList.of(), null), new TestingNodeManager(), new RaptorMetadataFactory(connectorId, dbi, shardManager), new RaptorSplitManager(connectorId, nodeSupplier, shardManager, false), new RaptorPageSourceProvider(storageManager), new RaptorPageSinkProvider(storageManager, new PagesIndexPageSorter(new PagesIndex.TestingFactory()), config), new RaptorNodePartitioningProvider(nodeSupplier), new RaptorSessionProperties(config), new RaptorTableProperties(typeRegistry), ImmutableSet.of(), dbi);
}
Also used : TestOrcStorageManager.createOrcStorageManager(com.facebook.presto.raptor.storage.TestOrcStorageManager.createOrcStorageManager) StorageManager(com.facebook.presto.raptor.storage.StorageManager) DBI(org.skife.jdbi.v2.DBI) ShardManager(com.facebook.presto.raptor.metadata.ShardManager) TestDatabaseShardManager.createShardManager(com.facebook.presto.raptor.metadata.TestDatabaseShardManager.createShardManager) TypeRegistry(com.facebook.presto.type.TypeRegistry) TableColumn(com.facebook.presto.raptor.metadata.TableColumn) StorageManagerConfig(com.facebook.presto.raptor.storage.StorageManagerConfig) NodeManager(com.facebook.presto.spi.NodeManager) TestingNodeManager(com.facebook.presto.testing.TestingNodeManager) PagesIndexPageSorter(com.facebook.presto.PagesIndexPageSorter) LifeCycleManager(io.airlift.bootstrap.LifeCycleManager) TestingNodeManager(com.facebook.presto.testing.TestingNodeManager) MetadataDao(com.facebook.presto.raptor.metadata.MetadataDao) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

StorageManagerConfig (com.facebook.presto.raptor.storage.StorageManagerConfig)2 PagesIndexPageSorter (com.facebook.presto.PagesIndexPageSorter)1 ConnectorId (com.facebook.presto.connector.ConnectorId)1 SessionPropertyManager (com.facebook.presto.metadata.SessionPropertyManager)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 TestOrcStorageManager.createOrcStorageManager (com.facebook.presto.raptor.storage.TestOrcStorageManager.createOrcStorageManager)1 NodeManager (com.facebook.presto.spi.NodeManager)1 TestingNodeManager (com.facebook.presto.testing.TestingNodeManager)1 TypeRegistry (com.facebook.presto.type.TypeRegistry)1 LifeCycleManager (io.airlift.bootstrap.LifeCycleManager)1 DBI (org.skife.jdbi.v2.DBI)1 BeforeMethod (org.testng.annotations.BeforeMethod)1