Member since
05-20-2015
2
Posts
0
Kudos Received
0
Solutions
05-20-2015
12:37 PM
I'm sure am overlooking something in the snippet below, but I can't figure out what. As indicated, if I include a call to 'exists' to quickly check if the key exists in table, the subsequent 'get' ends up returning nothing; commenting out the 'exists' call, however, makes the code work. But, now I have to do additional checks before parsing the result fetched from Hbase to make sure it is not empty/null. ...
final Get g = new Get(someKey);
g.setCacheBlocks(true);
g.setMaxVersions(1);
g.addColumn(colFamily, colName);
/* --- THIS DOES NOT WORK --- */
if (this.someHbaseTab.exists(g)) {
final Result res = this.someHbaseTab.get(g);
// res is empty!!!
}
// --- --- ---
/* --- THIS WORKS --- */
// No call to 'exists'
final Result res = this.someHbaseTab.get(g);
// Valid result
// --- --- ---
... I'm running Cloudera CDH5.
... View more
Labels:
- Labels:
-
Apache HBase