Returns the job id to be used to schedule this job.  This may be set in the
AndroidManifest.xml or in single process applications by using #setOverrideJobId
@param context the application context
@return the job id
346897
public static int getImmediateScanJobId(Context context) {
        if (sOverrideImmediateScanJobId >= 0) {
            LogManager.i(TAG, "Using ImmediateScanJobId from static override: "+
                    sOverrideImmediateScanJobId);
            return sOverrideImmediateScanJobId;
        }
        return getJobIdFromManifest(context, "immediateScanJobId");
    }
79946
public static int getId(Context context, String id) {
        final String defType;
        if (id.startsWith("R.")) {
            int dot = id.indexOf('.', 2);
            defType = id.substring(2, dot);
        } else {
            defType = "drawable";
        }

        Log.d(TAG, "getId(): id: %s, extracted type: %s", id, defType);
        return getId(context, id, defType);
    }
661345
@Override
    public String getDeploymentName() {
        if (appMetaData.getJ2EEName() == null)
            return null;
        return appMetaData.getJ2EEName().getApplication();
    }
974036
public static void init(String jobId) {
        JobContext parent = current_.get();
        JobContext ctx = new JobContext(parent);
        current_.set(ctx);
        // don't call setJobId(String)
        // as it will trigger listeners -- TODO fix me
        ctx.jobId = jobId;
        if (null == parent) {
            Act.eventBus().trigger(new JobContextInitialized(ctx));
        }
    }
332279
@Override
	public CompletableFuture<RegistrationResponse> registerJobManager(
			final JobMasterId jobMasterId,
			final ResourceID jobManagerResourceId,
			final String jobManagerAddress,
			final JobID jobId,
			final Time timeout) {

		checkNotNull(jobMasterId);
		checkNotNull(jobManagerResourceId);
		checkNotNull(jobManagerAddress);
		checkNotNull(jobId);

		if (!jobLeaderIdService.containsJob(jobId)) {
			try {
				jobLeaderIdService.addJob(jobId);
			} catch (Exception e) {
				ResourceManagerException exception = new ResourceManagerException("Could not add the job " +
					jobId + " to the job id leader service.", e);

					onFatalError(exception);

				log.error("Could not add job {} to job leader id service.", jobId, e);
				return FutureUtils.completedExceptionally(exception);
			}
		}

		log.info("Registering job manager {}@{} for job {}.", jobMasterId, jobManagerAddress, jobId);

		CompletableFuture<JobMasterId> jobMasterIdFuture;

		try {
			jobMasterIdFuture = jobLeaderIdService.getLeaderId(jobId);
		} catch (Exception e) {
			// we cannot check the job leader id so let's fail
			// TODO: Maybe it's also ok to skip this check in case that we cannot check the leader id
			ResourceManagerException exception = new ResourceManagerException("Cannot obtain the " +
				"job leader id future to verify the correct job leader.", e);

				onFatalError(exception);

			log.debug("Could not obtain the job leader id future to verify the correct job leader.");
			return FutureUtils.completedExceptionally(exception);
		}

		CompletableFuture<JobMasterGateway> jobMasterGatewayFuture = getRpcService().connect(jobManagerAddress, jobMasterId, JobMasterGateway.class);

		CompletableFuture<RegistrationResponse> registrationResponseFuture = jobMasterGatewayFuture.thenCombineAsync(
			jobMasterIdFuture,
			(JobMasterGateway jobMasterGateway, JobMasterId leadingJobMasterId) -> {
				if (Objects.equals(leadingJobMasterId, jobMasterId)) {
					return registerJobMasterInternal(
						jobMasterGateway,
						jobId,
						jobManagerAddress,
						jobManagerResourceId);
				} else {
					final String declineMessage = String.format(
						"The leading JobMaster id %s did not match the received JobMaster id %s. " +
						"This indicates that a JobMaster leader change has happened.",
						leadingJobMasterId,
						jobMasterId);
					log.debug(declineMessage);
					return new RegistrationResponse.Decline(declineMessage);
				}
			},
			getMainThreadExecutor());

		// handle exceptions which might have occurred in one of the futures inputs of combine
		return registrationResponseFuture.handleAsync(
			(RegistrationResponse registrationResponse, Throwable throwable) -> {
				if (throwable != null) {
					if (log.isDebugEnabled()) {
						log.debug("Registration of job manager {}@{} failed.", jobMasterId, jobManagerAddress, throwable);
					} else {
						log.info("Registration of job manager {}@{} failed.", jobMasterId, jobManagerAddress);
					}

					return new RegistrationResponse.Decline(throwable.getMessage());
				} else {
					return registrationResponse;
				}
			},
			getRpcService().getExecutor());
	}
705295
def get_context_data(self, **kwargs):
        """"""
        context = super(ScheduleXmlView, self).get_context_data(**kwargs)
        if self.request.GET.get('render_description', None) == '1':
            context['render_description'] = True
        else:
            context['render_description'] = False
        return context
1340369
@Override
  public Job getJob(final JobId id) {
    log.debug("getting job: {}", id);
    final ZooKeeperClient client = provider.get("getJobId");
    return getJob(client, id);
  }
