Gets the "best candidate" to be the same (or a copy of) the analyzer job
provided in parameter.

@param analyzerJob
@return
338486
public AnalyzerJob getAnalyzerJob(final AnalyzerJob analyzerJob) {
        if (_jobs.contains(analyzerJob)) {
            return analyzerJob;
        }

        final String analyzerInputName;
        final InputColumn<?> inputColumn = getIdentifyingInputColumn(analyzerJob);
        if (inputColumn == null) {
            analyzerInputName = null;
        } else {
            analyzerInputName = inputColumn.getName();
        }
        return getAnalyzerJob(analyzerJob.getDescriptor().getDisplayName(), analyzerJob.getName(), analyzerInputName);
    }
1353213
public static JobOperator getJobOperator() {

        jo = AccessController.doPrivileged(new PrivilegedAction<JobOperator>() {
            @Override
            public JobOperator run() {
                return jobOperatorTracker.getService();
            }
        });

        if (jo == null) {

            String msg = getFormattedMessage("batch.container.unavailable",
                    new Object[] { "<batchPersistence/>"},
                    "CWWKY0350E: The batch container is not activated. Ensure that batch persistence has been configured via configuration element <batchPersistence />");

            throw new BatchRuntimeException(msg);
        }

        return jo;
    }
222514
public Job getJob(String jobName) {
    // [START ]
    Job job = bigquery.getJob(jobName);
    if (job == null) {
      // job was not found
    }
    // [END ]
    return job;
  }
602669
public Optional<JobDefinition> getJobDefinition(final String jobType) {
        return jobDefinitions
                .stream()
                .filter((j) -> j.jobType().equalsIgnoreCase(jobType))
                .findAny();
    }
916810
public Schema analyzer(String name, Analyzer analyzer) {
        if (analyzers == null) {
            analyzers = new LinkedHashMap<>();
        }
        analyzers.put(name, analyzer);
        return this;
    }
167669
public AbstractProjectAction<?> select(final Job<?, ?> job) {
        List<WarningsProjectAction> actions = job.getActions(WarningsProjectAction.class);
        for (WarningsProjectAction action : actions) {
            if (action.isInGroup(parserName)) {
                return action;
            }
        }
        if (actions.size() == 1) { // Fallback for 3.x release
            return actions.get(0);
        }
        return null;
    }
1265118
public Optional<Job> findJob(String name) {
		return Optional.ofNullable(indexedJobsByName.get(name));
	}
635963
private synchronized JobMonitor getJobMonitor(JobStatus status) {
    UUID jobId = status.getJobId();
    JobMonitor monitor = monitors.get(jobId);
    if (monitor == null) {
      monitor = new JobMonitor(factory.createProgressMonitor(status.getDescription()));
      monitors.put(jobId, monitor);
    }
    return monitor;
  }
1237960
public Job getJobFromId(String jobName) {
    // [START ]
    JobId jobIdObject = JobId.of(jobName);
    Job job = bigquery.getJob(jobIdObject);
    if (job == null) {
      // job was not found
    }
    // [END ]
    return job;
  }
413548
@Override
    public Collection<String> resumeJobs(GroupMatcher<JobKey> matcher, JedisCluster jedis) throws JobPersistenceException {
        Set<String> resumedJobGroups = new HashSet<>();
        if (matcher.getCompareWithOperator() == StringMatcher.StringOperatorName.EQUALS) {
            final String jobGroupSetKey = redisSchema.jobGroupSetKey(new JobKey("", matcher.getCompareToValue()));
            Long unpauseResponse = jedis.srem(redisSchema.pausedJobGroupsSet(), jobGroupSetKey);
            Set<String> jobsResponse = jedis.smembers(jobGroupSetKey);
            if (unpauseResponse > 0) {
                resumedJobGroups.add(redisSchema.jobGroup(jobGroupSetKey));
            }
            for (String job : jobsResponse) {
                resumeJob(redisSchema.jobKey(job), jedis);
            }
        } else {
            for (final String jobGroupSetKey : jedis.smembers(redisSchema.jobGroupsSet())) {
                if (matcher.getCompareWithOperator().evaluate(redisSchema.jobGroup(jobGroupSetKey), matcher.getCompareToValue())) {
                    resumedJobGroups.addAll(resumeJobs(GroupMatcher.jobGroupEquals(redisSchema.jobGroup(jobGroupSetKey)), jedis));
                }
            }
        }
        return resumedJobGroups;
    }
