Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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 org.apache.tez.dag.api;
 
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 
Represents a virtual collection of vertices whose members can be treated as a single named collection for graph operations. Only the following connections are valid. A VertexGroup can be connected as an input to a consumer Vertex. The tasks of the destination vertex see a single input named after the VertexGroup instead multiple inputs from the members of the VertexGroup. An output can be added to a VertexGroup. All outgoing edges & outputs of a VertexGroup are automatically transferred to the member vertices of the VertexGroup. A VertexGroup is not part of the final DAG.
 
 public class VertexGroup {
 
   static class GroupInfo {
     String groupName;
     Set<Vertexmembers = new HashSet<Vertex>();
     Set<Stringoutputs = new HashSet<String>();
     // destination vertex name to merged input map
     
     GroupInfo(String groupNameVertex... vertices) {
       this. = groupName;
        = Sets.newHashSetWithExpectedSize(vertices.length);
       for (Vertex v : vertices) {
         .add(v);
       }
     }
     String getGroupName() {
       return ;
     }
     Set<VertexgetMembers() {
       return ;
     }
     Set<StringgetOutputs() {
       return ;
     }
   }
   
   
   GroupInfo groupInfo;
  
  
Create an object representing a group of vertices

Parameters:
groupName name of the group
 
   VertexGroup(String groupNameVertex... members) {
     if (members == null || members.length < 2) {
       throw new IllegalArgumentException("VertexGroup must have at least 2 members");
     }
     this. = new GroupInfo(groupNamemembers);
   }

  
Get the name of the group

Returns:
name
 
   public String getGroupName() {
     return .;
   }
  
  
 
   public VertexGroup addOutput(String outputNameOutputDescriptor outputDescriptor,
       Class<? extends OutputCommitteroutputCommitterClazz) {
        outputDescriptoroutputCommitterClazz));
    this...add(outputName);
    return this;
  }
  
  public String toString() {
    return "[ VertexGroup: " + .getGroupName() + "]";
  }
    return ;
  }
  
    return ;
  }
  
    return .;
  }
  
  void addOutputVertex(Vertex outputVertexGroupInputEdge edge) {
    this...put(outputVertex.getVertexName(), edge.getMergedInput());
  }
  
New to GrepCode? Check out our FAQ X