public void mutate(Table table, Mutation m, long keyBase, byte[] row, byte[] cf, byte[] q,
    byte[] v) {
    long start = EnvironmentEdgeManager.currentTime();
    try {
      m = dataGenerator.beforeMutate(keyBase, m);
      if (m instanceof Increment) {
        table.increment((Increment) m);
      } else if (m instanceof Append) {
        table.append((Append) m);
      } else if (m instanceof Put) {
        table.checkAndMutate(row, cf).qualifier(q).ifEquals(v).thenPut((Put) m);
      } else if (m instanceof Delete) {
        table.checkAndMutate(row, cf).qualifier(q).ifEquals(v).thenDelete((Delete) m);
      } else {
        throw new IllegalArgumentException("unsupported mutation " + m.getClass().getSimpleName());
      }
      totalOpTimeMs.addAndGet(EnvironmentEdgeManager.currentTime() - start);
    } catch (IOException e) {
      failedKeySet.add(keyBase);
      String exceptionInfo;
      if (e instanceof RetriesExhaustedWithDetailsException) {
        RetriesExhaustedWithDetailsException aggEx = (RetriesExhaustedWithDetailsException) e;
        exceptionInfo = aggEx.getExhaustiveDescription();
      } else {
        StringWriter stackWriter = new StringWriter();
        PrintWriter pw = new PrintWriter(stackWriter);
        e.printStackTrace(pw);
        pw.flush();
        exceptionInfo = StringUtils.stringifyException(e);
      }
      LOG.error("Failed to mutate: " + keyBase + " after "
        + (EnvironmentEdgeManager.currentTime() - start) + "ms; region information: "
        + getRegionDebugInfoSafe(table, m.getRow()) + "; errors: " + exceptionInfo);
    }
  }
Use batch vs. separate updates for every column in a row
hbase-diagnostics/src/main/java/org/apache/hadoop/hbase/util/MultiThreadedUpdater.java