Skip to content

Commit 2e9087b

Browse files
lixiaobaosaintstack
authored andcommitted
HBASE-22453 A NullPointerException could be thrown (#272)
1 parent 13c5af3 commit 2e9087b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/RestoreTool.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ public void incrementalRestoreTable(Connection conn, Path tableBackupPath, Path[
169169
for (int i = 0; i < tableNames.length; i++) {
170170
TableName tableName = tableNames[i];
171171
TableDescriptor tableDescriptor = getTableDescriptor(fileSys, tableName, incrBackupId);
172+
if (tableDescriptor == null) {
173+
throw new IOException("Can't find " + tableName + "'s descriptor.");
174+
}
172175
LOG.debug("Found descriptor " + tableDescriptor + " through " + incrBackupId);
173176

174177
TableName newTableName = newTableNames[i];
@@ -456,7 +459,7 @@ byte[][] generateBoundaryKeys(ArrayList<Path> regionDirList) throws IOException
456459

457460
/**
458461
* Prepare the table for bulkload, most codes copied from
459-
* {@link LoadIncrementalHFiles#createTable(TableName, String, Admin)}
462+
* {@link LoadIncrementalHFiles#createTable(TableName, Path, Admin)}
460463
* @param conn connection
461464
* @param tableBackupPath path
462465
* @param tableName table name

0 commit comments

Comments
 (0)