AnsweredAssumed Answered

Hbase/Mapr-DB Namespace Mappings with Rest API

Question asked by mandoskippy on Apr 10, 2016
Latest reply on Jun 15, 2016 by jbenninghoff

Hey all, I am trying to get to a base level of understanding in how MapR-DB and Hbase interfaces interact.  To this end, I've been trying to work on a dockerized version of an HBase Rest interface. I have this working with user jiggery pokery, but it is working.  The one thing I don't understand is the rules on when to need name space mappings. For example, in my hbase-site.xml I need the following in some cases:




Further details:

My tables are all under /data/mytables such as,





When I have the setting in place, then when I use the python hbase interface starbase, I can access each tables with


import starbase

hbasecon = starbase.Connection(host=hbase_rest_host, port=hbase_rest_port)
table1 = hbasecon.table("table1")


However, if I do the following (full path to table) the same query, that just produced results return "None"


table1 = hbasecon.table("/data/mytables/table1")


Now, if I remove the entry for hbase.table.namespace.mappings (by commenting it out) neither version actually works, nor returns an error. I get "None" when I fetch a result in both cases.


So, to me, this sort of makes sense, in that to make starbase/hbase rest work, I need the hbase.table.namespace.mappings... right?


To me, this means, unless there is something weird in either hbase rest or in the starbase package, I should see similar results with the hbase-site.xml conf changes with hbase shell.


However, what I find is,  if, in the same docker container that I am running Hbase Rest, I run the Hbase shell, I can for example do



> count "/data/mytables/table1"




> count "table1"


When I have the conf setting set, and when I do not have the table mapping set, then I can still do


> count "/data/mytables/table1"


So with hbase shell, it appears, I can do full path with no issues, but what I am curious on is this something that the MapR Hbase Shell handles, and the MapR Hbase Rest does not, or is this a limitation in the starbase package I am using for Python... I.e. for those more familiar with the MapR Hbase Rest interface, should I be able to do full table paths without mapping? I will do some testing on my own here to determine that, but was curious in the "Expected" results from the MapR folks.


Also, one other challenge I find with Hbase/MapR in both the shell and the rest interface, is if I am running the Hbase Rest or shell with a user that does not have access to the underlying data, I don't get any sort of access denied errors, just a null return, or, in the case of count, I get 0.  This bothers a me a bit, because 0 is a valid count, and one that distinctly different from "Error you can't count this table".  (At least to 99% of the developers I know).


Is this normal behaivior for Hbase/MapR DB?