keith-turner commented on a change in pull request #868: Make replication 
services start when configured
URL: https://github.com/apache/accumulo/pull/868#discussion_r245446903
 
 

 ##########
 File path: server/master/src/main/java/org/apache/accumulo/master/Master.java
 ##########
 @@ -1391,27 +1377,20 @@ public void run() {
       sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
     }
 
-    // Start the daemon to scan the replication table and make units of work
-    replicationWorkDriver = new ReplicationDriver(this);
-    replicationWorkDriver.start();
-
-    // Start the daemon to assign work to tservers to replicate to our peers
-    replicationWorkAssigner = new WorkDriver(this);
-    replicationWorkAssigner.start();
-
-    // Advertise that port we used so peers don't have to be told what it is
-    context.getZooReaderWriter().putPersistentData(
-        getZooKeeperRoot() + Constants.ZMASTER_REPLICATION_COORDINATOR_ADDR,
-        replAddress.address.toString().getBytes(UTF_8), 
NodeExistsPolicy.OVERWRITE);
-
-    // Register replication metrics
-    MasterMetricsFactory factory = new 
MasterMetricsFactory(getConfiguration(), this);
-    Metrics replicationMetrics = factory.createReplicationMetrics();
-    try {
-      replicationMetrics.register();
-    } catch (Exception e) {
-      log.error("Failed to register replication metrics", e);
-    }
+    // if the replication name is ever set, then start replication services
+    final AtomicReference<TServer> replServer = new AtomicReference<>();
+    SimpleTimer.getInstance(getConfiguration()).schedule(() -> {
+      try {
+        if (!getConfiguration().get(Property.REPLICATION_NAME).isEmpty()) {
 
 Review comment:
   Could check if `replServer.get() == null` before checking config as this may 
be a much faster check and the timer has less to do after enabling.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to