if (type.isEdgeLabel()) {
InternalVertex otherVertex = tx.getExistingVertex(relation.getOtherVertexId());
switch (relation.direction) {
case IN:
return new CacheEdge(relation.relationId, (TitanLabel) type, otherVertex, vertex, (byte) 1, data);
case OUT:
return new CacheEdge(relation.relationId, (TitanLabel) type, vertex, otherVertex, (byte) 0, data);
default:
throw new AssertionError();
}
}