private void writeWals() throws IOException {
    List<Integer> procStates = shuffleProcWriteSequence();
    TestProcedure[] procs = new TestProcedure[numProcs + 1]; // 0 is not used.
    int numProcsPerWal = numWals > 0 ? procStates.size() / numWals : Integer.MAX_VALUE;
    long startTime = EnvironmentEdgeManager.currentTime();
    long lastTime = startTime;
    for (int i = 0; i < procStates.size(); ++i) {
      int procId = procStates.get(i);
      if (procId < 0) {
        store.delete(procs[-procId].getProcId());
        procs[-procId] = null;
      } else if (procs[procId] == null) {
        procs[procId] = new TestProcedure(procId, 0);
        procs[procId].setData(serializedState);
        store.insert(procs[procId], null);
      } else {
        store.update(procs[procId]);
      }
      if (i > 0 && i % numProcsPerWal == 0) {
        long currentTime = EnvironmentEdgeManager.currentTime();
        System.out.println("Forcing wall roll. Time taken on last WAL: "
          + (currentTime - lastTime) / 1000.0f + " sec");
        store.rollWriterForTesting();
        lastTime = currentTime;
      }
    }
    long timeTaken = EnvironmentEdgeManager.currentTime() - startTime;
    System.out.println("\n\nDone writing WALs.\nNum procs : " + numProcs + "\nTotal time taken : "
      + StringUtils.humanTimeDiff(timeTaken) + "\n\n");
  }
@return a list of shuffled integers which represent state of proc id. First occurrence of a
        number denotes insert state, consecutive occurrences denote update states, and -ve
        value denotes delete state.
hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALLoaderPerformanceEvaluation.java