public GiraphElementIterator(final GiraphGraph graph) throws IOException {
try {
this.graph = graph;
if (this.graph.configuration().containsKey(Constants.GREMLIN_GIRAPH_INPUT_LOCATION)) {
final Configuration configuration = ConfUtil.makeHadoopConfiguration(this.graph.configuration());
final VertexInputFormat inputFormat = this.graph.configuration().getInputFormat().getConstructor().newInstance();
for (final FileStatus status : FileSystem.get(configuration).listStatus(new Path(graph.configuration().getInputLocation()), HiddenFileFilter.instance())) {
this.readers.add(inputFormat.createVertexReader(new FileSplit(status.getPath(), 0, Integer.MAX_VALUE, new String[]{}), new TaskAttemptContext(configuration, new TaskAttemptID())));
}
}
} catch (Exception e) {
throw new IllegalStateException(e.getMessage(), e);
}