I need to connect MapR-DB (HBase) via Java code. I have binary tables 'Table01' inside "/mapr/root/main/database"(path). maprcli referring to this path "/mapr/root" and my full table name is "/main/database/Table01".
below hbase shell command works fine, but when I run java code it stopped at 4th line even not showing any error message and terminate also.
scan '/main/database/Table01'
my java scan code:
1.Connection con = ConnectionFactory.createConnection(conf);
2.Table table = con.getTable(TableName.valueOf("/main/database/Table01"));
3.Scan scan = new Scan();
4.ResultScanner rs = table.getScanner(scan);
my Config Code : I got this config values from 'conf/hbase-site.xml'
static Configuration conf = HBaseConfiguration.create();
conf.set("hbase.zookeeper.quorum", "XXXX");
conf.set("hbase.zookeeper.property.clientPort", "XXXX");
conf.set("hbase.cluster.distributed","true");
conf.set("hbase.rootdir", "maprfs:///hbase");
You can find the installation instruction: * MapR Client Setup
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.