Skip to content

Commit 4c5a936

Browse files
authored
Merge pull request #229 from oceanbase/disable_admin
disable admin ddl temporarily
2 parents c5b3f97 + 129a0f4 commit 4c5a936

File tree

1 file changed

+46
-41
lines changed

1 file changed

+46
-41
lines changed

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

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,20 @@ public TableDescriptor getDescriptor(TableName tableName) throws TableNotFoundEx
170170

171171
@Override
172172
public void createTable(TableDescriptor tableDescriptor) throws IOException {
173-
OHConnectionConfiguration connectionConf = new OHConnectionConfiguration(conf);
174-
ObTableClient tableClient = ObTableClientManager.getOrCreateObTableClientByTableName(tableDescriptor.getTableName(), connectionConf);
175-
OHCreateTableExecutor executor = new OHCreateTableExecutor(tableClient);
176-
try {
177-
executor.createTable(tableDescriptor, null);
178-
} catch (IOException e) {
179-
if (e.getCause() instanceof ObTableTransportException
180-
&& ((ObTableTransportException) e.getCause()).getErrorCode() == TransportCodes.BOLT_TIMEOUT) {
181-
throw new TimeoutIOException(e.getCause());
182-
} else {
183-
throw e;
184-
}
185-
}
173+
throw new FeatureNotSupportedException("does not support yet");
174+
// OHConnectionConfiguration connectionConf = new OHConnectionConfiguration(conf);
175+
// ObTableClient tableClient = ObTableClientManager.getOrCreateObTableClientByTableName(tableDescriptor.getTableName(), connectionConf);
176+
// OHCreateTableExecutor executor = new OHCreateTableExecutor(tableClient);
177+
// try {
178+
// executor.createTable(tableDescriptor, null);
179+
// } catch (IOException e) {
180+
// if (e.getCause() instanceof ObTableTransportException
181+
// && ((ObTableTransportException) e.getCause()).getErrorCode() == TransportCodes.BOLT_TIMEOUT) {
182+
// throw new TimeoutIOException(e.getCause());
183+
// } else {
184+
// throw e;
185+
// }
186+
// }
186187
}
187188

188189
@Override
@@ -202,19 +203,20 @@ public Future<Void> createTableAsync(TableDescriptor tableDescriptor, byte[][] b
202203

203204
@Override
204205
public void deleteTable(TableName tableName) throws IOException {
205-
OHConnectionConfiguration connectionConf = new OHConnectionConfiguration(conf);
206-
ObTableClient tableClient = ObTableClientManager.getOrCreateObTableClientByTableName(tableName, connectionConf);
207-
OHDeleteTableExecutor executor = new OHDeleteTableExecutor(tableClient);
208-
try {
209-
executor.deleteTable(tableName.getNameAsString());
210-
} catch (IOException e) {
211-
if (e.getCause() instanceof ObTableTransportException
212-
&& ((ObTableTransportException) e.getCause()).getErrorCode() == TransportCodes.BOLT_TIMEOUT) {
213-
throw new TimeoutIOException(e.getCause());
214-
} else {
215-
throw e;
216-
}
217-
}
206+
throw new FeatureNotSupportedException("does not support yet");
207+
// OHConnectionConfiguration connectionConf = new OHConnectionConfiguration(conf);
208+
// ObTableClient tableClient = ObTableClientManager.getOrCreateObTableClientByTableName(tableName, connectionConf);
209+
// OHDeleteTableExecutor executor = new OHDeleteTableExecutor(tableClient);
210+
// try {
211+
// executor.deleteTable(tableName.getNameAsString());
212+
// } catch (IOException e) {
213+
// if (e.getCause() instanceof ObTableTransportException
214+
// && ((ObTableTransportException) e.getCause()).getErrorCode() == TransportCodes.BOLT_TIMEOUT) {
215+
// throw new TimeoutIOException(e.getCause());
216+
// } else {
217+
// throw e;
218+
// }
219+
// }
218220
}
219221

220222
@Override
@@ -244,19 +246,20 @@ public Future<Void> truncateTableAsync(TableName tableName, boolean b) throws IO
244246

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

262265
@Override
@@ -308,12 +311,14 @@ public HTableDescriptor[] disableTables(Pattern pattern) throws IOException {
308311

309312
@Override
310313
public boolean isTableEnabled(TableName tableName) throws IOException {
311-
return isDisabled(tableName) == false;
314+
throw new FeatureNotSupportedException("does not support yet");
315+
// return isDisabled(tableName) == false;
312316
}
313317

314318
@Override
315319
public boolean isTableDisabled(TableName tableName) throws IOException {
316-
return isDisabled(tableName) == true;
320+
throw new FeatureNotSupportedException("does not support yet");
321+
// return isDisabled(tableName) == true;
317322
}
318323

319324
private boolean isDisabled(TableName tableName) throws IOException {

0 commit comments

Comments
 (0)