Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package com.facebook.presto.operator;
public interface Operator
        extends AutoCloseable
    ListenableFuture<?> NOT_BLOCKED = Futures.immediateFuture(null);
Gets the column types of pages produced by this operator.

Notifies the operator that no more pages will be added and the operator should finish processing and flush results. This method will not be called if the Task is already failed or canceled.
    void finish();

Is this operator completely finished processing and no more output pages will be produced.
    boolean isFinished();

Returns a future that will be completed when the operator becomes unblocked. If the operator is not blocked, this method should return NOT_BLOCKED.
    default ListenableFuture<?> isBlocked()
        return ;

Returns true if and only if this operator can accept an input page.
    boolean needsInput();

Adds an input page to the operator. This method will only be called if needsInput() returns true.
    void addInput(Page page);

Gets an output page from the operator. If no output data is currently available, return null.
    Page getOutput();

This method will always be called before releasing the Operator reference.
    default void close()
            throws Exception
New to GrepCode? Check out our FAQ X