keith-turner commented on a change in pull request #2282:
URL: https://github.com/apache/accumulo/pull/2282#discussion_r713395127



##########
File path: 
core/src/main/java/org/apache/accumulo/core/util/threads/ThreadPools.java
##########
@@ -189,6 +189,10 @@ public static ThreadPoolExecutor createThreadPool(int 
coreThreads, int maxThread
     return result;
   }
 
+  /*
+   * If you need the server-side shared ScheduledThreadPoolExecutor, then use
+   * ServerContext.getSharedGenericScheduledExecutorService()
+   */
   public static ScheduledThreadPoolExecutor
       createGeneralScheduledExecutorService(AccumuloConfiguration conf) {

Review comment:
       Were all calls this replaced w/ the new context method or are there 
still some direct calls to it?

##########
File path: 
server/base/src/main/java/org/apache/accumulo/server/ServerContext.java
##########
@@ -433,4 +435,13 @@ private void monitorSwappiness(AccumuloConfiguration 
config) {
       }
     }, 1000, 10 * 60 * 1000, TimeUnit.MILLISECONDS);
   }
+
+  public ScheduledThreadPoolExecutor 
getSharedGenericScheduledExecutorService() {

Review comment:
       Can sync to avoid race condition of multiple thread creating when its 
null.  Also I think a shorter name would be nice, withe the fact that its 
shared moved to javadoc.
   
   ```suggestion
     /**
      * return a shared scheduled executor
      */
     public synchronized ScheduledThreadPoolExecutor getScheduledExecutor() {
   ```

##########
File path: 
server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
##########
@@ -65,10 +66,10 @@
   private final Long expiredSessionMarker = (long) -1;
   private final AccumuloConfiguration aconf;
 
-  public SessionManager(AccumuloConfiguration conf) {
-    aconf = conf;
-    maxUpdateIdle = 
conf.getTimeInMillis(Property.TSERV_UPDATE_SESSION_MAXIDLE);
-    maxIdle = conf.getTimeInMillis(Property.TSERV_SESSION_MAXIDLE);
+  public SessionManager(ServerContext context) {
+    this.aconf = context.getConfiguration();

Review comment:
       This comment is not about this particular change, but more about all of 
the changes that switched from passing config to passing context.  Did you 
verify that all of these types of changes are still using the same config type? 
 For example if it used to be the case that table or site config were passed 
in, is it getting the same thing from the context?




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


Reply via email to