当前位置: 首页>>代码示例>>Java>>正文


Java ResourceSchedulerWrapper类代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper的典型用法代码示例。如果您正苦于以下问题:Java ResourceSchedulerWrapper类的具体用法?Java ResourceSchedulerWrapper怎么用?Java ResourceSchedulerWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ResourceSchedulerWrapper类属于org.apache.hadoop.yarn.sls.scheduler包,在下文中一共展示了ResourceSchedulerWrapper类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper; //导入依赖的package包/类
public void start() throws Exception {
  // start resource manager
  startRM();
  // start node managers
  startNM();
  // start application masters
  startAM();
  // set queue & tracked apps information
  ((ResourceSchedulerWrapper) rm.getResourceScheduler())
                          .setQueueSet(this.queueAppNumMap.keySet());
  ((ResourceSchedulerWrapper) rm.getResourceScheduler())
                          .setTrackedAppSet(this.trackedApps);
  // print out simulation info
  printSimulationInfo();
  // blocked until all nodes RUNNING
  waitForNodesRunning();
  // starting the runner once everything is ready to go,
  runner.start();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:SLSRunner.java

示例2: startRM

import org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper; //导入依赖的package包/类
private void startRM() throws IOException, ClassNotFoundException {
  Configuration rmConf = new YarnConfiguration();
  String schedulerClass = rmConf.get(YarnConfiguration.RM_SCHEDULER);

  // For CapacityScheduler we use a sub-classing instead of wrapping
  // to allow scheduler-specific invocations from monitors to work
  // this can be used for other schedulers as well if we care to
  // exercise/track behaviors that are not common to the scheduler api
  if(Class.forName(schedulerClass) == CapacityScheduler.class) {
    rmConf.set(YarnConfiguration.RM_SCHEDULER,
        SLSCapacityScheduler.class.getName());
  } else {
    rmConf.set(YarnConfiguration.RM_SCHEDULER,
            ResourceSchedulerWrapper.class.getName());
    rmConf.set(SLSConfiguration.RM_SCHEDULER, schedulerClass);
  }

  rmConf.set(SLSConfiguration.METRICS_OUTPUT_DIR, metricsOutputDir);
  rm = new ResourceManager();
  rm.init(rmConf);
  rm.start();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:23,代码来源:SLSRunner.java

示例3: SLSWebApp

import org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper; //导入依赖的package包/类
public SLSWebApp(ResourceSchedulerWrapper wrapper, int metricsAddressPort) {
  this.wrapper = wrapper;
  metrics = wrapper.getMetrics();
  handleOperTimecostHistogramMap =
          new HashMap<SchedulerEventType, Histogram>();
  queueAllocatedMemoryCounterMap = new HashMap<String, Counter>();
  queueAllocatedVCoresCounterMap = new HashMap<String, Counter>();
  schedulerMetrics = wrapper.getSchedulerMetrics();
  port = metricsAddressPort;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:SLSWebApp.java

示例4: startRM

import org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper; //导入依赖的package包/类
private void startRM() throws IOException, ClassNotFoundException {
  Configuration rmConf = new YarnConfiguration();
  String schedulerClass = rmConf.get(YarnConfiguration.RM_SCHEDULER);
  rmConf.set(SLSConfiguration.RM_SCHEDULER, schedulerClass);
  rmConf.set(YarnConfiguration.RM_SCHEDULER,
          ResourceSchedulerWrapper.class.getName());
  rmConf.set(SLSConfiguration.METRICS_OUTPUT_DIR, metricsOutputDir);
  rm = new ResourceManager();
  rm.init(rmConf);
  rm.start();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:SLSRunner.java

示例5: lastStep

import org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper; //导入依赖的package包/类
@Override
public void lastStep() throws Exception {
  LOG.info(MessageFormat.format("Application {0} is shutting down.", appId));
  // unregister tracking
  if (isTracked) {
    untrackApp();
  }
  // unregister application master
  final FinishApplicationMasterRequest finishAMRequest = recordFactory
                .newRecordInstance(FinishApplicationMasterRequest.class);
  finishAMRequest.setFinalApplicationStatus(FinalApplicationStatus.SUCCEEDED);

  UserGroupInformation ugi =
      UserGroupInformation.createRemoteUser(appAttemptId.toString());
  Token<AMRMTokenIdentifier> token = rm.getRMContext().getRMApps().get(appId)
      .getRMAppAttempt(appAttemptId).getAMRMToken();
  ugi.addTokenIdentifier(token.decodeIdentifier());
  ugi.doAs(new PrivilegedExceptionAction<Object>() {
    @Override
    public Object run() throws Exception {
      rm.getApplicationMasterService()
          .finishApplicationMaster(finishAMRequest);
      return null;
    }
  });

  simulateFinishTimeMS = System.currentTimeMillis() -
      SLSRunner.getRunner().getStartTimeMS();
  // record job running information
  ((ResourceSchedulerWrapper)rm.getResourceScheduler())
       .addAMRuntime(appId, 
                    traceStartTimeMS, traceFinishTimeMS, 
                    simulateStartTimeMS, simulateFinishTimeMS);
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:35,代码来源:AMSimulator.java

示例6: startRM

import org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper; //导入依赖的package包/类
private void startRM() throws IOException, ClassNotFoundException {
  Configuration rmConf = new YarnConfiguration();
  String schedulerClass = rmConf.get(YarnConfiguration.RM_SCHEDULER);
  rmConf.set(SLSConfiguration.RM_SCHEDULER, schedulerClass);
  rmConf.set(YarnConfiguration.RM_SCHEDULER,
          ResourceSchedulerWrapper.class.getName());
  rmConf.set(SLSConfiguration.METRICS_OUTPUT_DIR, metricsOutputDir);
  RMStorageFactory.setConfiguration(rmConf);
  YarnAPIStorageFactory.setConfiguration(rmConf);
  DBUtility.InitializeDB();
  rm = new ResourceManager();
  rm.init(rmConf);
  rm.start();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:15,代码来源:SLSRunner.java

示例7: trackApp

import org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper; //导入依赖的package包/类
private void trackApp() {
  if (isTracked) {
    ((ResourceSchedulerWrapper) rm.getResourceScheduler())
            .addTrackedApp(appAttemptId, oldAppId);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:AMSimulator.java

示例8: untrackApp

import org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper; //导入依赖的package包/类
public void untrackApp() {
  if (isTracked) {
    ((ResourceSchedulerWrapper) rm.getResourceScheduler())
            .removeTrackedApp(appAttemptId, oldAppId);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:AMSimulator.java


注:本文中的org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。