You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/03/23 16:17:18 UTC

[GitHub] [accumulo] rcarterjr commented on a change in pull request #1487: Fixes: #1323 Implement a write thread limit

rcarterjr commented on a change in pull request #1487: Fixes: #1323 Implement a write thread limit
URL: https://github.com/apache/accumulo/pull/1487#discussion_r396575882
 
 

 ##########
 File path: server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
 ##########
 @@ -1005,19 +1012,37 @@ private void setUpdateTablet(UpdateSession us, KeyExtent keyExtent) {
         updateMetrics.addPermissionErrors(0);
         return;
       }
+
     }
 
     @Override
     public void applyUpdates(TInfo tinfo, long updateID, TKeyExtent tkeyExtent,
-        List<TMutation> tmutations) {
+        List<TMutation> tmutations) throws TException {
       UpdateSession us = (UpdateSession) sessionManager.reserveSession(updateID);
       if (us == null) {
         return;
       }
 
       boolean reserved = true;
+      boolean allowWriteThreadSemaphore = false;
       try {
         KeyExtent keyExtent = new KeyExtent(tkeyExtent);
+        maxThreads = getServerConfig().getConfiguration().getCount(Property.TSERV_MAX_WRITETHREADS);
+        maxThreadPermits = maxThreads == 0 ? Integer.MAX_VALUE : maxThreads;
+        sem = new Semaphore(maxThreadPermits);
 
 Review comment:
   Ok, I can move the semaphore to the constructor. I had done that initially, but I was thinking that we may want to change the maxThreadPermits property value without restarting the tablet server.

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


With regards,
Apache Git Services