@Override
        public boolean visit(int index) throws IOException {
          Mutation m = getMutation(index);
          // we use durability of the original mutation for the mutation passed by CP.
          if (region.getEffectiveDurability(m.getDurability()) == Durability.SKIP_WAL) {
            region.recordMutationWithoutWal(m.getFamilyCellMap());
            /**
             * Here is for HBASE-26993,in order to make the new framework for region replication
             * could work for SKIP_WAL, we save the {@link Mutation} which
             * {@link Mutation#getDurability} is {@link Durability#SKIP_WAL} in miniBatchOp.
             */
            cacheSkipWALMutationForRegionReplication(miniBatchOp, walEdits, familyCellMaps[index]);
            return true;
          }

          // the batch may contain multiple nonce keys (replay case). If so, write WALEdit for each.
          // Given how nonce keys are originally written, these should be contiguous.
          // They don't have to be, it will still work, just write more WALEdits than needed.
          long nonceGroup = getNonceGroup(index);
          long nonce = getNonce(index);
          if (
            curWALEditForNonce == null
              || curWALEditForNonce.getFirst().getNonceGroup() != nonceGroup
              || curWALEditForNonce.getFirst().getNonce() != nonce
          ) {
            curWALEditForNonce =
              new Pair<>(new NonceKey(nonceGroup, nonce), createWALEdit(miniBatchOp));
            walEdits.add(curWALEditForNonce);
          }
          WALEdit walEdit = curWALEditForNonce.getSecond();

          // Add WAL edits from CPs.
          WALEdit fromCP = walEditsFromCoprocessors[index];
          List<ExtendedCell> cellsFromCP = fromCP == null
            ? Collections.emptyList()
            : WALEditInternalHelper.getExtendedCells(fromCP);
          addNonSkipWALMutationsToWALEdit(miniBatchOp, walEdit, cellsFromCP, familyCellMaps[index]);
          return true;
        }
Builds separate WALEdit per nonce by applying input mutations. If WALEdits from CP are
present, they are merged to result WALEdit.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java