HBASE-22453 A NullPointerException could be thrown (#272)

This commit is contained in:
lixiaobao 2019-06-07 06:52:39 +08:00 committed by Michael Stack
parent 13c5af38da
commit 2e9087bfb7
1 changed files with 4 additions and 1 deletions

View File

@ -169,6 +169,9 @@ public class RestoreTool {
for (int i = 0; i < tableNames.length; i++) {
TableName tableName = tableNames[i];
TableDescriptor tableDescriptor = getTableDescriptor(fileSys, tableName, incrBackupId);
if (tableDescriptor == null) {
throw new IOException("Can't find " + tableName + "'s descriptor.");
}
LOG.debug("Found descriptor " + tableDescriptor + " through " + incrBackupId);
TableName newTableName = newTableNames[i];
@ -456,7 +459,7 @@ public class RestoreTool {
/**
* Prepare the table for bulkload, most codes copied from
* {@link LoadIncrementalHFiles#createTable(TableName, String, Admin)}
* {@link LoadIncrementalHFiles#createTable(TableName, Path, Admin)}
* @param conn connection
* @param tableBackupPath path
* @param tableName table name