@Override
    public void initialize(final InputSplit genericSplit, final TaskAttemptContext context) throws IOException {
        this.lineRecordReader.initialize(genericSplit, context);
        this.hasEdges = context.getConfiguration().getBoolean(Constants.GREMLIN_HADOOP_GRAPH_READER_HAS_EDGES, true);
        if (context.getConfiguration().get(Constants.GREMLIN_HADOOP_GRAPH_FILTER, null) != null) {
            graphFilter = VertexProgramHelper.deserialize(ConfUtil.makeApacheConfiguration(context.getConfiguration()),
                    Constants.GREMLIN_HADOOP_GRAPH_FILTER);
        }
        final GraphSONVersion graphSONVersion =
                GraphSONVersion.valueOf(context.getConfiguration().get(Constants.GREMLIN_HADOOP_GRAPHSON_VERSION, "V3_0"));
        final Mapper mapper = GraphSONMapper.build().
                version(graphSONVersion).
                typeInfo(TypeInfo.PARTIAL_TYPES).
                addDefaultXModule(true).
                addRegistries(IoRegistryHelper.createRegistries(
                        ConfUtil.makeApacheConfiguration(context.getConfiguration()))).create();
        this.graphsonReader = GraphSONReader.build().mapper(mapper).create();
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONRecordReader.java