Description
If we run below codes:
Table table = connection.getTable(null);
we will see below exception:
java.lang.NullPointerException at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:221) at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:182) at org.apache.hadoop.hbase.client.ConnectionImplementation.getTable(ConnectionImplementation.java:298) at org.apache.hadoop.hbase.client.ConnectionImplementation.getTable(ConnectionImplementation.java:293)
And in this JIRA we will add a null checker and throw a more graceful IllegalArgumentException
For RegionServerCallable, we're lacking of some null checker when using table name, such as in RegionServerCallable#prepare:
public void prepare(final boolean reload) throws IOException { // check table state if this is a retry if (reload && !tableName.equals(TableName.META_TABLE_NAME) && getConnection().isTableDisabled(tableName)) { throw new TableNotEnabledException(tableName.getNameAsString() + " is disabled."); }
It will throw NPE if tableName is null and invoking tableName.equals. We'll add null checker in such places.
Attachments
Attachments
Issue Links
- is related to
-
HBASE-17211 Add more details in log when UnknownScannerException thrown in ScannerCallable
- Resolved