public Edge createEdge(JobConf vConf, Vertex v, Vertex w, TezEdgeProperty edgeProp,
      BaseWork work, TezWork tezWork)
    throws IOException {

    switch(edgeProp.getEdgeType()) {
    case CUSTOM_EDGE: {
      int numBuckets = edgeProp.getNumBuckets();
      CustomVertexConfiguration vertexConf =
              new CustomVertexConfiguration(numBuckets, tezWork.getVertexType(work));
      DataOutputBuffer dob = new DataOutputBuffer();
      vertexConf.write(dob);
      VertexManagerPluginDescriptor desc = VertexManagerPluginDescriptor.create(
          CustomPartitionVertex.class.getName());
      byte[] userPayloadBytes = dob.getData();
      ByteBuffer userPayload = ByteBuffer.wrap(userPayloadBytes);
      desc.setUserPayload(UserPayload.create(userPayload));
      w.setVertexManagerPlugin(desc);
      break;
    }
    case XPROD_EDGE:
      break;

    case SIMPLE_EDGE: {
      setupAutoReducerParallelism(edgeProp, w);
      break;
    }
    case CUSTOM_SIMPLE_EDGE: {
      setupQuickStart(edgeProp, w);
      break;
    }

    default:
      // nothing
    }

    return Edge.create(v, w, createEdgeProperty(w, edgeProp, vConf, work, tezWork));
  }
Given two vertices and the configuration for the source vertex, createEdge
will create an Edge object that connects the two.

@param vConf JobConf of the first (source) vertex
@param v The first vertex (source)
@param w The second vertex (sink)
@return
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java