Skip to content
Snippets Groups Projects
Commit 06e47bf8 authored by Apache9's avatar Apache9 Committed by Sean Busbey
Browse files

[hbase10] Use Admin.tableExists instead of Table.getTableDescriptor to test...

[hbase10] Use Admin.tableExists instead of Table.getTableDescriptor to test whether the table exists, as the latter has been removed on master branch (#1315)
parent bcf9ee34
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.BufferedMutator;
import org.apache.hadoop.hbase.client.BufferedMutatorParams;
import org.apache.hadoop.hbase.client.Connection;
......@@ -152,7 +153,11 @@ public class HBaseClient10 extends com.yahoo.ycsb.DB {
// will not propagate this error upstream once the workload
// starts.
final TableName tName = TableName.valueOf(table);
connection.getTable(tName).getTableDescriptor();
try (Admin admin = connection.getAdmin()) {
if (!admin.tableExists(tName)) {
throw new DBException("Table " + tName + " does not exists");
}
}
}
}
} catch (java.io.IOException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment