MisterRaindrop commented on code in PR #95:
URL: https://github.com/apache/cloudberry-pxf/pull/95#discussion_r3076669172


##########
automation/src/main/java/org/apache/cloudberry/pxf/automation/components/hbase/HBase.java:
##########
@@ -90,6 +91,24 @@ public void init() throws Exception {
         ReportUtils.stopLevel(report);
     }
 
+    private void waitHBaseAvailable(Configuration config) throws Exception {
+        int attemptsLeft = 50;
+        while (attemptsLeft > 0) {
+            try {
+                HBaseAdmin.checkHBaseAvailable(config);
+                return;
+            } catch (ZooKeeperConnectionException e) {
+                Thread.sleep(500);
+                attemptsLeft--;
+                ReportUtils.report(report, getClass(), "Zookeep connection 
issues: " + e.getMessage(), Reporter.WARNING);

Review Comment:
   `Zookeep connection issues:` Zookeeper?



##########
automation/src/main/java/org/apache/cloudberry/pxf/automation/components/hbase/HBase.java:
##########
@@ -90,6 +91,24 @@ public void init() throws Exception {
         ReportUtils.stopLevel(report);
     }
 
+    private void waitHBaseAvailable(Configuration config) throws Exception {
+        int attemptsLeft = 50;
+        while (attemptsLeft > 0) {
+            try {
+                HBaseAdmin.checkHBaseAvailable(config);
+                return;
+            } catch (ZooKeeperConnectionException e) {
+                Thread.sleep(500);
+                attemptsLeft--;
+                ReportUtils.report(report, getClass(), "Zookeep connection 
issues: " + e.getMessage(), Reporter.WARNING);
+            } catch (IOException e) {
+                Thread.sleep(500);
+                attemptsLeft--;
+                ReportUtils.report(report, getClass(), "IO issues: " + 
e.getMessage(), Reporter.WARNING);
+            }
+        }
+    }

Review Comment:
   retry fail ,need throw?
   like
   ```
   throw new RuntimeException("HBase did not become available after 50 attempts 
(25s)");
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to