wchevreuil commented on a change in pull request #3: Hbase 22567
URL: https://github.com/apache/hbase-operator-tools/pull/3#discussion_r299164406
##########
File path: hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
##########
@@ -164,6 +171,86 @@ int setRegionState(String region, RegionState.State
newState)
return EXIT_FAILURE;
}
+ int addMissingRegionsInMeta(String... tableNames) throws IOException {
+ ExecutorService executorService = Executors.newFixedThreadPool(
+ tableNames.length > Runtime.getRuntime().availableProcessors() ?
+ Runtime.getRuntime().availableProcessors() : tableNames.length);
+ final CountDownLatch countDownLatch = new
CountDownLatch(tableNames.length);
+ final List<String> encodedRegionNames = new ArrayList<>();
+ String result = "No regions added.";
+ try(final MetaFixer metaFixer = new MetaFixer(this.conf)){
+ //reducing number of retries in case disable fails due to namespace
table region also missing
+ this.conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1);
+ try(Connection conn = ConnectionFactory.createConnection(this.conf)) {
+ final Admin admin = conn.getAdmin();
+ for (String table : tableNames) {
+ final TableName tableName = TableName.valueOf(table);
+ if(admin.tableExists(tableName)) {
+ executorService.submit(new Runnable() {
+ @Override public void run() {
+ try {
+ LOG.debug("running thread for {}", table);
Review comment:
Initially thought it could be too verbose, but I guess info should be fine,
and this description is indeed not much intuitive. Will address that o next
commit.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services