void reportAndLogNewJobStates()

in uforwarder/src/main/java/com/uber/data/kafka/consumerproxy/controller/rebalancer/AbstractRpcUriRebalancer.java [614:643]


  void reportAndLogNewJobStates(final Map<Long, JobState> newJobStates) {
    newJobStates.forEach(
        (jobId, jobState) -> {
          switch (jobState) {
            case JOB_STATE_CANCELED:
              scope.counter(MetricNames.JOB_STATE_CANCELED).inc(1);
              logger.debug("canceling a job", StructuredLogging.jobId(jobId));
              break;
            case JOB_STATE_RUNNING:
              scope.counter(MetricNames.JOB_STATE_RUNNING).inc(1);
              logger.debug("running a job", StructuredLogging.jobId(jobId));
              break;
            case JOB_STATE_FAILED:
              scope.counter(MetricNames.JOB_STATE_FAILED).inc(1);
              logger.debug("failing a job", StructuredLogging.jobId(jobId));
              break;
            case JOB_STATE_UNIMPLEMENTED:
              scope.counter(MetricNames.JOB_STATE_UNIMPLEMENTED).inc(1);
              logger.error("changing a job to unimplemented state", StructuredLogging.jobId(jobId));
              break;
            case JOB_STATE_INVALID:
              scope.counter(MetricNames.JOB_STATE_INVALID).inc(1);
              logger.error("changing a job to invalid state", StructuredLogging.jobId(jobId));
              break;
            default:
              scope.counter(MetricNames.JOB_STATE_UNSUPPORTED).inc(1);
              logger.error("changing a job to unsupported state", StructuredLogging.jobId(jobId));
          }
        });
  }