guluo2016 commented on code in PR #6231:
URL: https://github.com/apache/hbase/pull/6231#discussion_r1760053739
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/mob/ExpiredMobFileCleaner.java:
##########
@@ -85,35 +85,33 @@ private void printUsage() {
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value =
"REC_CATCH_EXCEPTION",
justification = "Intentional")
@Override
- public int run(String[] args) throws Exception {
+ public int run(String[] args) throws IOException {
if (args.length != 2) {
printUsage();
return 1;
}
String tableName = args[0];
String familyName = args[1];
TableName tn = TableName.valueOf(tableName);
- Connection connection = ConnectionFactory.createConnection(getConf());
- Admin admin = connection.getAdmin();
- try {
+ try (Connection connection = ConnectionFactory.createConnection(getConf());
+ Admin admin = connection.getAdmin()) {
+ if (!admin.tableExists(tn)) {
+ throw new IOException("The table " + tableName + " doesn't exist");
+ }
TableDescriptor htd = admin.getDescriptor(tn);
Review Comment:
Sorry about that, I didnot change table name
I just used 2 examples in here.
The first example, i specfied a non_existing table named t01
```shell
./bin/hbase org.apache.hadoop.hbase.mob.ExpiredMobFileCleaner t01 in
```
The second example , i specfied a non_existing table named t04_mob
```shell
./bin/hbase org.apache.hadoop.hbase.mob.ExpiredMobFileCleaner t04_mob in
```
In addition, to execute ExpiredMobFileCleaner , two parameters need to be
specified, table name and column family
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]