Sets the job input key mainframe record type.

@param job The job to configure.
@param cobolType The input key mainframe record type.
326159
public static void setInputKeyRecordType(Job job, Class<? extends CobolComplexType> cobolType) {
      job.getConfiguration().setClass(CONF_INPUT_KEY_RECORD_TYPE, cobolType, CobolComplexType.class);
    }
495299
protected void setNumberOfReducers(Job job) throws IOException {

    // get input size
    long inputSize = 0;
    for (Path inputPath : this.mapReduceInputPaths) {
      inputSize += this.fs.getContentSummary(inputPath).getLength();
    }

    // get target file size
    long targetFileSize =
        this.state.getPropAsLong(MRCompactorAvroKeyDedupJobRunner.COMPACTION_JOB_TARGET_OUTPUT_FILE_SIZE,
            MRCompactorAvroKeyDedupJobRunner.DEFAULT_COMPACTION_JOB_TARGET_OUTPUT_FILE_SIZE);

    // get max reducers
    int maxNumReducers = state.getPropAsInt(MRCompactorAvroKeyDedupJobRunner.COMPACTION_JOB_MAX_NUM_REDUCERS,
        MRCompactorAvroKeyDedupJobRunner.DEFAULT_COMPACTION_JOB_MAX_NUM_REDUCERS);

    int numReducers = Math.min(Ints.checkedCast(inputSize / targetFileSize) + 1, maxNumReducers);

    // get use prime reducers
    boolean usePrimeReducers =
        state.getPropAsBoolean(MRCompactorAvroKeyDedupJobRunner.COMPACTION_JOB_USE_PRIME_REDUCERS,
            MRCompactorAvroKeyDedupJobRunner.DEFAULT_COMPACTION_JOB_USE_PRIME_REDUCERS);

    if (usePrimeReducers && numReducers != 1) {
      numReducers = Primes.nextPrime(numReducers);
    }
    job.setNumReduceTasks(numReducers);
  }
1324473
protected void checkJobTypes(final Map<String, ? extends Class<?>> jobTypes) {
        if (jobTypes == null) {
            throw new IllegalArgumentException("jobTypes must not be null");
        }
        for (final Entry<String, ? extends Class<?>> entry : jobTypes.entrySet()) {
            try {
                checkJobType(entry.getKey(), entry.getValue());
            } catch (IllegalArgumentException iae) {
                throw new IllegalArgumentException("jobTypes contained invalid value", iae);
            }
        }
    }
124425
public void setJobs(java.util.Collection<SigningJob> jobs) {
        if (jobs == null) {
            this.jobs = null;
            return;
        }

        this.jobs = new java.util.ArrayList<SigningJob>(jobs);
    }
592685
public void setMapOutputKeyClass(Class<?> theClass
                                   ) throws IllegalStateException {
    ensureState(JobState.DEFINE);
    conf.setMapOutputKeyClass(theClass);
  }
990544
protected static void setMainJavaClass(ILaunchConfigurationWorkingCopy wc, String name) {
		wc.setAttribute(
				IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
				name);
	}
413271
public void unlock( Key job_key ) { 
    if( _key != null ) {
      Log.debug(Log.Tag.Sys.LOCKS,"unlock "+_key+" by job "+job_key);
      new Unlock(job_key).invoke(_key); 
    }
  }
