private void takeWriteResources(int numResources) throws IOException {
    try {
      writeResources.acquire(numResources);
    } catch (InterruptedException ie) {
      throw new IOException("Interrupted while waiting for write resources for " + id);
    }
  }
OutputStream to write to the Netty Channel
ql/src/java/org/apache/hadoop/hive/llap/ChannelOutputStream.java