@@ -248,20 +248,19 @@ public Future<Void> truncateTableAsync(TableName tableName, boolean b) throws IO
248
248
249
249
@ Override
250
250
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
+ }
265
264
}
266
265
267
266
@ Override
@@ -313,14 +312,12 @@ public HTableDescriptor[] disableTables(Pattern pattern) throws IOException {
313
312
314
313
@ Override
315
314
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 ;
318
316
}
319
317
320
318
@ Override
321
319
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 ;
324
321
}
325
322
326
323
private boolean isDisabled (TableName tableName ) throws IOException {
0 commit comments