private static ClientProtos.MultiRequest buildMultiRequest(final byte[] regionName,
    final RowMutations rowMutations, final Condition condition, long nonceGroup, long nonce)
    throws IOException {
    RegionAction.Builder builder =
      getRegionActionBuilderWithRegion(RegionAction.newBuilder(), regionName);
    builder.setAtomic(true);

    boolean hasNonce = false;
    ClientProtos.Action.Builder actionBuilder = ClientProtos.Action.newBuilder();
    MutationProto.Builder mutationBuilder = MutationProto.newBuilder();
    for (Mutation mutation : rowMutations.getMutations()) {
      mutationBuilder.clear();
      MutationProto mp;
      if (mutation instanceof Increment || mutation instanceof Append) {
        mp = ProtobufUtil.toMutation(getMutationType(mutation), mutation, mutationBuilder, nonce);
        hasNonce = true;
      } else {
        mp = ProtobufUtil.toMutation(getMutationType(mutation), mutation, mutationBuilder);
      }
      actionBuilder.clear();
      actionBuilder.setMutation(mp);
      builder.addAction(actionBuilder.build());
    }

    if (condition != null) {
      builder.setCondition(condition);
    }

    MultiRequest.Builder multiRequestBuilder = MultiRequest.newBuilder();
    if (hasNonce) {
      multiRequestBuilder.setNonceGroup(nonceGroup);
    }

    return multiRequestBuilder.addRegionAction(builder.build()).build();
  }
Create a protocol buffer MultiRequest for row mutations
@return a multi request
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java