code: @Override
    public JobStatus getJobStatus(final JobId jobId) {
      final ZooKeeperClient client = provider.get("getJobStatus");
  
      final Job job = getJob(client, jobId);
      if (job == null) {
        return null;
      }
  
      final List<String> hosts;
      try {
        hosts = listJobHosts(client, jobId);
      } catch (JobDoesNotExistException e) {
        return null;
      }
  
      final ImmutableMap.Builder<String, Deployment> deployments = ImmutableMap.builder();
      final ImmutableMap.Builder<String, TaskStatus> taskStatuses = ImmutableMap.builder();
      for (final String host : hosts) {
        final TaskStatus taskStatus = getTaskStatus(client, host, jobId);
        if (taskStatus != null) {
          taskStatuses.put(host, taskStatus);
        }
        final Deployment deployment = getDeployment(host, jobId);
        if (deployment != null) {
          deployments.put(host, deployment);
        }
      }
  
      final Map<String, Deployment> deploymentsMap = deployments.build();
      return JobStatus.newBuilder()
          .setJob(job)
          .setDeployments(deploymentsMap)
          .setTaskStatuses(taskStatuses.build())
          .build();
    }
docs: Returns the current job status as a {@link JobStatus} object.