1316479
public Injector openAnalysisJob(final FileObject fileObject, final AnalysisJobBuilder ajb) {
        final File file = VFSUtils.toFile(fileObject);

        if (file != null) {
            _userPreferences.setAnalysisJobDirectory(file.getParentFile());
            _userPreferences.addRecentJobFile(fileObject);
        }

        return Guice.createInjector(new DCModuleImpl(_parentModule, ajb) {
            public FileObject getJobFilename() {
                return fileObject;
            }

        });
    }
822890
public ICommonsList <? extends ITrigger> getTriggersOfJob (final JobKey jobKey) throws SchedulerException
  {
    validateState ();

    return m_aResources.getJobStore ().getTriggersForJob (jobKey);
  }
1338173
public RuntimeJobExecution createJobStartExecution(final WSJobInstance jobInstance,
                                                       IJobXMLSource jslSource,
                                                       Properties jobParameters,
                                                       long executionId) throws JobStartException {

        // TODO - redesign to avoid cast?
        final JobInstanceEntity jobInstanceImpl = (JobInstanceEntity) jobInstance;
        long instanceId = jobInstance.getInstanceId();

        ModelNavigator<JSLJob> navigator = createFirstExecution(jobInstanceImpl, jslSource, jobParameters);
        JobExecutionEntity jobExec = null;
        try {
            jobExec = getPersistenceManagerService().getJobExecutionMostRecent(instanceId);
            // Check to make sure the executionId belongs to the most recent execution.
            // If not, a restart may have occurred. So, fail the start.
            // Also check to make sure a stop did not come in while the start was on the queue.
            BatchStatus currentBatchStatus = jobExec.getBatchStatus();
            if (jobExec.getExecutionId() != executionId ||
                currentBatchStatus.equals(BatchStatus.STOPPING) ||
                currentBatchStatus.equals(BatchStatus.STOPPED)) {
                throw new JobStartException();
            }

        } catch (IllegalStateException ie) {
            // If no execution exists, request came from old dispatch path.  
            jobExec = getPersistenceManagerService().createJobExecution(instanceId, jobParameters, new Date());
            BatchEventsPublisher eventsPublisher = batchKernelImpl.getBatchEventsPublisher();
            if (eventsPublisher != null) {
                String correlationId = getCorrelationId(jobParameters);
                eventsPublisher.publishJobExecutionEvent(jobExec, BatchEventsPublisher.TOPIC_EXECUTION_STARTING, correlationId);
            }
        }

        TopLevelNameInstanceExecutionInfo topLevelInfo = new TopLevelNameInstanceExecutionInfo(jobInstanceImpl.getJobName(), instanceId, jobExec.getExecutionId());

        return new RuntimeJobExecution(topLevelInfo, jobParameters, navigator);
    }
256564
static Analyzer analyzer() {
        return new Analyzer()
        {
            @Override
            protected TokenStreamComponents createComponents( String fieldName )
            {
                Tokenizer source = new WhitespaceTokenizer();
                TokenStream filter = new LowerCaseFilter( source );
                return new TokenStreamComponents( source, filter );
            }

            @Override
            public String toString()
            {
                return "LOWER_CASE_WHITESPACE_ANALYZER";
            }
        };
    }
71862
public com.google.privacy.dlp.v2.RiskAnalysisJobConfig getRiskJob() {
    if (jobCase_ == 3) {
      return (com.google.privacy.dlp.v2.RiskAnalysisJobConfig) job_;
    }
    return com.google.privacy.dlp.v2.RiskAnalysisJobConfig.getDefaultInstance();
  }
244127
public static Job findJobByDest(final Key destKey) {
    Job job = null;
    for( Job current : Job.all() ) {
      if( current.dest().equals(destKey) ) {
        job = current;
        break;
      }
    }
    return job;
  }
490292
public static ExtractJobConfiguration of(TableId sourceTable, String destinationUri) {
    return newBuilder(sourceTable, destinationUri).build();
  }