Search in sources :

Example 1 with SplitOperatorInfo

use of com.facebook.presto.operator.SplitOperatorInfo in project presto by prestodb.

the class IndexSourceOperator method addSplit.

@Override
public Supplier<Optional<UpdatablePageSource>> addSplit(Split split) {
    requireNonNull(split, "split is null");
    checkState(source == null, "Index source split already set");
    IndexSplit indexSplit = (IndexSplit) split.getConnectorSplit();
    // Normalize the incoming RecordSet to something that can be consumed by the index
    RecordSet normalizedRecordSet = probeKeyNormalizer.apply(indexSplit.getKeyRecordSet());
    ConnectorPageSource result = index.lookup(normalizedRecordSet);
    source = new PageSourceOperator(result, types, operatorContext);
    Object splitInfo = split.getInfo();
    if (splitInfo != null) {
        operatorContext.setInfoSupplier(() -> new SplitOperatorInfo(splitInfo));
    }
    return Optional::empty;
}
Also used : SplitOperatorInfo(com.facebook.presto.operator.SplitOperatorInfo) RecordSet(com.facebook.presto.spi.RecordSet) ConnectorPageSource(com.facebook.presto.spi.ConnectorPageSource) PageSourceOperator(com.facebook.presto.operator.PageSourceOperator)

Aggregations

PageSourceOperator (com.facebook.presto.operator.PageSourceOperator)1 SplitOperatorInfo (com.facebook.presto.operator.SplitOperatorInfo)1 ConnectorPageSource (com.facebook.presto.spi.ConnectorPageSource)1 RecordSet (com.facebook.presto.spi.RecordSet)1