code: private void ensureReserved(long pos) throws IOException {
      if (pos <= mPosReserved) {
        return;
      }
      long toReserve = Math.max(pos - mPosReserved, mFileBufferBytes);
      CreateLocalBlockRequest request = mCreateRequest.toBuilder().setSpaceToReserve(toReserve)
          .setOnlyReserveSpace(true).build();
      mStream.send(request, mDataTimeoutMs);
      CreateLocalBlockResponse response = mStream.receive(mDataTimeoutMs);
      Preconditions.checkState(response != null,
          String.format("Stream closed while waiting for reserve request %s", request.toString()));
      Preconditions.checkState(!response.hasPath(),
          String.format("Invalid response for reserve request %s", request.toString()));
      mPosReserved += toReserve;
    }
docs: Reserves enough space in the block worker.
  
  @param pos the pos of the file/block to reserve to