@Override
    public void run() {
      this.log.info(getName() + " started");
      final MultiVersionConcurrencyControl mvcc = new MultiVersionConcurrencyControl();
      try {
        TableDescriptors tds = new FSTableDescriptors(TEST_UTIL.getConfiguration());
        FSTableDescriptors.tryUpdateMetaTableDescriptor(TEST_UTIL.getConfiguration());
        TableDescriptor htd = tds.get(TableName.META_TABLE_NAME);
        for (int i = 0; i < this.count; i++) {
          long now = EnvironmentEdgeManager.currentTime();
          // Roll every ten edits
          if (i % 10 == 0) {
            this.wal.rollWriter();
          }
          WALEdit edit = new WALEdit();
          byte[] bytes = Bytes.toBytes(i);
          WALEditInternalHelper.addExtendedCell(edit,
            new KeyValue(bytes, bytes, bytes, now, EMPTY_1K_ARRAY));
          RegionInfo hri = RegionInfoBuilder.FIRST_META_REGIONINFO;
          NavigableMap<byte[], Integer> scopes = new TreeMap<>(Bytes.BYTES_COMPARATOR);
          for (byte[] fam : this.metaTableDescriptor.getColumnFamilyNames()) {
            scopes.put(fam, 0);
          }
          final long txid = wal.appendData(hri, new WALKeyImpl(hri.getEncodedNameAsBytes(),
            TableName.META_TABLE_NAME, now, mvcc, scopes), edit);
          Threads.sleep(ThreadLocalRandom.current().nextInt(5));
          wal.sync(txid);
        }
        String msg = getName() + " finished";
        if (isException()) this.log.info(msg, getException());
        else this.log.info(msg);
      } catch (Exception e) {
        this.e = e;
        log.info("Caught exception from Appender:" + getName(), e);
      } finally {
        // Call sync on our log.else threads just hang out.
        try {
          this.wal.sync();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
    }
Returns Call when the thread is done.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollingNoCluster.java