Examples of addResource()


Examples of org.apache.hadoop.chukwa.conf.ChukwaConfiguration.addResource()

                        Path jobconf = new Path("/.JOBS/" + jobid + ".xml");
                        FileSystem fs = jobconf.getFileSystem(chukwaconf);
                       
                        if(fs.exists(jobconf)){
                            ChukwaConfiguration tempconf = new ChukwaConfiguration(false);
                            tempconf.addResource(fs.open(jobconf));
                            if(testname==null || testname.equals("")) testname = tempconf.get(AnalysisProcessorConfiguration.reportfile);
                            if(starttime==null || starttime.equals(""))starttime = tempconf.get(AnalysisProcessorConfiguration.basestart);
                            if(endtime==null || endtime.equals(""))endtime = tempconf.get(AnalysisProcessorConfiguration.baseend);
                        }else {
                            log.warn("The analysis conf file for " + jobid + " (" + jobconf.toString() + ") doesn't exist." );
View Full Code Here

Examples of org.apache.hadoop.conf.Configuration.addResource()

    private OozieUtils() {}

    public static Properties toProperties(String properties) {
        Configuration conf = new Configuration(false);
        conf.addResource(new ByteArrayInputStream(properties.getBytes()));
        Properties jobprops = new Properties();
        for (Map.Entry<String, String> entry : conf) {
            jobprops.put(entry.getKey(), entry.getValue());
        }
        return jobprops;
View Full Code Here

Examples of org.apache.hadoop.hdfs.HdfsConfiguration.addResource()

      // In case of IMPORT this will get rid of default directories
      // but will retain directories specified in hdfs-site.xml
      // When importing image from a checkpoint, the name-node can
      // start with empty set of storage directories.
      Configuration cE = new HdfsConfiguration(false);
      cE.addResource("core-default.xml");
      cE.addResource("core-site.xml");
      cE.addResource("hdfs-default.xml");
      Collection<String> dirNames2 = cE.getTrimmedStringCollection(propertyName);
      dirNames.removeAll(dirNames2);
      if(dirNames.isEmpty())
View Full Code Here

Examples of org.apache.hadoop.hive.conf.HiveConf.addResource()

public class JavaAction {

  public static void main(String[] args) throws Exception{

    HiveConf conf = new HiveConf();
    conf.addResource(new Path("file:///", System.getProperty("oozie.action.conf.xml")));
    conf.setVar(ConfVars.SEMANTIC_ANALYZER_HOOK, HowlSemanticAnalyzer.class.getName());
    conf.setBoolVar(ConfVars.METASTORE_USE_THRIFT_SASL, true);
    SessionState.start(new CliSessionState(conf));
    new CliDriver().processLine(args[0]);
  }
View Full Code Here

Examples of org.apache.hadoop.mapred.JobConf.addResource()

    public static JobConf config() {// Hadoop集群的远程配置信息
        JobConf conf = new JobConf(Purchase.class);
        conf.setJobName("purchase");
        conf.addResource("classpath:/hadoop/core-site.xml");
        conf.addResource("classpath:/hadoop/hdfs-site.xml");
        conf.addResource("classpath:/hadoop/mapred-site.xml");
        return conf;
    }
   
    public static Map<String,String> path(){
        Map<String, String> path = new HashMap<String, String>();
View Full Code Here

Examples of org.apache.hadoop.yarn.conf.YarnConfiguration.addResource()

              Integer.parseInt(nodePortString),
              Integer.parseInt(nodeHttpPortString), appSubmitTime);
      Runtime.getRuntime().addShutdownHook(
          new CompositeServiceShutdownHook(appMaster));
      YarnConfiguration conf = new YarnConfiguration(new JobConf());
      conf.addResource(new Path(MRJobConfig.JOB_CONF_FILE));
      String jobUserName = System
          .getenv(ApplicationConstants.Environment.USER.name());
      conf.set(MRJobConfig.USER_NAME, jobUserName);
      initAndStartAppMaster(appMaster, conf, jobUserName);
    } catch (Throwable t) {
View Full Code Here

Examples of org.apache.hadoop.yarn.server.nodemanager.api.protocolrecords.LocalizerHeartbeatResponse.addResource()

      // remote-fetching.
      if (remoteResourceStatuses.isEmpty()) {
        LocalResource next = findNextResource();
        if (next != null) {
          response.setLocalizerAction(LocalizerAction.LIVE);
          response.addResource(next);
        } else if (pending.isEmpty()) {
          // TODO: Synchronization
          response.setLocalizerAction(LocalizerAction.DIE);
        } else {
          response.setLocalizerAction(LocalizerAction.LIVE);
View Full Code Here

Examples of org.apache.hama.HamaConfiguration.addResource()

        Path localJarFile = defaultJobConf.getLocalPath(SUBDIR + "/"
            + task.getTaskID() + "/" + "job.jar");
        systemFS.copyToLocalFile(new Path(task.getJobFile()), localJobFile);

        HamaConfiguration conf = new HamaConfiguration();
        conf.addResource(localJobFile);
        jobConf = new BSPJob(conf, task.getJobID().toString());

        Path jarFile = null;
        if (jobConf.getJar() != null) {
          jarFile = new Path(jobConf.getJar());
View Full Code Here

Examples of org.apache.helix.HelixAdmin.addResource()

      HelixAdmin admin = new ZKHelixAdmin(zkAddress);
      admin.addCluster(clusterName, true);
      StateModelConfigGenerator generator = new StateModelConfigGenerator();
      admin.addStateModelDef(clusterName, "OnlineOffline",
          new StateModelDefinition(generator.generateConfigForOnlineOffline()));
      admin.addResource(clusterName, lockGroupName, numPartitions,
          "OnlineOffline", IdealStateModeProperty.AUTO_REBALANCE.toString());
      admin.rebalance(clusterName, lockGroupName, 1);
      for (int i = 0; i < numInstances; i++)
      {
        final String instanceName = "localhost_" + (12000 + i);
View Full Code Here

Examples of org.apache.helix.api.accessor.ClusterAccessor.addResource()

    idealStateBuilder.setNumReplica(1).setStateModelDefId(stateModelDefId);
    idealStateBuilder.assignPreferenceList(partition0, participantId);
    IdealState idealState = idealStateBuilder.build();
    clusterAccessor.createCluster(new ClusterConfig.Builder(clusterId).addStateModelDefinition(
        stateModelDef).build());
    clusterAccessor.addResource(new ResourceConfig.Builder(resourceId).idealState(idealState)
        .build());
    clusterAccessor.addParticipant(new ParticipantConfig.Builder(participantId).build());

    // start controller
    HelixController controller = connection.createController(clusterId, controllerId);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.