private int changeStatus(final DSLContext context,
                             final Integer nodeId,
                             final TaskStatus newStatus,
                             final Long statusTime,
                             final Condition condition) {
        Objects.requireNonNull(condition, "Null condition");
        final Supplier<String> msgSupplier = () -> LogUtil.message(
                "changeStatus - nodeId: {}, newStatus: {}, statusTime: {}, condition: {}",
                nodeId,
                newStatus,
                statusTime,
                condition);
        LOGGER.debug(msgSupplier);

        return JooqUtil.withDeadlockRetries(() ->
                        context
                                .update(PROCESSOR_TASK)
                                .set(PROCESSOR_TASK.FK_PROCESSOR_NODE_ID, nodeId)
                                .set(PROCESSOR_TASK.STATUS, newStatus.getPrimitiveValue())
                                .set(PROCESSOR_TASK.STATUS_TIME_MS, statusTime)
                                .setNull(PROCESSOR_TASK.START_TIME_MS)
                                .setNull(PROCESSOR_TASK.END_TIME_MS)
                                .set(PROCESSOR_TASK.VERSION, PROCESSOR_TASK.VERSION.plus(1))
                                .where(condition)
                                .execute(),
                msgSupplier);
    }
Count the current number of tasks for a filter matching the specified status.

@param filterId The filter to count tasks for.
@param status   Task status.
@return The number of tasks matching the specified status.
stroom-processor/stroom-processor-impl-db/src/main/java/stroom/processor/impl/db/ProcessorTaskDaoImpl.java