@Override
    public boolean nextKeyValue() throws IOException, InterruptedException {
        if (null == this.graphFilter) {
            return this.recordReader.nextKeyValue();
        } else {
            while (true) {
                if (this.recordReader.nextKeyValue()) {
                    final VertexWritable vertexWritable = this.recordReader.getCurrentValue();
                    final Optional<StarGraph.StarVertex> vertex = vertexWritable.get().applyGraphFilter(this.graphFilter);
                    if (vertex.isPresent()) {
                        vertexWritable.set(vertex.get());
                        return true;
                    }
                } else {
                    return false;
                }
            }
        }
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/GraphFilterRecordReader.java