get framework specific JobDescFactory based on configuration
@param jobConf configuration of the job
@return framework specific JobDescFactory
768817
public static JobDescFactoryBase getFrameworkSpecificJobDescFactory(Configuration jobConf) {
    Framework framework = getFramework(jobConf);

    switch (framework) {
    case PIG:
      return PIG_JOB_DESC_FACTORY;
    case SCALDING:
      return SCALDING_JOB_DESC_FACTORY;
    default:
      return MR_JOB_DESC_FACTORY;
    }
  }
753558
public static JobBuilder newJobBuilder(Class<? extends Job> jobClass) {

    JobBuilder b = new JobBuilder();
    b.ofType(jobClass);
    return b;
  }
730542
public Configuration getRawJobConfiguration(QualifiedJobId jobId)
      throws IOException {
    Configuration conf = null;
    byte[] rowKey = idConv.toBytes(jobId);
    Get get = new Get(rowKey);
    get.addColumn(Constants.RAW_FAM_BYTES, Constants.JOBCONF_COL_BYTES);
    Table rawTable = null;
    try {
      rawTable = hbaseConnection
          .getTable(TableName.valueOf(Constants.HISTORY_RAW_TABLE));
      Result result = rawTable.get(get);
      if (result != null && !result.isEmpty()) {
        conf = createConfigurationFromResult(result);
      }
    } catch (MissingColumnInResultException e) {
      LOG.error(
          "Failed to retrieve configuration from row returned for " + jobId, e);
    } finally {
      if (rawTable != null) {
        rawTable.close();
      }
    }
    return conf;
  }
837288
public static EntityGetOperation<JobInfo> get(String jobId) {
        return new DefaultGetOperation<JobInfo>(ENTITY_SET, jobId,
                JobInfo.class);
    }
991871
@SuppressWarnings("unchecked")
  private ConfigStoreFactory<ConfigStore> getConfigStoreFactory(URI configKeyUri)
      throws ConfigStoreFactoryDoesNotExistsException {
    @SuppressWarnings("rawtypes")
    ConfigStoreFactory csf = this.configStoreFactoryRegister.getConfigStoreFactory(configKeyUri.getScheme());
    if (csf == null) {
      throw new ConfigStoreFactoryDoesNotExistsException(configKeyUri.getScheme(), "scheme name does not exists");
    }

    return csf;
  }
366330
public alluxio.grpc.JobInfoOrBuilder getJobInfoOrBuilder() {
    return jobInfo_ == null ? alluxio.grpc.JobInfo.getDefaultInstance() : jobInfo_;
  }
629924
@Override
  public Configuration getMainConfiguration() {

    return Tang.Factory.getTang().newConfigurationBuilder()
            .bindImplementation(RuntimeClasspathProvider.class, YarnClasspathProvider.class)
            .bindConstructor(org.apache.hadoop.yarn.conf.YarnConfiguration.class, YarnConfigurationConstructor.class)
            .build();
  }
1120301
@Bean
  public JobFactory<ScriptJobExecution> scriptJobFactory() {
    return new JobFactory<ScriptJobExecution>() {
      @Override
      public Job<ScriptResult> createJob(ScriptJobExecution scriptJobExecution) {
        final String name = scriptJobExecution.getName();
        final String parameterString = scriptJobExecution.getParameters();
        return progress -> {
          Map<String, Object> params = new HashMap<>();
          params.putAll(gson.fromJson(parameterString, MAP_TOKEN));
          params.put("scriptJobExecutionId", scriptJobExecution.getIdValue());
          ScriptResult scriptResult = savedScriptRunner.runScript(name, params);
          if (scriptResult.getOutputFile() != null) {
            scriptJobExecution.setResultUrl(
                format("/files/%s", scriptResult.getOutputFile().getId()));
          }
          progress.status(format("Script output:%n%s", scriptResult.getOutput()));
          return scriptResult;
        };
      }
    };
  }
1083886
@Override
  public JobMasterClientContext build() {
    if (mMasterInquireClient == null) {
      mMasterInquireClient = MasterInquireClient.Factory.createForJobMaster(mContext.getConf());
    }
    return new JobMasterClientContext(mContext, mMasterInquireClient);
  }
620385
public static Type[] getEnvironmentRepositoryFactoryTypeParams(
			ConfigurableListableBeanFactory beanFactory, String factoryName) {
		MethodMetadata methodMetadata = (MethodMetadata) beanFactory
				.getBeanDefinition(factoryName).getSource();
		Class<?> factoryClass = null;
		try {
			factoryClass = Class.forName(methodMetadata.getReturnTypeName());
		}
		catch (ClassNotFoundException e) {
			throw new IllegalStateException(e);
		}
		Optional<AnnotatedType> annotatedFactoryType = Arrays
				.stream(factoryClass.getAnnotatedInterfaces()).filter(i -> {
					ParameterizedType parameterizedType = (ParameterizedType) i.getType();
					return parameterizedType.getRawType()
							.equals(EnvironmentRepositoryFactory.class);
				}).findFirst();
		ParameterizedType factoryParameterizedType = (ParameterizedType) annotatedFactoryType
				.orElse(factoryClass.getAnnotatedSuperclass()).getType();
		return factoryParameterizedType.getActualTypeArguments();
	}
