chenxu14 commented on a change in pull request #656: HBASE-23063 Add an option to enable multiget in parallel URL: https://github.com/apache/hbase/pull/656#discussion_r327989314
########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java ########## @@ -934,13 +939,61 @@ private Result increment(final HRegion region, final OperationQuota quota, builder.addResultOrException(resultOrExceptionBuilder.build()); } } + // do multiget in parallel + if (getCtxs != null && !getCtxs.isEmpty()) { + doParallelGet(getCtxs, cellsToReturn, builder); + } // Finish up any outstanding mutations if (!CollectionUtils.isEmpty(mutations)) { doNonAtomicBatchOp(builder, region, quota, mutations, cellScanner, spaceQuotaEnforcement); } return cellsToReturn; } + private void doParallelGet(List<GetContext> getCtxs, List<CellScannable> cellsToReturn, + RegionActionResult.Builder builder) throws ServiceException { + ResultOrException.Builder resultOrExceptionBuilder = null; + CountDownLatch latch = new CountDownLatch(getCtxs.size()); + List<GetActionHandler> handlers = new ArrayList<>(getCtxs.size()); + for (GetContext getCtx : getCtxs) { + GetActionHandler handler = new GetActionHandler(getCtx, latch); + this.regionServer.executorService.submit(handler); + handlers.add(handler); + } + try { + latch.await(); Review comment: Sorry Sir, I don't quite understand the impact you worry about. you mean isAboveQuota will not happen in that case? ---------------------------------------------------------------- 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