Amazing technological breakthrough possible @S-Logix pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • 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