private void flushWrites() {
    if (writeBatch != null && !writeBatch.isEmpty()) {
      try {
        Queue<T> oldWriteBatch = writeBatch;
        writeBatch = null;
        writeCost = 0;
        itemQueue.put(oldWriteBatch);
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        throwFatalException(e);
      }
    }
  }
Creates a new {@code WeightedHandoffQueue} with {@code outer} maximum number of pending batches and {@code inner}
maximum batch weight.
planetiler-core/src/main/java/com/onthegomap/planetiler/worker/WeightedHandoffQueue.java