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.sql.planner.plan;
 
 
 
 import java.util.List;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
 public class ExchangeNode
         extends PlanNode
 {
     public static enum Type
     {
         GATHER,
         REPARTITION,
         REPLICATE
     }
 
     private final Type type;
     private final List<Symboloutputs;
 
     private final List<PlanNodesources;
     private final List<SymbolpartitionKeys;
     private final Optional<SymbolhashSymbol;
 
     // for each source, the list of inputs corresponding to each output
     private final List<List<Symbol>> inputs;
 
     @JsonCreator
     public ExchangeNode(
             @JsonProperty("id"PlanNodeId id,
             @JsonProperty("type"Type type,
             @JsonProperty("partitionKeys"List<SymbolpartitionKeys,
             @JsonProperty("hashSymbol"Optional<SymbolhashSymbol,
             @JsonProperty("sources"List<PlanNodesources,
             @JsonProperty("outputs"List<Symboloutputs,
             @JsonProperty("inputs"List<List<Symbol>> inputs)
     {
         super(id);
 
         checkNotNull(type"type is null");
         checkNotNull(sources"sources is null");
         checkNotNull(partitionKeys"partitionKeys is null");
         checkNotNull(hashSymbol"hashSymbol is null");
         checkNotNull(outputs"outputs is null");
         checkNotNull(inputs"inputs is null");
 
         this. = type;
         this. = sources;
         this. = ImmutableList.copyOf(partitionKeys);
         this. = hashSymbol;
         this. = ImmutableList.copyOf(outputs);
         this. = ImmutableList.copyOf(inputs);
     }
 
     public static ExchangeNode partitionedExchange(PlanNodeId idPlanNode childList<SymbolpartitionKeysOptional<SymbolhashSymbol)
     {
         return new ExchangeNode(
                 id,
                 ..,
                 partitionKeys,
                 hashSymbol,
                 ImmutableList.of(child),
                 child.getOutputSymbols(),
                 ImmutableList.of(child.getOutputSymbols()));
     }
 
     public static ExchangeNode gatheringExchange(PlanNodeId idPlanNode child)
     {
         return new ExchangeNode(
                 id,
                 ..,
                 ImmutableList.of(),
                 Optional.<Symbol>empty(),
                 ImmutableList.of(child),
                 child.getOutputSymbols(),
                 ImmutableList.of(child.getOutputSymbols()));
     }
 
    public Type getType()
    {
        return ;
    }
    @Override
    public List<PlanNodegetSources()
    {
        return ;
    }
    @Override
    @JsonProperty("outputs")
    public List<SymbolgetOutputSymbols()
    {
        return ;
    }
    public List<SymbolgetPartitionKeys()
    {
        return ;
    }
    public Optional<SymbolgetHashSymbol()
    {
        return ;
    }
    public List<List<Symbol>> getInputs()
    {
        return ;
    }
    @Override
    public <C, R> R accept(PlanVisitor<C, R> visitor, C context)
    {
        return visitor.visitExchange(thiscontext);
    }
New to GrepCode? Check out our FAQ X