milleruntime commented on code in PR #2632:
URL: https://github.com/apache/accumulo/pull/2632#discussion_r852137541


##########
server/tserver/src/main/java/org/apache/accumulo/tserver/ThriftClientHandler.java:
##########
@@ -686,16 +685,27 @@ private void setUpdateTablet(UpdateSession us, KeyExtent 
keyExtent) {
 
   @Override
   public void applyUpdates(TInfo tinfo, long updateID, TKeyExtent tkeyExtent,
-      List<TMutation> tmutations) {
+      List<TMutation> tmutations) throws TException {
     UpdateSession us = (UpdateSession) 
server.sessionManager.reserveSession(updateID);
     if (us == null) {
       return;
     }
 
+    ThreadPoolExecutor writeThreadExecutor = server.getWriteThreadExecutor();
     boolean reserved = true;
+
     try {
       KeyExtent keyExtent = KeyExtent.fromThrift(tkeyExtent);
-      setUpdateTablet(us, keyExtent);
+
+      // get write thread pool handler but only for user tablets
+      if (TabletType.type(keyExtent) == TabletType.USER) {
+        if (writeThreadExecutor.isTerminating()) {
+          throw new TException("Write Thread pool is terminating");
+        }
+        writeThreadExecutor.execute(() -> setUpdateTablet(us, keyExtent));

Review Comment:
   That is a good point, I don't think there is any benefit from using a 
separate thread. I was just using a `ThreadPoolExecutor` since that is what was 
returned from the ThreadPools method I found. I wasn't sure how to use 
`ThreadPools` to manager a thread pool.



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