AnsweredAssumed Answered

Not able to fetch records from HBase using mapr client on remote Windows machine

Question asked by ravikelotra on Dec 10, 2015
Latest reply on Dec 11, 2015 by keysbotzum
Hi Team,
I am not able to fetch the records from Hbase using the mapr client. I am facing issue while trying to fetch the records on remote windows 8 machine. If I execute the same java program from machine where I have install the Hbase, it returns the data. I am clueless what went wrong.
Please refer the below java program.

public class TestHBaseMapr
{

    public static void main(String[] args) throws IOException {
        try{
        Configuration conf = HBaseConfiguration.create();
        conf.set("hbase.table.namespace.mappings","*:/tables");
        conf.set("HADOOP_HOME","E:\\\\opt\\\\mapr\\\\hadoop\\\\hadoop-0.20.2");
        conf.set("mapr.htable.impl","com.mapr.fs.MapRHTable");
        conf.set("fs.default.name", "maprfs://myserver:7222");
        conf.set("fs.maprfs.impl", "com.mapr.fs.MapRFileSystem");
        System.out.println("Create table");
        @SuppressWarnings("resource")
        HTable table = new HTable(conf, "/user/mapr/customer");
        Scan scan = new Scan();
        scan.setCaching(20);

        scan.addFamily(Bytes.toBytes("address"));
        ResultScanner scanner = table.getScanner(scan);
        System.out.println("table   "+table.getConfiguration().toString());
        for (Result result = scanner.next(); (result != null); result = scanner.next()) {
            Get get = new Get(result.getRow());
            Result entireRow = table.get(get);
            System.out.println(entireRow);
        }
        table.close();
        }catch(Exception ex)
        {
            ex.printStackTrace();
        }
    }

Outcomes