private void onAppendEntryFailed(IOException exception) {
    LOG.warn("append entry failed", exception);
    final long currentEpoch = (long) epochAndState >>> 2L;
    this.onException(currentEpoch, exception);
  }
This method gets the datanode replication count for the current WAL.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java