708387
static ConverterFactory getConverterFactory(Configuration conf) {
    Class<? extends ConverterFactory> converterFactoryClass = conf.getClass(CONVERTER_FACTORY, null,
        ConverterFactory.class);
    if (converterFactoryClass == null) {
      throw new RuntimeException("ConverterFactory class was not set on the configuration");
    }
    LOG.debug("Got input ConverterFactory class from conf: {}", converterFactoryClass);
    return ReflectionUtils.newInstance(converterFactoryClass, conf);
  }
714602
@SuppressWarnings("deprecation")
  private static JobConf createJobConfForCopyByChunk(Configuration conf) {
    JobConf jobconf = new JobConf(conf, DistCp.class);
    jobconf.setJobName(NAME);

    // turn off speculative execution, because DFS doesn't handle
    // multiple writers to the same file.
    jobconf.setReduceSpeculativeExecution(false);

    jobconf.setMapOutputKeyClass(Text.class);
    jobconf.setMapOutputValueClass(IntWritable.class);
    jobconf.setOutputKeyClass(Text.class);
    jobconf.setOutputValueClass(Text.class);

    jobconf.setInputFormat(CopyByChunkInputFormat.class);
    jobconf.setMapperClass(CopyFilesByChunkMapper.class);
    jobconf.setReducerClass(CopyFilesByChunkReducer.class);
    
    // Prevent the reducer from starting until all maps are done.
    jobconf.setInt("mapred.job.rushreduce.reduce.threshold", 0);
    jobconf.setFloat("mapred.reduce.slowstart.completed.maps", 1.0f);
    
    return jobconf;
  }
569034
public synchronized ComponentMetricStore getJobMetricStore(String jobID) {
		return jobID == null ? null : ComponentMetricStore.unmodifiable(jobs.get(jobID));
	}
129946
public FacesConfigFactoryType<FacesConfigType<T>> getOrCreateFactory()
   {
      List<Node> nodeList = childNode.get("factory");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigFactoryTypeImpl<FacesConfigType<T>>(this, "factory", childNode, nodeList.get(0));
      }
      return createFactory();
   }
10377
public JdbcMapperFactory getterFactory(final GetterFactory<ResultSet, JdbcColumnKey> getterFactory) {
		return addGetterFactory(new ContextualGetterFactoryAdapter<ResultSet, JdbcColumnKey>(getterFactory));
	}
162092
protected JobSpec jobSpecGenerator(FlowSpec flowSpec) {
    JobSpec jobSpec;
    JobSpec.Builder jobSpecBuilder = JobSpec.builder(jobSpecURIGenerator(flowSpec))
        .withConfig(flowSpec.getConfig())
        .withDescription(flowSpec.getDescription())
        .withVersion(flowSpec.getVersion());

    if (flowSpec.getTemplateURIs().isPresent() && templateCatalog.isPresent()) {
      // Only first template uri will be honored for Identity
      jobSpecBuilder = jobSpecBuilder.withTemplate(flowSpec.getTemplateURIs().get().iterator().next());
      try {
        jobSpec = new ResolvedJobSpec(jobSpecBuilder.build(), templateCatalog.get());
        log.info("Resolved JobSpec properties are: " + jobSpec.getConfigAsProperties());
      } catch (SpecNotFoundException | JobTemplate.TemplateException e) {
        throw new RuntimeException("Could not resolve template in JobSpec from TemplateCatalog", e);
      }
    } else {
      jobSpec = jobSpecBuilder.build();
      log.info("Unresolved JobSpec properties are: " + jobSpec.getConfigAsProperties());
    }

    // Remove schedule
    jobSpec.setConfig(jobSpec.getConfig().withoutPath(ConfigurationKeys.JOB_SCHEDULE_KEY));

    // Add job.name and job.group
    if (flowSpec.getConfig().hasPath(ConfigurationKeys.FLOW_NAME_KEY)) {
      jobSpec.setConfig(jobSpec.getConfig()
          .withValue(ConfigurationKeys.JOB_NAME_KEY, flowSpec.getConfig().getValue(ConfigurationKeys.FLOW_NAME_KEY)));
    }
    if (flowSpec.getConfig().hasPath(ConfigurationKeys.FLOW_GROUP_KEY)) {
      jobSpec.setConfig(jobSpec.getConfig()
          .withValue(ConfigurationKeys.JOB_GROUP_KEY, flowSpec.getConfig().getValue(ConfigurationKeys.FLOW_GROUP_KEY)));
    }

    // Add flow execution id for this compilation
    long flowExecutionId = FlowUtils.getOrCreateFlowExecutionId(flowSpec);
    jobSpec.setConfig(jobSpec.getConfig().withValue(ConfigurationKeys.FLOW_EXECUTION_ID_KEY,
        ConfigValueFactory.fromAnyRef(flowExecutionId)));

    // Reset properties in Spec from Config
    jobSpec.setConfigAsProperties(ConfigUtils.configToProperties(jobSpec.getConfig()));
    return jobSpec;
  }
16899
public ServiceFactory getServiceFactory(AppContextWrapper sc) {
		ContainerWrapper containerWrapper = containerFinder.findContainer(sc);
		ServiceFactory serviceFactory = (ServiceFactory) containerWrapper.lookup(ComponentKeys.WEBSERVICE_FACTORY);
		return serviceFactory;
	}