Search in sources :

Example 1 with TpchNodePartitioningProvider

use of com.facebook.presto.tpch.TpchNodePartitioningProvider in project presto by prestodb.

the class IndexedTpchConnectorFactory method create.

@Override
public Connector create(String catalogName, Map<String, String> properties, ConnectorContext context) {
    int splitsPerNode = getSplitsPerNode(properties);
    TpchIndexedData indexedData = new TpchIndexedData(catalogName, indexSpec);
    NodeManager nodeManager = context.getNodeManager();
    return new Connector() {

        @Override
        public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly) {
            return TpchTransactionHandle.INSTANCE;
        }

        @Override
        public ConnectorMetadata getMetadata(ConnectorTransactionHandle transactionHandle) {
            return new TpchIndexMetadata(catalogName, indexedData);
        }

        @Override
        public ConnectorSplitManager getSplitManager() {
            return new TpchSplitManager(nodeManager, splitsPerNode);
        }

        @Override
        public ConnectorRecordSetProvider getRecordSetProvider() {
            return new TpchRecordSetProvider();
        }

        @Override
        public ConnectorIndexProvider getIndexProvider() {
            return new TpchIndexProvider(indexedData);
        }

        @Override
        public Set<SystemTable> getSystemTables() {
            return ImmutableSet.of(new ExampleSystemTable());
        }

        @Override
        public ConnectorNodePartitioningProvider getNodePartitioningProvider() {
            return new TpchNodePartitioningProvider(nodeManager, splitsPerNode);
        }
    };
}
Also used : Connector(com.facebook.presto.spi.connector.Connector) IsolationLevel(com.facebook.presto.spi.transaction.IsolationLevel) ConnectorTransactionHandle(com.facebook.presto.spi.connector.ConnectorTransactionHandle) TpchSplitManager(com.facebook.presto.tpch.TpchSplitManager) NodeManager(com.facebook.presto.spi.NodeManager) TpchNodePartitioningProvider(com.facebook.presto.tpch.TpchNodePartitioningProvider) SystemTable(com.facebook.presto.spi.SystemTable) TpchRecordSetProvider(com.facebook.presto.tpch.TpchRecordSetProvider)

Aggregations

NodeManager (com.facebook.presto.spi.NodeManager)1 SystemTable (com.facebook.presto.spi.SystemTable)1 Connector (com.facebook.presto.spi.connector.Connector)1 ConnectorTransactionHandle (com.facebook.presto.spi.connector.ConnectorTransactionHandle)1 IsolationLevel (com.facebook.presto.spi.transaction.IsolationLevel)1 TpchNodePartitioningProvider (com.facebook.presto.tpch.TpchNodePartitioningProvider)1 TpchRecordSetProvider (com.facebook.presto.tpch.TpchRecordSetProvider)1 TpchSplitManager (com.facebook.presto.tpch.TpchSplitManager)1