Research breakthrough possible @S-Logix pro@slogix.in

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to read multiple table simultaneously in HBase mapreduce?

  • Sample code Segment

    //Create ArrayList
    List table = new ArrayList();


    //Store the first input table
    Scan table1 = new Scan();
    table1.setAttribute("scan.attributes.table.name", Bytes.toBytes("tablename1"));
    table.add(table1);


    //Store the second input table
    Scan table2= new Scan();
    table2.setAttribute("scan.attributes.table.name", Bytes.toBytes("tablename2"));
    table.add(table2);


    //Access mutiple input tables
    TableMapReduceUtil.initTableMapperJob(table, mapper.class, mapper.class, job); //input tables
    TableMapReduceUtil.initTableReducerJob( "outputtable", reducer.class, job); //output tables