1054637
@SuppressWarnings("unchecked")
    public static boolean setInputData(Map<String, Object> inp, Object comp, Logger log) {
        PrintWriter w = null;
        File file = null;
        boolean success = true;
        ComponentAccess cp = new ComponentAccess(comp);
        inp = convert(inp);
        for (Access in : cp.inputs()) {
            String fieldName = in.getField().getName();
            Class fieldType = in.getField().getType();
            Object inpValue = inp.get(fieldName);
            if (inpValue != null) {
                // allow files and dates provided as strings and
                // convert them
                try {
                    inpValue = conv(inpValue, fieldType);
                    // check the range if possible.
                    if (Number.class.isAssignableFrom(fieldType) || fieldType == double.class || fieldType == float.class || fieldType == int.class) {
                        Range range = in.getField().getAnnotation(Range.class);
                        if (range != null) {
                            double v = ((Number) inpValue).doubleValue();
                            if (!Annotations.inRange(range, v)) {
                                if (log.isLoggable(Level.WARNING)) {
                                    log.warning("Value '" + v + "' not in Range: " + range);
                                }
                            }
                        }
                    }
                    in.setFieldValue(inpValue);
                    if (log.isLoggable(Level.CONFIG)) {
                        log.config("@In " + comp.getClass().getName() + "@" + fieldName + " <- '" + inpValue + "'");
                    }
                } catch (Exception ex) {
                    throw new ComponentException("Failed setting '" + fieldName + "' type " + in.getField().getType().getCanonicalName() + " <- " + ex.getMessage());
                }
                continue;
            } else {
                if (System.getProperty("oms.check_params") != null) {
                    try {
                        if (w == null) {
                            file = new File(System.getProperty("oms3.work", System.getProperty("user.dir")), "missing_params.csv");
                            w = new PrintWriter(new FileWriter(file));
                            w.println("# Missing parameter, copy those entries into one of your parameter files.");
                        }
                        String val = null;
                        Bound b = null;
                        Object o = in.getFieldValue();
                        if (o != null) {
                            val = o.toString();
                        } else {
                            b = in.getField().getAnnotation(Bound.class);
                            if (b != null) {
                                try {
                                    Object v = inp.get(b.value());
                                    if (v == null) {
                                        v = new Integer(0);
                                    }
                                    int dim = Integer.parseInt(v.toString());
                                    int[] d = new int[dim];
                                    val = Conversions.convert(d, String.class);
                                } catch (NumberFormatException E) {
                                    val = "?";
                                }
                            } else {
                                val = "?";
                            }
                        }
                        w.println("@P, " + fieldName + ",  \"" + val + "\"");
                        if (b != null) {
                            w.println(" bound, " + b.value());
                        }
                    } catch (Exception E) {
                        throw new RuntimeException(E);
                    }
                }
                if (log.isLoggable(Level.WARNING)) {
                    log.warning("No Input for '" + fieldName + "'");
                }
            }
        }
        if (w != null) {
            w.close();
            System.out.println("Missing parameter [" + file + "]");
            success = false;
        }
        return success;
    }
1168118
public void configure(JobConf job) {
    this.inputFile = job.get("map.input.file");
    maxNumItems = job.getLong("aggregate.max.num.unique.values",
                              Long.MAX_VALUE);
  }
586849
public void read_lock( Key<Job> job_key ) { 
    if( _key != null ) {
      Log.debug("shared-read-lock "+_key+" by job "+job_key);
      new ReadLock(job_key).invoke(_key); 
    }
  }
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));
        }
    }
948622
public synchronized void setPool(JobInProgress job, String pool) {
    removeJob(job);
    job.getJobConf().set(EXPLICIT_POOL_PROPERTY, pool);
    addJob(job);
  }
