virajjasani commented on code in PR #2008: URL: https://github.com/apache/phoenix/pull/2008#discussion_r1844922826
########## phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionScanner.java: ########## @@ -708,6 +747,28 @@ private void annotateAndCommit(UngroupedAggregateRegionObserver.MutationList mut mutations.clear(); } + /** + * Similar to {@link #annotateAndCommit(UngroupedAggregateRegionObserver.MutationList)} but + * only meant for single row atomic delete mutation that requires returning the result if + * the row is deleted atomically. + * + * @param mutations Mutation list. + * @return Result to be returned. + * @throws IOException If something goes wrong with the operation. + */ + private Result annotateCommitAndReturnResult( + UngroupedAggregateRegionObserver.MutationList mutations) throws IOException { + annotateDataMutations(mutations, scan); + if (isDelete || isUpsert) { + annotateDataMutationsWithExternalSchemaId(mutations, scan); + } + Result result = ungroupedAggregateRegionObserver.commitWithResultReturned(mutations, + indexUUID, indexMaintainersPtr, txState, targetHTable, + useIndexProto, clientVersionBytes); + mutations.clear(); + return result; + } + Review Comment: The duplicated portion is very small ``` annotateDataMutations(mutations, scan); if (isDelete || isUpsert) { annotateDataMutationsWithExternalSchemaId(mutations, scan); } ``` Hence, I wanted to avoid creating small method but it makes sense to have common utility which does apply annotations to the list of mutations. Done. -- 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: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org