dlmarion commented on code in PR #2632:
URL: https://github.com/apache/accumulo/pull/2632#discussion_r852138578
##########
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:
Is there a benefit to running `setUpdateTablet` in a different thread, then
having to wait for it to finish to move on?
--
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]