public Iterable<TitanVertex> executeVertices(InternalVertex vertex, BaseVertexCentricQuery baseQuery) { if (isPartitionedVertex(vertex)) { //If there is a sort order, we need to first merge the relations (and sort) and then compute vertices if (!orders.isEmpty()) return edges2VertexIds((Iterable) executeRelations(vertex,baseQuery), vertex); if (!hasAllCanonicalTypes()) { InternalVertex[] representatives = tx.getAllRepresentatives(vertex,restrict2Partitions); Iterable<TitanVertex> merge = null; for (InternalVertex rep : representatives) { Iterable<TitanVertex> iter = executeIndividualVertices(rep,baseQuery); if (merge==null) merge = iter; else merge = ResultMergeSortIterator.mergeSort(merge,iter,VertexArrayList.VERTEX_ID_COMPARATOR,false); } return ResultSetIterator.wrap(merge,baseQuery.getLimit()); } else vertex = tx.getCanonicalVertex(vertex); } return executeIndividualVertices(vertex,baseQuery); }
public Iterable<TitanVertex> executeVertices(InternalVertex vertex, BaseVertexCentricQuery baseQuery) { if (isPartitionedVertex(vertex)) { //If there is a sort order, we need to first merge the relations (and sort) and then compute vertices if (!orders.isEmpty()) return edges2VertexIds((Iterable) executeRelations(vertex,baseQuery), vertex); if (!hasAllCanonicalTypes()) { InternalVertex[] representatives = tx.getAllRepresentatives(vertex,restrict2Partitions); Iterable<TitanVertex> merge = null; for (InternalVertex rep : representatives) { Iterable<TitanVertex> iter = executeIndividualVertices(rep,baseQuery); if (merge==null) merge = iter; else merge = ResultMergeSortIterator.mergeSort(merge,iter,VertexArrayList.VERTEX_ID_COMPARATOR,false); } return ResultSetIterator.wrap(merge,baseQuery.getLimit()); } else vertex = tx.getCanonicalVertex(vertex); } return executeIndividualVertices(vertex,baseQuery); }
public Iterable<TitanVertex> executeVertices(InternalVertex vertex, BaseVertexCentricQuery baseQuery) { if (isPartitionedVertex(vertex)) { //If there is a sort order, we need to first merge the relations (and sort) and then compute vertices if (!orders.isEmpty()) return edges2VertexIds((Iterable) executeRelations(vertex,baseQuery), vertex); if (!hasAllCanonicalTypes()) { InternalVertex[] representatives = tx.getAllRepresentatives(vertex,restrict2Partitions); Iterable<TitanVertex> merge = null; for (InternalVertex rep : representatives) { Iterable<TitanVertex> iter = executeIndividualVertices(rep,baseQuery); if (merge==null) merge = iter; else merge = ResultMergeSortIterator.mergeSort(merge,iter,VertexArrayList.VERTEX_ID_COMPARATOR,false); } return ResultSetIterator.wrap(merge,baseQuery.getLimit()); } else vertex = tx.getCanonicalVertex(vertex); } return executeIndividualVertices(vertex,baseQuery); }