Class ImportJSON.JsonTextImporter

  • Enclosing class:
    ImportJSON

    public static class ImportJSON.JsonTextImporter
    extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,​org.ojai.Document,​org.ojai.Value,​org.ojai.Document>
    This class reads JSON data from text files in the Map phase. It also converts the JSON data into Ojai records and writes them to MapR Document-DB a table
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper

        org.apache.hadoop.mapreduce.Mapper.Context
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int counter  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void map​(org.apache.hadoop.io.LongWritable key, org.ojai.Document record, org.apache.hadoop.mapreduce.Mapper.Context context)  
      • Methods inherited from class org.apache.hadoop.mapreduce.Mapper

        cleanup, run, setup
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • counter

        public static int counter
    • Constructor Detail

      • JsonTextImporter

        public JsonTextImporter()
    • Method Detail

      • map

        public void map​(org.apache.hadoop.io.LongWritable key,
                        org.ojai.Document record,
                        org.apache.hadoop.mapreduce.Mapper.Context context)
                 throws java.io.IOException,
                        java.lang.InterruptedException
        Overrides:
        map in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,​org.ojai.Document,​org.ojai.Value,​org.ojai.Document>
        Throws:
        java.io.IOException
        java.lang.InterruptedException