Search in sources :

Example 1 with VertexStructV1

use of com.baidu.hugegraph.loader.struct.VertexStructV1 in project incubator-hugegraph-toolchain by apache.

the class MappingUtil method convertV1ToV2.

private static ElementMapping convertV1ToV2(ElementStructV1 origin) {
    ElementMapping target;
    if (origin.type().isVertex()) {
        VertexStructV1 originVertex = (VertexStructV1) origin;
        target = new VertexMapping(originVertex.idField(), originVertex.unfold());
    } else {
        EdgeStructV1 originEdge = (EdgeStructV1) origin;
        target = new EdgeMapping(originEdge.sourceFields(), originEdge.unfoldSource(), originEdge.targetFields(), originEdge.unfoldTarget());
    }
    fill(origin, target);
    return target;
}
Also used : ElementMapping(com.baidu.hugegraph.loader.mapping.ElementMapping) VertexMapping(com.baidu.hugegraph.loader.mapping.VertexMapping) EdgeMapping(com.baidu.hugegraph.loader.mapping.EdgeMapping) VertexStructV1(com.baidu.hugegraph.loader.struct.VertexStructV1) EdgeStructV1(com.baidu.hugegraph.loader.struct.EdgeStructV1)

Aggregations

EdgeMapping (com.baidu.hugegraph.loader.mapping.EdgeMapping)1 ElementMapping (com.baidu.hugegraph.loader.mapping.ElementMapping)1 VertexMapping (com.baidu.hugegraph.loader.mapping.VertexMapping)1 EdgeStructV1 (com.baidu.hugegraph.loader.struct.EdgeStructV1)1 VertexStructV1 (com.baidu.hugegraph.loader.struct.VertexStructV1)1