void ensureBlockReady() throws IOException {
      Preconditions.checkState(state != State.INIT, "Unexpected state: " + state);

      if (state == State.BLOCK_READY) {
        return;
      }

      // This will set state to BLOCK_READY.
      finishBlock();
    }
Transitions the block writer from the "writing" state to the "block ready" state. Does
nothing if a block is already finished.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java