@Override
    public void initialize(final InputSplit genericSplit, final TaskAttemptContext context) throws IOException {
        this.lineRecordReader.initialize(genericSplit, context);
        final Configuration configuration = context.getConfiguration();
        if (configuration.get(Constants.GREMLIN_HADOOP_GRAPH_FILTER, null) != null)
            this.graphFilter = VertexProgramHelper.deserialize(ConfUtil.makeApacheConfiguration(configuration), Constants.GREMLIN_HADOOP_GRAPH_FILTER);
        this.engine = manager.getEngineByName(configuration.get(SCRIPT_ENGINE, "gremlin-groovy"));
        final FileSystem fs = FileSystem.get(configuration);
        try (final InputStream stream = fs.open(new Path(configuration.get(SCRIPT_FILE)));
             final InputStreamReader reader = new InputStreamReader(stream)) {
            final String parse = String.join("\n", IOUtils.toString(reader), READ_CALL);
            script = ((Compilable) engine).compile(parse);
        } catch (ScriptException e) {
            throw new IOException(e.getMessage());
        }
    }
@author Daniel Kuppitz (http://gremlin.guru)
@author Marko A. Rodriguez (http://markorodriguez.com)
hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/script/ScriptRecordReader.java