Skip to content

Commit ac04d6a

Browse files
committed
[Chore] open the limiation for other htable admin operation
1 parent 4ec96cd commit ac04d6a

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

src/main/java/com/alipay/oceanbase/hbase/util/OHAdmin.java

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -248,20 +248,19 @@ public Future<Void> truncateTableAsync(TableName tableName, boolean b) throws IO
248248

249249
@Override
250250
public void enableTable(TableName tableName) throws IOException {
251-
throw new FeatureNotSupportedException("does not support yet");
252-
// OHConnectionConfiguration connectionConf = new OHConnectionConfiguration(conf);
253-
// ObTableClient tableClient = ObTableClientManager.getOrCreateObTableClientByTableName(tableName, connectionConf);
254-
// OHTableAccessControlExecutor executor = new OHTableAccessControlExecutor(tableClient, ObTableRpcMetaType.HTABLE_ENABLE_TABLE);
255-
// try {
256-
// executor.enableTable(tableName.getNameAsString());
257-
// } catch (IOException e) {
258-
// if (e.getCause() instanceof ObTableTransportException
259-
// && ((ObTableTransportException) e.getCause()).getErrorCode() == TransportCodes.BOLT_TIMEOUT) {
260-
// throw new TimeoutIOException(e.getCause());
261-
// } else {
262-
// throw e;
263-
// }
264-
// }
251+
OHConnectionConfiguration connectionConf = new OHConnectionConfiguration(conf);
252+
ObTableClient tableClient = ObTableClientManager.getOrCreateObTableClientByTableName(tableName, connectionConf);
253+
OHTableAccessControlExecutor executor = new OHTableAccessControlExecutor(tableClient, ObTableRpcMetaType.HTABLE_ENABLE_TABLE);
254+
try {
255+
executor.enableTable(tableName.getNameAsString());
256+
} catch (IOException e) {
257+
if (e.getCause() instanceof ObTableTransportException
258+
&& ((ObTableTransportException) e.getCause()).getErrorCode() == TransportCodes.BOLT_TIMEOUT) {
259+
throw new TimeoutIOException(e.getCause());
260+
} else {
261+
throw e;
262+
}
263+
}
265264
}
266265

267266
@Override
@@ -313,14 +312,12 @@ public HTableDescriptor[] disableTables(Pattern pattern) throws IOException {
313312

314313
@Override
315314
public boolean isTableEnabled(TableName tableName) throws IOException {
316-
throw new FeatureNotSupportedException("does not support yet");
317-
// return isDisabled(tableName) == false;
315+
return isDisabled(tableName) == false;
318316
}
319317

320318
@Override
321319
public boolean isTableDisabled(TableName tableName) throws IOException {
322-
throw new FeatureNotSupportedException("does not support yet");
323-
// return isDisabled(tableName) == true;
320+
return isDisabled(tableName) == true;
324321
}
325322

326323
private boolean isDisabled(TableName tableName) throws IOException {

0 commit comments

Comments
 (0)