@Override
    public void run() {
      while (true) {
        ElementWrapper currentBf = null;
        try {
          currentBf = queue.take();
          // at this point we have a currentBf wrapper which contains the whole byte[] of the
          // serialized bloomfilter, but we only want to merge a modified "start -> start+length"
          // part of it, which is pointed by modifiedStart/modifiedLength fields by ElementWrapper
          merge(currentBf);
        } catch (InterruptedException e) {// Executor.shutdownNow() is called
          if (!queue.isEmpty()){
            LOG.info(
                "bloom filter merge was interrupted while processing and queue is still not empty (size: {})"
                    + ", this is fine in case of shutdownNow", queue.size());
          }
          if (aborted.get()) {
            LOG.info("bloom filter merge was aborted, won't finish merging...");
            break;
          }
          while (!queue.isEmpty()) { // time to finish work if any
            ElementWrapper lastBloomFilter = queue.poll();
            merge(lastBloomFilter);
          }
          break;
        }
      }
    }
Executor.shutdownNow() is supposed to send Thread.interrupt to worker threads, and they are
supposed to finish their work.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/aggregates/VectorUDAFBloomFilterMerge.java