long get(long timeoutNs) throws InterruptedException, ExecutionException, TimeoutIOException {
    doneLock.lock();
    try {
      while (doneTxid == NOT_DONE) {
        if (!doneCondition.await(timeoutNs, TimeUnit.NANOSECONDS)) {
          throw new TimeoutIOException(
            "Failed to get sync result after " + TimeUnit.NANOSECONDS.toMillis(timeoutNs)
              + " ms for txid=" + this.txid + ", WAL system stuck?");
        }
      }
      if (this.throwable != null) {
        throw new ExecutionException(this.throwable);
      }
      return this.doneTxid;
    } finally {
      doneLock.unlock();
    }
  }
@param txid the transaction id at which this future 'completed'.
@param t    Can be null. Set if we are 'completing' on error (and this 't' is the error).
@return True if we successfully marked this outstanding future as completed/done. Returns false
        if this future is already 'done' when this method called.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFuture.java