Search in sources :

Example 1 with TpchSplitManager

use of io.prestosql.plugin.tpch.TpchSplitManager in project hetu-core by openlookeng.

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(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(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(io.prestosql.spi.connector.Connector) IsolationLevel(io.prestosql.spi.transaction.IsolationLevel) ConnectorTransactionHandle(io.prestosql.spi.connector.ConnectorTransactionHandle) TpchSplitManager(io.prestosql.plugin.tpch.TpchSplitManager) NodeManager(io.prestosql.spi.NodeManager) TpchNodePartitioningProvider(io.prestosql.plugin.tpch.TpchNodePartitioningProvider) SystemTable(io.prestosql.spi.connector.SystemTable) TpchRecordSetProvider(io.prestosql.plugin.tpch.TpchRecordSetProvider)

Aggregations

TpchNodePartitioningProvider (io.prestosql.plugin.tpch.TpchNodePartitioningProvider)1 TpchRecordSetProvider (io.prestosql.plugin.tpch.TpchRecordSetProvider)1 TpchSplitManager (io.prestosql.plugin.tpch.TpchSplitManager)1 NodeManager (io.prestosql.spi.NodeManager)1 Connector (io.prestosql.spi.connector.Connector)1 ConnectorTransactionHandle (io.prestosql.spi.connector.ConnectorTransactionHandle)1 SystemTable (io.prestosql.spi.connector.SystemTable)1 IsolationLevel (io.prestosql.spi.transaction.IsolationLevel)1