Menu

#14 Uninstantiated declared tables cause table list to fail

v1.0 (example)
open
nobody
5
2014-09-03
2014-09-03
saarela
No

The HbaseSourceController::tables method calls out to the hbaseService to retrieve and populate the known tables within the hbase instance. If a table exists in META that hasn't been instantiated, the resulting TableNotFoundException through by the service causes the entire tables call to fail prematurely.

Quick fix: add an exception handler within tlist.each block to catch exceptions thrown while iterating through the table list. I have something like starting at ~line 337:

tlist = hbaseService.tableList(hbaseSourceInstance)
tlist.each {
try {
String tableName = it.nameAsString
if (hbaseService.isTableEnabled(hbaseSourceInstance, tableName)) {
onlineList << tableName
}
} catch (Exception e) {
// table was reported by hbase but didn't actually exist. Skip it.
//-
log.warn "Failed to locate table: ${e.localizedMessage}"
}
}

You end up with the following exception:

[ WARN] 13:53:47 (SLF4JLog.java:warn:189)
Exception occured while showing table details

java.lang.RuntimeException: org.apache.hadoop.hbase.TableNotFoundException: table_x
at org.apache.hadoop.hbase.client.HTableFactory.createHTableInterface(HTableFactory.java:38)
at org.apache.hadoop.hbase.client.HTablePool.createHTable(HTablePool.java:265)
at org.apache.hadoop.hbase.client.HTablePool.findOrCreateTable(HTablePool.java:195)
at org.apache.hadoop.hbase.client.HTablePool.getTable(HTablePool.java:174)
at com.nnapz.hbaseexplorer.HBaseClient.scan(HBaseClient.java:165)
at com.nnapz.hbaseexplorer.HBaseClient.scan(HBaseClient.java:246)
at com.nnapz.hbaseexplorer.HBaseClient.checkOnline(HBaseClient.java:337)
at com.nnapz.hbaseexplorer.services.HbaseService.isTableEnabled(HbaseService.groovy:241)
at com.nnapz.hbaseexplorer.controllers.HbaseSourceController$_closure14_closure31.doCall(HbaseSourceController.g
roovy:379)
at com.nnapz.hbaseexplorer.controllers.HbaseSourceController$_closure14.doCall(HbaseSourceController.groovy:377)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.hadoop.hbase.TableNotFoundException: table_x
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionMan
ager.java:1024)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.j
ava:889)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.j
ava:846)
at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:271)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:211)
at org.apache.hadoop.hbase.client.HTableFactory.createHTableInterface(HTableFactory.java:36)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.