keith-turner commented on a change in pull request #1318: Fix #1314 fixes gc 
thread issue by creating one timed task instance
URL: https://github.com/apache/accumulo/pull/1318#discussion_r312571698
 
 

 ##########
 File path: 
server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
 ##########
 @@ -564,6 +566,19 @@ private void run() {
     ProbabilitySampler sampler =
         new 
ProbabilitySampler(getConfiguration().getFraction(Property.GC_TRACE_PERCENT));
 
+    // This is created outside of the run loop and passed to the 
walogCollector so that
+    // only a single timed task is created (internal to LiveTServerSet using 
SimpleTimer.
+    final LiveTServerSet liveTServerSet = new LiveTServerSet(this, new 
LiveTServerSet.Listener() {
+      @Override
+      public void update(LiveTServerSet current, Set<TServerInstance> deleted,
+          Set<TServerInstance> added) {
+        if (!deleted.isEmpty() || !added.isEmpty()) {
+          log.debug("Number of current servers {}, tservers added {}, removed 
{}",
+              current == null ? -1 : current.size(), added, deleted);
+        }
+      }
+    });
+
 
 Review comment:
   ok, I think I like calling `scanServers()` explicitly anyway because it 
seems easier to reason about when things happen during the GC cycle.  Otherwise 
there is some timer that runs concurrently at random points during the cycle.

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


With regards,
Apache Git Services

Reply via email to