473195
public void setLocation(String location, Job job) throws IOException
    {
        conf = job.getConfiguration();
        setLocationFromUri(location);

        if (username != null && password != null)
        {
            ConfigHelper.setInputKeyspaceUserNameAndPassword(conf, username, password);
            CqlConfigHelper.setUserNameAndPassword(conf, username, password);
        }
        if (splitSize > 0)
            ConfigHelper.setInputSplitSize(conf, splitSize);
        if (partitionerClass!= null)
            ConfigHelper.setInputPartitioner(conf, partitionerClass);
        if (initHostAddress != null)
            ConfigHelper.setInputInitialAddress(conf, initHostAddress);
        if (rpcPort != null)
            ConfigHelper.setInputRpcPort(conf, rpcPort);
        if (nativePort != null)
            CqlConfigHelper.setInputNativePort(conf, nativePort);
        if (nativeCoreConnections != null)
            CqlConfigHelper.setInputCoreConnections(conf, nativeCoreConnections);
        if (nativeMaxConnections != null)
            CqlConfigHelper.setInputMaxConnections(conf, nativeMaxConnections);
        if (nativeMinSimultReqs != null)
            CqlConfigHelper.setInputMinSimultReqPerConnections(conf, nativeMinSimultReqs);
        if (nativeMaxSimultReqs != null)
            CqlConfigHelper.setInputMaxSimultReqPerConnections(conf, nativeMaxSimultReqs);
        if (nativeConnectionTimeout != null)
            CqlConfigHelper.setInputNativeConnectionTimeout(conf, nativeConnectionTimeout);
        if (nativeReadConnectionTimeout != null)
            CqlConfigHelper.setInputNativeReadConnectionTimeout(conf, nativeReadConnectionTimeout);
        if (nativeReceiveBufferSize != null)
            CqlConfigHelper.setInputNativeReceiveBufferSize(conf, nativeReceiveBufferSize);
        if (nativeSendBufferSize != null)
            CqlConfigHelper.setInputNativeSendBufferSize(conf, nativeSendBufferSize);
        if (nativeSolinger != null)
            CqlConfigHelper.setInputNativeSolinger(conf, nativeSolinger);
        if (nativeTcpNodelay != null)
            CqlConfigHelper.setInputNativeTcpNodelay(conf, nativeTcpNodelay);
        if (nativeReuseAddress != null)
            CqlConfigHelper.setInputNativeReuseAddress(conf, nativeReuseAddress);
        if (nativeKeepAlive != null)
            CqlConfigHelper.setInputNativeKeepAlive(conf, nativeKeepAlive);
        if (nativeAuthProvider != null)
            CqlConfigHelper.setInputNativeAuthProvider(conf, nativeAuthProvider);
        if (nativeSSLTruststorePath != null)
            CqlConfigHelper.setInputNativeSSLTruststorePath(conf, nativeSSLTruststorePath);
        if (nativeSSLKeystorePath != null)
            CqlConfigHelper.setInputNativeSSLKeystorePath(conf, nativeSSLKeystorePath);
        if (nativeSSLTruststorePassword != null)
            CqlConfigHelper.setInputNativeSSLTruststorePassword(conf, nativeSSLTruststorePassword);
        if (nativeSSLKeystorePassword != null)
            CqlConfigHelper.setInputNativeSSLKeystorePassword(conf, nativeSSLKeystorePassword);
        if (nativeSSLCipherSuites != null)
            CqlConfigHelper.setInputNativeSSLCipherSuites(conf, nativeSSLCipherSuites);

        ConfigHelper.setInputColumnFamily(conf, keyspace, column_family);
        setConnectionInformation();

        CqlConfigHelper.setInputCQLPageRowSize(conf, String.valueOf(pageSize));
        if (inputCql != null)
            CqlConfigHelper.setInputCql(conf, inputCql);
        if (columns != null)
            CqlConfigHelper.setInputColumns(conf, columns);
        if (whereClause != null)
            CqlConfigHelper.setInputWhereClauses(conf, whereClause);

        String whereClauseForPartitionFilter = getWhereClauseForPartitionFilter();
        String wc = whereClause != null && !whereClause.trim().isEmpty() 
                               ? whereClauseForPartitionFilter == null ? whereClause: String.format("%s AND %s", whereClause.trim(), whereClauseForPartitionFilter)
                               : whereClauseForPartitionFilter;

        if (wc != null)
        {
            logger.debug("where clause: {}", wc);
            CqlConfigHelper.setInputWhereClauses(conf, wc);
        } 
        if (System.getenv(PIG_INPUT_SPLIT_SIZE) != null)
        {
            try
            {
                ConfigHelper.setInputSplitSize(conf, Integer.parseInt(System.getenv(PIG_INPUT_SPLIT_SIZE)));
            }
            catch (NumberFormatException e)
            {
                throw new IOException("PIG_INPUT_SPLIT_SIZE is not a number", e);
            }           
        }

        if (ConfigHelper.getInputInitialAddress(conf) == null)
            throw new IOException("PIG_INPUT_INITIAL_ADDRESS or PIG_INITIAL_ADDRESS environment variable not set");
        if (ConfigHelper.getInputPartitioner(conf) == null)
            throw new IOException("PIG_INPUT_PARTITIONER or PIG_PARTITIONER environment variable not set");
        if (loadSignature == null)
            loadSignature = location;

        initSchema(loadSignature);
    }
56927
public void configure(JobConf job) {
    shards = Shard.getIndexShards(new IndexUpdateConfiguration(job));
    map = new HashMap<Shard, Integer>();
    for (int i = 0; i < shards.length; i++) {
      map.put(shards[i], i);
    }
  }
1152658
public void setJobName (final String jobName)
  {
    if (jobName == null || jobName.trim ().length () == 0)
    {
      throw new IllegalArgumentException ("Job name cannot be null or empty.");
    }

    m_sJobName = jobName;
  }
1014648
private void internalUpdateJobStateAndResult(final JobInstance job) {
        transactionTemplate.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                jobInstanceDao.updateStateAndResult(job);
                if (job.isCompleted()) {
                    buildPropertiesService.saveCruiseProperties(job);
                }
            }
        });
    }
416116
public void setJobType(int jobType) {
	String type = null;
	switch(jobType) {
	case JOBTYPE_SINGLE:
	    type = "single"; break;
	case JOBTYPE_MULTIPLE:
	    type = "multiple"; break;
	case JOBTYPE_MPI:
	    type = "mpi"; break;
	case JOBTYPE_CONDOR:
	    type = "condor"; break;
	}
	if (type != null) {
	    set("jobtype", type);
	}
    }