private void sync(long txid, Durability durability) throws IOException {
    if (this.getRegionInfo().isMetaRegion()) {
      this.wal.sync(txid);
    } else {
      switch (durability) {
        case USE_DEFAULT:
          // do what table defaults to
          if (shouldSyncWAL()) {
            this.wal.sync(txid);
          }
          break;
        case SKIP_WAL:
          // nothing do to
          break;
        case ASYNC_WAL:
          // nothing do to
          break;
        case SYNC_WAL:
          this.wal.sync(txid, false);
          break;
        case FSYNC_WAL:
          this.wal.sync(txid, true);
          break;
        default:
          throw new RuntimeException("Unknown durability " + durability);
      }
    }
  }
Calls sync with the given transaction ID
@param txid should sync up to which transaction
@throws IOException If anything goes wrong with DFS
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java