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
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package com.facebook.presto.operator;
 
 
 
 import java.util.List;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
 
 public class HashBuilderOperator
         implements Operator
 {
     public static class HashBuilderOperatorFactory
             implements OperatorFactory
     {
         private final int operatorId;
         private final SettableLookupSourceSupplier lookupSourceSupplier;
         private final List<IntegerhashChannels;
         private final Optional<IntegerhashChannel;
 
         private final int expectedPositions;
         private boolean closed;
 
         public HashBuilderOperatorFactory(
                 int operatorId,
                 List<Typetypes,
                 List<IntegerhashChannels,
                 Optional<IntegerhashChannel,
                 int expectedPositions)
         {
             this. = operatorId;
             this. = new SettableLookupSourceSupplier(checkNotNull(types"types is null"));
 
             Preconditions.checkArgument(!hashChannels.isEmpty(), "hashChannels is empty");
             this. = ImmutableList.copyOf(checkNotNull(hashChannels"hashChannels is null"));
             this. = checkNotNull(hashChannel"hashChannel is null");
 
             this. = checkNotNull(expectedPositions"expectedPositions is null");
         }
 
         public LookupSourceSupplier getLookupSourceSupplier()
         {
             return ;
         }
 
         @Override
         public List<TypegetTypes()
         {
             return .getTypes();
         }
 
         @Override
         public Operator createOperator(DriverContext driverContext)
         {
             checkState(!"Factory is already closed");
             OperatorContext operatorContext = driverContext.addOperatorContext(HashBuilderOperator.class.getSimpleName());
             return new HashBuilderOperator(
                     operatorContext,
                     ,
                     ,
                     ,
                     );
         }
 
         @Override
         public void close()
         {
              = true;
         }
     }
 
     private final OperatorContext operatorContext;
     private final List<IntegerhashChannels;
     private final Optional<IntegerhashChannel;
 
     private final PagesIndex pagesIndex;
 
     private boolean finished;
    public HashBuilderOperator(
            OperatorContext operatorContext,
            SettableLookupSourceSupplier lookupSourceSupplier,
            List<IntegerhashChannels,
            Optional<IntegerhashChannel,
            int expectedPositions)
    {
        this. = checkNotNull(operatorContext"operatorContext is null");
        this. = checkNotNull(lookupSourceSupplier"hashSupplier is null");
        Preconditions.checkArgument(!hashChannels.isEmpty(), "hashChannels is empty");
        this. = ImmutableList.copyOf(checkNotNull(hashChannels"hashChannels is null"));
        this. = checkNotNull(hashChannel"hashChannel is null");
        this. = new PagesIndex(lookupSourceSupplier.getTypes(), expectedPositions);
    }
    @Override
    {
        return ;
    }
    @Override
    public List<TypegetTypes()
    {
        return .getTypes();
    }
    @Override
    public void finish()
    {
        if () {
            return;
        }
        .setLookupSource(lookupSource);
         = true;
    }
    @Override
    public boolean isFinished()
    {
        return ;
    }
    @Override
    public boolean needsInput()
    {
        return !;
    }
    @Override
    public void addInput(Page page)
    {
        checkNotNull(page"page is null");
        checkState(!isFinished(), "Operator is already finished");
        .addPage(page);
    }
    @Override
    public Page getOutput()
    {
        return null;
    }
New to GrepCode? Check out our FAQ X