1016414
@SuppressWarnings("unchecked")
  public static <K1,V1,K2,V2>
  Class<Mapper<K1,V1,K2,V2>> getMapperClass(JobContext job) {
    return (Class<Mapper<K1,V1,K2,V2>>) 
         job.getConfiguration().getClass("mapred.map.multithreadedrunner.class",
                                         Mapper.class);
  }
583251
public static String generateUserAgent(Context context) {
        StringBuilder ua = new StringBuilder("api-client/");
        ua.append(VERSION);

        String packageName = context.getApplicationContext().getPackageName();

        ua.append(" ");
        ua.append(packageName);

        PackageInfo pi = null;
        try {
            pi = context.getPackageManager().getPackageInfo(packageName, 0);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        if (pi != null) {
            ua.append("/");
            ua.append(pi.versionName);
            ua.append("(");
            ua.append(pi.versionCode);
            ua.append(")");
        }
        ua.append(" Android/");
        ua.append(Build.VERSION.SDK_INT);

        try {
            ua.append(" ");
            ua.append(Build.PRODUCT);
        } catch (Exception e) {
            e.printStackTrace();
        }

        try {
            ua.append(" ");
            ua.append(Build.MANUFACTURER);
        } catch (Exception e) {
            e.printStackTrace();
        }

        try {
            ua.append(" ");
            ua.append(Build.MODEL);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return ua.toString();
    }
1168842
public ScheduledJob getJobProperties( String jobId ) throws SchedulerWsException {

		this.logger.finer( "Getting the properties of a scheduled job: " + jobId  );

		WebResource path = this.resource.path( UrlConstants.SCHEDULER ).path( jobId );
		ClientResponse response = this.wsClient.createBuilder( path )
						.accept( MediaType.APPLICATION_JSON )
						.get( ClientResponse.class );

		handleResponse( response );
		return response.getEntity( ScheduledJob.class );
	}
465104
@Override
    public String getId(Map<String, Object> context) {
        String id = null;

        if (isMultiplexWithAddress()) {
            String address = (String) context.get(Message.PATH_INFO);
            if (null != address) {
                int afterLastSlashIndex = address.lastIndexOf("/") + 1;
                if (afterLastSlashIndex > 0
                    && afterLastSlashIndex < address.length()) {
                    id = address.substring(afterLastSlashIndex);
                }
            } else {
                getLogger().log(Level.WARNING,
                                new org.apache.cxf.common.i18n.Message("MISSING_PATH_INFO", tc.getLogger()).toString());
            }
        } else {
            return super.getId(context);
        }
        return id;
    }
816471
private synchronized String getJobNotAdmittedReason(JobInProgress job,
      JobAdmissionWaitInfo waitInfo) {
    JobInfo jobInfo = infos.get(job);
    if (jobInfo == null) {
      return "Unknown, can't find job";
    }
    AdmissionControlData admissionControlData =
        jobInitializer.getAdmissionControlData();
    return NotAdmittedJobInfo.getReasoning(
        adjustClusterwideReason(
            admissionControlData, jobInfo.reason, poolMgr.getPoolName(job)),
            jobInfo.reasonLimit, jobInfo.actualValue,
            jobInfo.hardAdmissionPosition, waitInfo);
  }
351097
@Override
	public HTTaxinvoiceJobState getJobState(String CorpNum, String JobID)
			throws PopbillException {
		return  getJobState(CorpNum, JobID, null);
	}
924355
public Optional<JobExecutionInfo> queryByJobId(String id) throws RemoteInvocationException {
    JobExecutionQuery query = new JobExecutionQuery();
    query.setIdType(QueryIdTypeEnum.JOB_ID);
    query.setId(JobExecutionQuery.Id.create(id));
    query.setLimit(1);

    List<JobExecutionInfo> results = executeQuery(query);
    return getFirstFromQueryResults(results);
  }
79362
public Date rescheduleJob (final TriggerKey triggerKey, final ITrigger newTrigger) throws SchedulerException
  {
    return m_aSched.rescheduleJob (triggerKey, newTrigger);
  }
1062422
@Override
  public JobID getNewJobId() throws IOException {
    int value = jobCounter.incrementAndGet();
    if (value > 1) {
      throw new RuntimeException(
        "CoronaJobTracker can only run one job! (value=" + value + ")");
    }
    createSession();
    // the jobtracker can run only a single job. it's jobid is fixed based
    // on the sessionId.
    jobId = jobIdFromSessionId(sessionId);
    return jobId;
  }
1116972
@Override
    public List<JobExecutionEntity> getJobExecutionsFromJobInstanceId(long jobInstanceId) throws NoSuchJobInstanceException {

        JobInstanceEntity instance = getJobInstance(jobInstanceId);
        List<JobExecutionEntity> executions = new ArrayList<JobExecutionEntity>(instance.getJobExecutions());

        // sorting could be optimized a bit but is it necessary for this impl?
        Collections.sort(executions, ReverseJobExecutionSequenceForOneInstanceComparator.INSTANCE);

        return executions;
    }