gjacoby126 commented on a change in pull request #701: PHOENIX-5709 Simplify index update generation code for consistent glo… URL: https://github.com/apache/phoenix/pull/701#discussion_r376146376
########## File path: phoenix-core/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java ########## @@ -672,15 +927,15 @@ public void preBatchMutateWithExceptions(ObserverContext<RegionCoprocessorEnviro else { now = EnvironmentEdgeManager.currentTimeMillis(); } - // First group all the updates for a single row into a single update to be processed - Collection<? extends Mutation> mutations = groupMutations(miniBatchOp, now, replayWrite); + // First merge all the updates for a single row into a single update to be processed + Collection<? extends Mutation> pendingMutations = mergeMutations(c, miniBatchOp, context, now, context.rebuild); // early exit if it turns out we don't have any edits - if (mutations == null) { + if (pendingMutations == null || pendingMutations.isEmpty()) { return; } long start = EnvironmentEdgeManager.currentTimeMillis(); - prepareIndexMutations(c, miniBatchOp, context, mutations, now, indexMetaData); + preparePreIndexMutations(c, miniBatchOp, context, pendingMutations, now, indexMetaData); Review comment: It's also a little confusing that preparePreIndexMutations calls prepareIndexMutations. :-) ---------------------------------------------------------------- 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