Search in sources :

Example 1 with EmptySplitPageSource

use of com.facebook.presto.split.EmptySplitPageSource in project presto by prestodb.

the class ScanFilterAndProjectOperator method addSplit.

@Override
public Supplier<Optional<UpdatablePageSource>> addSplit(Split split) {
    requireNonNull(split, "split is null");
    checkState(this.split == null, "Table scan split already set");
    if (finishing) {
        return Optional::empty;
    }
    this.split = split;
    Object splitInfo = split.getInfo();
    if (splitInfo != null) {
        operatorContext.setInfoSupplier(Suppliers.ofInstance(new SplitOperatorInfo(splitInfo)));
    }
    blocked.set(null);
    if (split.getConnectorSplit() instanceof EmptySplit) {
        pageSource = new EmptySplitPageSource();
    }
    return () -> {
        if (pageSource instanceof UpdatablePageSource) {
            return Optional.of((UpdatablePageSource) pageSource);
        }
        return Optional.empty();
    };
}
Also used : UpdatablePageSource(com.facebook.presto.spi.UpdatablePageSource) EmptySplit(com.facebook.presto.split.EmptySplit) EmptySplitPageSource(com.facebook.presto.split.EmptySplitPageSource)

Example 2 with EmptySplitPageSource

use of com.facebook.presto.split.EmptySplitPageSource in project presto by prestodb.

the class TableScanOperator method addSplit.

@Override
public Supplier<Optional<UpdatablePageSource>> addSplit(Split split) {
    requireNonNull(split, "split is null");
    checkState(this.split == null, "Table scan split already set");
    if (finished) {
        return Optional::empty;
    }
    this.split = split;
    Object splitInfo = split.getInfo();
    if (splitInfo != null) {
        operatorContext.setInfoSupplier(Suppliers.ofInstance(new SplitOperatorInfo(splitInfo)));
    }
    blocked.set(null);
    if (split.getConnectorSplit() instanceof EmptySplit) {
        source = new EmptySplitPageSource();
    }
    return () -> {
        if (source instanceof UpdatablePageSource) {
            return Optional.of((UpdatablePageSource) source);
        }
        return Optional.empty();
    };
}
Also used : UpdatablePageSource(com.facebook.presto.spi.UpdatablePageSource) EmptySplit(com.facebook.presto.split.EmptySplit) EmptySplitPageSource(com.facebook.presto.split.EmptySplitPageSource)

Aggregations

UpdatablePageSource (com.facebook.presto.spi.UpdatablePageSource)2 EmptySplit (com.facebook.presto.split.EmptySplit)2 EmptySplitPageSource (com.facebook.presto.split.EmptySplitPageSource)2