You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/05/17 07:19:50 UTC

[GitHub] [hbase] saintstack commented on a change in pull request #3266: HBASE-25830 HBaseCluster support CompactionServer for UTs

saintstack commented on a change in pull request #3266:
URL: https://github.com/apache/hbase/pull/3266#discussion_r633274298



##########
File path: hbase-annotations/src/test/java/org/apache/hadoop/hbase/testclassification/CompactionServerTests.java
##########
@@ -0,0 +1,4 @@
+package org.apache.hadoop.hbase.testclassification;

Review comment:
       License?

##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/compactionserver/HCompactionServer.java
##########
@@ -174,13 +178,28 @@ public void run() {
       abort("Fatal exception during initialization", e);
     }
     try {
+      if (!isStopped() && !isAborted()) {
+        while (keepLooping()) {
+          createCompactionServerStatusStub();
+          if (cssStub == null) {
+            this.sleeper.sleep(100);
+          } else {
+            break;
+          }
+        }
+      }
       // We registered with the Master. Go into run mode.
       long lastMsg = System.currentTimeMillis();
       // The main run loop.
       while (!isStopped()) {
         long now = System.currentTimeMillis();
         if ((now - lastMsg) >= msgInterval) {
-          tryCompactionServerReport();
+          if (tryCompactionServerReport() && !online.get()) {
+            synchronized (online) {
+              online.set(true);
+              online.notifyAll();
+            }
+          }
           lastMsg = System.currentTimeMillis();
         }
         if (!isStopped()) {

Review comment:
       Can this server be moved out of the hbase-server package?

##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
##########
@@ -253,6 +256,12 @@ private void init(final int nMasterNodes, final int numAlwaysStandByMasters,
         hbaseCluster.addRegionServer(rsConf, i, user);
       }
 
+      // manually add the compaction servers as other users
+      for (int i = 0; i < numCompactionServers; i++) {

Review comment:
       Does compaction server have to be this integrated?

##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
##########
@@ -253,6 +256,12 @@ private void init(final int nMasterNodes, final int numAlwaysStandByMasters,
         hbaseCluster.addRegionServer(rsConf, i, user);
       }
 
+      // manually add the compaction servers as other users
+      for (int i = 0; i < numCompactionServers; i++) {

Review comment:
       Can it be moved outside hbase-server with its own test suite in its on hbase-compaction-server module? (Sorry, late to the game here)




-- 
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:
users@infra.apache.org