class WorkerRegistryV2 implements WorkerRegistry, WorkerEventSubscriber {

    @Override
    public int getNumRunningWorkers() {
        if(logger.isDebugEnabled()) { logger.debug("In getNumRunningWorkers"); }
        int cnt = jobToWorkerInfoMap.values().stream()
                    .map(workerList -> workerList.stream()
                            .filter(wm -> WorkerState.isRunningState(wm.getState()))
                            .collect(Collectors.toList())
                            .size()
                    )
                    .reduce(0,(a, b) -> a + b);
        if(logger.isDebugEnabled()) { logger.debug("Returning {} from getNumRunningWorkers", cnt); }
        return cnt;
    }

      WorkerRegistryV2();

}