Search in sources :

Example 1 with VertexCentricEdgeIterable

use of org.janusgraph.graphdb.util.VertexCentricEdgeIterable in project janusgraph by JanusGraph.

the class StandardJanusGraphTx method getEdges.

@Override
public Iterable<JanusGraphEdge> getEdges(RelationIdentifier... ids) {
    verifyOpen();
    if (ids == null || ids.length == 0)
        return new VertexCentricEdgeIterable(getInternalVertices(), RelationCategory.EDGE);
    if (null != config.getGroupName()) {
        MetricManager.INSTANCE.getCounter(config.getGroupName(), "db", "getEdgesByID").inc();
    }
    List<JanusGraphEdge> result = new ArrayList<>(ids.length);
    for (RelationIdentifier id : ids) {
        if (id == null)
            continue;
        JanusGraphEdge edge = id.findEdge(this);
        if (edge != null && !edge.isRemoved())
            result.add(edge);
    }
    return result;
}
Also used : VertexCentricEdgeIterable(org.janusgraph.graphdb.util.VertexCentricEdgeIterable) LongArrayList(com.carrotsearch.hppc.LongArrayList) RelationIdentifier(org.janusgraph.graphdb.relations.RelationIdentifier)

Aggregations

LongArrayList (com.carrotsearch.hppc.LongArrayList)1 RelationIdentifier (org.janusgraph.graphdb.relations.RelationIdentifier)1 VertexCentricEdgeIterable (org.janusgraph.graphdb.util.VertexCentricEdgeIterable)1