@Override
    public Vertex next() {
        try {
            if (this.nextVertex != null) {
                final Vertex temp = this.nextVertex;
                this.nextVertex = null;
                return temp;
            } else {
                while (!this.readers.isEmpty()) {
                    if (this.readers.peek().nextKeyValue())
                        return new HadoopVertex(this.readers.peek().getCurrentValue().get(), this.graph);
                    else
                        this.readers.remove().close();
                }
            }
            throw FastNoSuchElementException.instance();
        } catch (final Exception e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/HadoopVertexIterator.java