Add getVerticesInRange functionality

This commit is contained in:
Michael Lieberman
2015-02-06 18:16:40 -05:00
parent 816dffe141
commit 89976c2c86
2 changed files with 10 additions and 0 deletions

View File

@@ -184,6 +184,10 @@ public class AccumuloGraph implements Graph, KeyIndexableGraph, IndexableGraph {
return globals.getVertexWrapper().getVertices();
}
public Iterable<Vertex> getVerticesInRange(Object fromId, Object toId) {
return globals.getVertexWrapper().getVerticesInRange(fromId, toId);
}
@Override
public Iterable<Vertex> getVertices(String key, Object value) {
AccumuloGraphUtils.validateProperty(key, value);

View File

@@ -190,7 +190,13 @@ public class VertexTableWrapper extends ElementTableWrapper {
}
public CloseableIterable<Vertex> getVertices() {
return getVerticesInRange(null, null);
}
public CloseableIterable<Vertex> getVerticesInRange(Object fromId, Object toId) {
Scanner scan = getScanner();
scan.setRange(new Range(fromId != null ? fromId.toString() : null,
toId != null ? toId.toString() : null));
scan.fetchColumnFamily(new Text(Constants.LABEL));
if (globals.getConfig().getPreloadedProperties() != null) {