You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/04/24 16:33:19 UTC
incubator-tinkerpop git commit: Move inner class to bottom of file.
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/refactor-io 597a8baca -> 8d41ec2a2
Move inner class to bottom of file.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/8d41ec2a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/8d41ec2a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/8d41ec2a
Branch: refs/heads/refactor-io
Commit: 8d41ec2a22d023bd1db66c4e7d766654a64ce7a4
Parents: 597a8ba
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 24 10:32:58 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 24 10:32:58 2015 -0400
----------------------------------------------------------------------
.../gremlin/structure/io/gryo/GryoReader.java | 51 ++++++++++----------
1 file changed, 26 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8d41ec2a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
index 987bd27..02974d4 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
@@ -74,30 +74,6 @@ public class GryoReader implements GraphReader {
return new VertexInputIterator(new Input(inputStream), vertexMaker);
}
- private class VertexInputIterator implements Iterator<Vertex> {
- private final Input input;
- private final Function<Attachable<Vertex>, Vertex> vertexMaker;
-
- public VertexInputIterator(final Input input, final Function<Attachable<Vertex>, Vertex> vertexMaker) {
- this.input = input;
- this.vertexMaker = vertexMaker;
- }
-
- @Override
- public boolean hasNext() {
- return !input.eof();
- }
-
- @Override
- public Vertex next() {
- try {
- return readVertexInternal(vertexMaker, input);
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
- }
-
@Override
public Edge readEdge(final InputStream inputStream, final Function<Attachable<Edge>, Edge> edgeMaker) throws IOException {
final Input input = new Input(inputStream);
@@ -158,10 +134,10 @@ public class GryoReader implements GraphReader {
}
public static class Builder implements ReaderBuilder<GryoReader> {
+
private long batchSize = BatchGraph.DEFAULT_BUFFER_SIZE;
private String vertexIdKey = T.id.getAccessor();
private String edgeIdKey = T.id.getAccessor();
-
/**
* Always use the most recent gryo version by default
*/
@@ -210,5 +186,30 @@ public class GryoReader implements GraphReader {
public GryoReader create() {
return new GryoReader(batchSize, this.vertexIdKey, this.edgeIdKey, this.gryoMapper);
}
+
+ }
+
+ private class VertexInputIterator implements Iterator<Vertex> {
+ private final Input input;
+ private final Function<Attachable<Vertex>, Vertex> vertexMaker;
+
+ public VertexInputIterator(final Input input, final Function<Attachable<Vertex>, Vertex> vertexMaker) {
+ this.input = input;
+ this.vertexMaker = vertexMaker;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return !input.eof();
+ }
+
+ @Override
+ public Vertex next() {
+ try {
+ return readVertexInternal(vertexMaker, input);
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
}
}