private PutChunk getFreeChunk() {
    PutChunk chunkToReturn = null;
    for (PutChunk chunk : putChunks) {
      if (chunk.isFree()) {
        chunkToReturn = chunk;
        break;
      }
    }
    if (chunkToReturn == null && putChunks.size() < routerConfig.routerMaxInMemPutChunks) {
      chunkToReturn = new PutChunk();
      putChunks.add(chunkToReturn);
    }
    return chunkToReturn;
  }
@return A free chunk, if one is available; null otherwise.
ambry-router/src/main/java/com/github/ambry/router/PutOperation.java