private long releaseQueuedFilterTasks(final ProcessorFilter filter) {
        if (filter != null) {
            return LOGGER.logDurationIfDebugEnabled(() -> {
                final Set<Long> taskIdSet = new HashSet<>();
                final ProcessorTaskQueue queue = queueMap.remove(filter);
                if (queue != null) {
                    ProcessorTask processorTask = queue.poll();
                    while (processorTask != null) {
                        taskIdSet.add(processorTask.getId());
                        if (taskIdSet.size() >= BATCH_SIZE) {
                            releaseQueuedTask(taskIdSet);
                            taskIdSet.clear();
                        }
                        processorTask = queue.poll();
                    }
                }
                releaseQueuedTask(taskIdSet);
                return taskIdSet.size();
            }, () -> "Released tasks for filter " + filter.getFilterInfo());
        }
        return 0;
    }
Return the next task to perform. Called by worker threads. Also assigns
the task to the node asking for the job
stroom-processor/stroom-processor-impl/src/main/java/stroom/processor/impl/ProcessorTaskQueueManagerImpl.java