• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java YarnScheduler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: normalizeAndValidateRequests

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
/**
 * Utility method to validate a list resource requests, by insuring that the
 * requested memory/vcore is non-negative and not greater than max
 */
public static void normalizeAndValidateRequests(List<ResourceRequest> ask,
    Resource maximumResource, String queueName, YarnScheduler scheduler,
    RMContext rmContext)
    throws InvalidResourceRequestException {

  QueueInfo queueInfo = null;
  try {
    queueInfo = scheduler.getQueueInfo(queueName, false, false);
  } catch (IOException e) {
  }

  for (ResourceRequest resReq : ask) {
    SchedulerUtils.normalizeAndvalidateRequest(resReq, maximumResource,
        queueName, scheduler, rmContext, queueInfo);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:RMServerUtils.java


示例2: RMAppAttemptImpl

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
public RMAppAttemptImpl(ApplicationAttemptId appAttemptId,
    RMContext rmContext, YarnScheduler scheduler,
    ApplicationMasterService masterService,
    ApplicationSubmissionContext submissionContext,
    Configuration conf, boolean maybeLastAttempt, ResourceRequest amReq) {
  this.conf = conf;
  this.applicationAttemptId = appAttemptId;
  this.rmContext = rmContext;
  this.eventHandler = rmContext.getDispatcher().getEventHandler();
  this.submissionContext = submissionContext;
  this.scheduler = scheduler;
  this.masterService = masterService;

  ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
  this.readLock = lock.readLock();
  this.writeLock = lock.writeLock();

  this.proxiedTrackingUrl = generateProxyUriWithScheme();
  this.maybeLastAttempt = maybeLastAttempt;
  this.stateMachine = stateMachineFactory.make(this);

  this.attemptMetrics =
      new RMAppAttemptMetrics(applicationAttemptId, rmContext);
  
  this.amReq = amReq;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:27,代码来源:RMAppAttemptImpl.java


示例3: RMAppManager

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
public RMAppManager(RMContext context,
    YarnScheduler scheduler, ApplicationMasterService masterService,
    ApplicationACLsManager applicationACLsManager, Configuration conf) {
  this.rmContext = context;
  this.scheduler = scheduler;
  this.masterService = masterService;
  this.applicationACLsManager = applicationACLsManager;
  this.conf = conf;
  this.maxCompletedAppsInMemory = conf.getInt(
      YarnConfiguration.RM_MAX_COMPLETED_APPLICATIONS,
      YarnConfiguration.DEFAULT_RM_MAX_COMPLETED_APPLICATIONS);
  this.maxCompletedAppsInStateStore =
      conf.getInt(
        YarnConfiguration.RM_STATE_STORE_MAX_COMPLETED_APPLICATIONS,
        YarnConfiguration.DEFAULT_RM_STATE_STORE_MAX_COMPLETED_APPLICATIONS);
  if (this.maxCompletedAppsInStateStore > this.maxCompletedAppsInMemory) {
    this.maxCompletedAppsInStateStore = this.maxCompletedAppsInMemory;
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:RMAppManager.java


示例4: testGetApplicationResourceUsageReportDummy

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
@Test
public void testGetApplicationResourceUsageReportDummy() throws YarnException,
    IOException {
  ApplicationAttemptId attemptId = getApplicationAttemptId(1);
  YarnScheduler yarnScheduler = mockYarnScheduler();
  RMContext rmContext = mock(RMContext.class);
  mockRMContext(yarnScheduler, rmContext);
  when(rmContext.getDispatcher().getEventHandler()).thenReturn(
      new EventHandler<Event>() {
        public void handle(Event event) {
        }
      });
  ApplicationSubmissionContext asContext = 
      mock(ApplicationSubmissionContext.class);
  YarnConfiguration config = new YarnConfiguration();
  RMAppAttemptImpl rmAppAttemptImpl = new RMAppAttemptImpl(attemptId,
      rmContext, yarnScheduler, null, asContext, config, false, null);
  ApplicationResourceUsageReport report = rmAppAttemptImpl
      .getApplicationResourceUsageReport();
  assertEquals(report, RMServerUtils.DUMMY_APPLICATION_RESOURCE_USAGE_REPORT);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:TestClientRMService.java


示例5: createRMService

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
public ClientRMService createRMService() throws IOException {
  YarnScheduler yarnScheduler = mockYarnScheduler();
  RMContext rmContext = mock(RMContext.class);
  mockRMContext(yarnScheduler, rmContext);
  ConcurrentHashMap<ApplicationId, RMApp> apps = getRMApps(rmContext,
      yarnScheduler);
  when(rmContext.getRMApps()).thenReturn(apps);
  when(rmContext.getYarnConfiguration()).thenReturn(new Configuration());
  RMAppManager appManager = new RMAppManager(rmContext, yarnScheduler, null,
      mock(ApplicationACLsManager.class), new Configuration());
  when(rmContext.getDispatcher().getEventHandler()).thenReturn(
      new EventHandler<Event>() {
        public void handle(Event event) {
        }
      });

  ApplicationACLsManager mockAclsManager = mock(ApplicationACLsManager.class);
  QueueACLsManager mockQueueACLsManager = mock(QueueACLsManager.class);
  when(
      mockQueueACLsManager.checkAccess(any(UserGroupInformation.class),
          any(QueueACL.class), anyString())).thenReturn(true);
  return new ClientRMService(rmContext, yarnScheduler, appManager,
      mockAclsManager, mockQueueACLsManager, null);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:TestClientRMService.java


示例6: mockRMContext

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
private void mockRMContext(YarnScheduler yarnScheduler, RMContext rmContext)
    throws IOException {
  Dispatcher dispatcher = mock(Dispatcher.class);
  when(rmContext.getDispatcher()).thenReturn(dispatcher);
  EventHandler eventHandler = mock(EventHandler.class);
  when(dispatcher.getEventHandler()).thenReturn(eventHandler);
  QueueInfo queInfo = recordFactory.newRecordInstance(QueueInfo.class);
  queInfo.setQueueName("testqueue");
  when(yarnScheduler.getQueueInfo(eq("testqueue"), anyBoolean(), anyBoolean()))
      .thenReturn(queInfo);
  when(yarnScheduler.getQueueInfo(eq("nonexistentqueue"), anyBoolean(), anyBoolean()))
      .thenThrow(new IOException("queue does not exist"));
  RMApplicationHistoryWriter writer = mock(RMApplicationHistoryWriter.class);
  when(rmContext.getRMApplicationHistoryWriter()).thenReturn(writer);
  SystemMetricsPublisher publisher = mock(SystemMetricsPublisher.class);
  when(rmContext.getSystemMetricsPublisher()).thenReturn(publisher);
  ConcurrentHashMap<ApplicationId, RMApp> apps = getRMApps(rmContext,
      yarnScheduler);
  when(rmContext.getRMApps()).thenReturn(apps);
  when(yarnScheduler.getAppsInQueue(eq("testqueue"))).thenReturn(
      getSchedulerApps(apps));
   ResourceScheduler rs = mock(ResourceScheduler.class);
   when(rmContext.getScheduler()).thenReturn(rs);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:TestClientRMService.java


示例7: getRMApps

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
private ConcurrentHashMap<ApplicationId, RMApp> getRMApps(
    RMContext rmContext, YarnScheduler yarnScheduler) {
  ConcurrentHashMap<ApplicationId, RMApp> apps = 
    new ConcurrentHashMap<ApplicationId, RMApp>();
  ApplicationId applicationId1 = getApplicationId(1);
  ApplicationId applicationId2 = getApplicationId(2);
  ApplicationId applicationId3 = getApplicationId(3);
  YarnConfiguration config = new YarnConfiguration();
  apps.put(applicationId1, getRMApp(rmContext, yarnScheduler, applicationId1,
      config, "testqueue", 10, 3, 3));
  apps.put(applicationId2, getRMApp(rmContext, yarnScheduler, applicationId2,
      config, "a", 20, 2, 2));
  apps.put(applicationId3, getRMApp(rmContext, yarnScheduler, applicationId3,
      config, "testqueue", 40, 5, 5));
  return apps;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestClientRMService.java


示例8: mockYarnScheduler

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
private static YarnScheduler mockYarnScheduler() {
  YarnScheduler yarnScheduler = mock(YarnScheduler.class);
  when(yarnScheduler.getMinimumResourceCapability()).thenReturn(
      Resources.createResource(
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB));
  when(yarnScheduler.getMaximumResourceCapability()).thenReturn(
      Resources.createResource(
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB));
  when(yarnScheduler.getAppsInQueue(QUEUE_1)).thenReturn(
      Arrays.asList(getApplicationAttemptId(101), getApplicationAttemptId(102)));
  when(yarnScheduler.getAppsInQueue(QUEUE_2)).thenReturn(
      Arrays.asList(getApplicationAttemptId(103)));
  ApplicationAttemptId attemptId = getApplicationAttemptId(1);
  when(yarnScheduler.getAppResourceUsageReport(attemptId)).thenReturn(null);
  ResourceCalculator rc = new DefaultResourceCalculator();
  when(yarnScheduler.getResourceCalculator()).thenReturn(rc);
  return yarnScheduler;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestClientRMService.java


示例9: normalizeAndValidateRequests

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
/**
 * Utility method to validate a list resource requests, by insuring that the
 * requested memory/vcore is non-negative and not greater than max
 */
public static void normalizeAndValidateRequests(List<ResourceRequest> ask,
    Resource maximumResource, String queueName, YarnScheduler scheduler,
    RMContext rmContext)
    throws InvalidResourceRequestException {
  // Get queue from scheduler
  QueueInfo queueInfo = null;
  try {
    queueInfo = scheduler.getQueueInfo(queueName, false, false);
  } catch (IOException e) {
  }

  for (ResourceRequest resReq : ask) {
    SchedulerUtils.normalizeAndvalidateRequest(resReq, maximumResource,
        queueName, scheduler, rmContext, queueInfo);
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:21,代码来源:RMServerUtils.java


示例10: mockRMContext

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
private void mockRMContext(YarnScheduler yarnScheduler, RMContext rmContext)
    throws IOException {
  Dispatcher dispatcher = mock(Dispatcher.class);
  when(rmContext.getDispatcher()).thenReturn(dispatcher);
  EventHandler eventHandler = mock(EventHandler.class);
  when(dispatcher.getEventHandler()).thenReturn(eventHandler);
  QueueInfo queInfo = recordFactory.newRecordInstance(QueueInfo.class);
  queInfo.setQueueName("testqueue");
  when(yarnScheduler.getQueueInfo(eq("testqueue"), anyBoolean(), anyBoolean()))
      .thenReturn(queInfo);
  when(yarnScheduler.getQueueInfo(eq("nonexistentqueue"), anyBoolean(), anyBoolean()))
      .thenThrow(new IOException("queue does not exist"));
  RMApplicationHistoryWriter writer = mock(RMApplicationHistoryWriter.class);
  when(rmContext.getRMApplicationHistoryWriter()).thenReturn(writer);
  SystemMetricsPublisher publisher = mock(SystemMetricsPublisher.class);
  when(rmContext.getSystemMetricsPublisher()).thenReturn(publisher);
  when(rmContext.getYarnConfiguration()).thenReturn(new YarnConfiguration());
  ConcurrentHashMap<ApplicationId, RMApp> apps = getRMApps(rmContext,
      yarnScheduler);
  when(rmContext.getRMApps()).thenReturn(apps);
  when(yarnScheduler.getAppsInQueue(eq("testqueue"))).thenReturn(
      getSchedulerApps(apps));
   ResourceScheduler rs = mock(ResourceScheduler.class);
   when(rmContext.getScheduler()).thenReturn(rs);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:26,代码来源:TestClientRMService.java


示例11: getRMApps

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
private ConcurrentHashMap<ApplicationId, RMApp> getRMApps(
    RMContext rmContext, YarnScheduler yarnScheduler) {
  ConcurrentHashMap<ApplicationId, RMApp> apps = 
    new ConcurrentHashMap<ApplicationId, RMApp>();
  ApplicationId applicationId1 = getApplicationId(1);
  ApplicationId applicationId2 = getApplicationId(2);
  ApplicationId applicationId3 = getApplicationId(3);
  YarnConfiguration config = new YarnConfiguration();
  apps.put(applicationId1, getRMApp(rmContext, yarnScheduler, applicationId1,
      config, "testqueue", 10, 3,null,null));
  apps.put(applicationId2, getRMApp(rmContext, yarnScheduler, applicationId2,
      config, "a", 20, 2,null,""));
  apps.put(applicationId3, getRMApp(rmContext, yarnScheduler, applicationId3,
      config, "testqueue", 40, 5,"high-mem","high-mem"));
  return apps;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:17,代码来源:TestClientRMService.java


示例12: mockYarnScheduler

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
private static YarnScheduler mockYarnScheduler() {
  YarnScheduler yarnScheduler = mock(YarnScheduler.class);
  when(yarnScheduler.getMinimumResourceCapability()).thenReturn(
      Resources.createResource(
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB));
  when(yarnScheduler.getMaximumResourceCapability()).thenReturn(
      Resources.createResource(
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB));
  when(yarnScheduler.getAppsInQueue(QUEUE_1)).thenReturn(
      Arrays.asList(getApplicationAttemptId(101), getApplicationAttemptId(102)));
  when(yarnScheduler.getAppsInQueue(QUEUE_2)).thenReturn(
      Arrays.asList(getApplicationAttemptId(103)));
  ApplicationAttemptId attemptId = getApplicationAttemptId(1);
  when(yarnScheduler.getAppResourceUsageReport(attemptId)).thenReturn(null);

  ResourceCalculator rs = mock(ResourceCalculator.class);
  when(yarnScheduler.getResourceCalculator()).thenReturn(rs);

  return yarnScheduler;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:21,代码来源:TestClientRMService.java


示例13: getRMApps

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
private ConcurrentHashMap<ApplicationId, RMApp> getRMApps(
    RMContext rmContext, YarnScheduler yarnScheduler) {
  ConcurrentHashMap<ApplicationId, RMApp> apps = 
    new ConcurrentHashMap<ApplicationId, RMApp>();
  ApplicationId applicationId1 = getApplicationId(1);
  ApplicationId applicationId2 = getApplicationId(2);
  ApplicationId applicationId3 = getApplicationId(3);
  YarnConfiguration config = new YarnConfiguration();
  apps.put(applicationId1, getRMApp(rmContext, yarnScheduler, applicationId1,
      config, "testqueue", 10, 3));
  apps.put(applicationId2, getRMApp(rmContext, yarnScheduler, applicationId2,
      config, "a", 20, 2));
  apps.put(applicationId3, getRMApp(rmContext, yarnScheduler, applicationId3,
      config, "testqueue", 40, 5));
  return apps;
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:17,代码来源:TestClientRMService.java


示例14: RMAppAttemptImpl

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
public RMAppAttemptImpl(ApplicationAttemptId appAttemptId,
    RMContext rmContext, YarnScheduler scheduler,
    ApplicationMasterService masterService,
    ApplicationSubmissionContext submissionContext,
    Configuration conf, boolean maybeLastAttempt, ResourceRequest amReq) {
  this.conf = conf;
  this.applicationAttemptId = appAttemptId;
  this.rmContext = rmContext;
  this.eventHandler = rmContext.getDispatcher().getEventHandler();
  this.submissionContext = submissionContext;
  this.scheduler = scheduler;
  this.masterService = masterService;

  ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
  this.readLock = lock.readLock();
  this.writeLock = lock.writeLock();

  this.proxiedTrackingUrl = generateProxyUriWithScheme(null);
  this.maybeLastAttempt = maybeLastAttempt;
  this.stateMachine = stateMachineFactory.make(this);

  this.attemptMetrics =
      new RMAppAttemptMetrics(applicationAttemptId, rmContext);
  
  this.amReq = amReq;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:27,代码来源:RMAppAttemptImpl.java


示例15: createRMService

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
public ClientRMService createRMService() throws IOException {
  YarnScheduler yarnScheduler = mockYarnScheduler();
  RMContext rmContext = mock(RMContext.class);
  mockRMContext(yarnScheduler, rmContext);
  ConcurrentHashMap<ApplicationId, RMApp> apps = getRMApps(rmContext,
      yarnScheduler);
  when(rmContext.getRMApps()).thenReturn(apps);
  RMAppManager appManager = new RMAppManager(rmContext, yarnScheduler, null,
      mock(ApplicationACLsManager.class), new Configuration());
  when(rmContext.getDispatcher().getEventHandler()).thenReturn(
      new EventHandler<Event>() {
        public void handle(Event event) {
        }
      });

  ApplicationACLsManager mockAclsManager = mock(ApplicationACLsManager.class);
  QueueACLsManager mockQueueACLsManager = mock(QueueACLsManager.class);
  when(
      mockQueueACLsManager.checkAccess(any(UserGroupInformation.class),
          any(QueueACL.class), anyString())).thenReturn(true);
  return new ClientRMService(rmContext, yarnScheduler, appManager,
      mockAclsManager, mockQueueACLsManager, null);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:24,代码来源:TestClientRMService.java


示例16: testGetQueueInfo

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
@Test
public void testGetQueueInfo() throws Exception {
  YarnScheduler yarnScheduler = mock(YarnScheduler.class);
  RMContext rmContext = mock(RMContext.class);
  mockRMContext(yarnScheduler, rmContext);
  ClientRMService rmService = new ClientRMService(rmContext, yarnScheduler,
      null, null, null, null);
  GetQueueInfoRequest request = recordFactory
      .newRecordInstance(GetQueueInfoRequest.class);
  request.setQueueName("testqueue");
  request.setIncludeApplications(true);
  GetQueueInfoResponse queueInfo = rmService.getQueueInfo(request);
  List<ApplicationReport> applications = queueInfo.getQueueInfo()
      .getApplications();
  Assert.assertEquals(2, applications.size());
  request.setQueueName("nonexistentqueue");
  request.setIncludeApplications(true);
  // should not throw exception on nonexistent queue
  queueInfo = rmService.getQueueInfo(request);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:21,代码来源:TestClientRMService.java


示例17: mockYarnScheduler

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
private static YarnScheduler mockYarnScheduler() {
  YarnScheduler yarnScheduler = mock(YarnScheduler.class);
  when(yarnScheduler.getMinimumResourceCapability()).thenReturn(
      Resources.createResource(
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB));
  when(yarnScheduler.getMaximumResourceCapability()).thenReturn(
      Resources.createResource(
          YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB));
  when(yarnScheduler.getAppsInQueue(QUEUE_1)).thenReturn(
      Arrays.asList(getApplicationAttemptId(101), getApplicationAttemptId(102)));
  when(yarnScheduler.getAppsInQueue(QUEUE_2)).thenReturn(
      Arrays.asList(getApplicationAttemptId(103)));
  ApplicationAttemptId attemptId = getApplicationAttemptId(1);
  when(yarnScheduler.getAppResourceUsageReport(attemptId)).thenReturn(null);
  return yarnScheduler;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:17,代码来源:TestClientRMService.java


示例18: RMAppAttemptImpl

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
public RMAppAttemptImpl(ApplicationAttemptId appAttemptId,
    RMContext rmContext, YarnScheduler scheduler,
    ApplicationMasterService masterService,
    ApplicationSubmissionContext submissionContext,
    Configuration conf, String user) {
  this.conf = conf;
  this.applicationAttemptId = appAttemptId;
  this.rmContext = rmContext;
  this.eventHandler = rmContext.getDispatcher().getEventHandler();
  this.submissionContext = submissionContext;
  this.scheduler = scheduler;
  this.masterService = masterService;

  ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
  this.readLock = lock.readLock();
  this.writeLock = lock.writeLock();

  this.proxiedTrackingUrl = generateProxyUriWithoutScheme();
  
  this.stateMachine = stateMachineFactory.make(this);
  this.user = user;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:23,代码来源:RMAppAttemptImpl.java


示例19: testGetQueueInfo

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
@Test
public void testGetQueueInfo() throws Exception {
  YarnScheduler yarnScheduler = mock(YarnScheduler.class);
  RMContext rmContext = mock(RMContext.class);
  mockRMContext(yarnScheduler, rmContext);
  ClientRMService rmService = new ClientRMService(rmContext, yarnScheduler,
      null, null, null);
  GetQueueInfoRequest request = recordFactory
      .newRecordInstance(GetQueueInfoRequest.class);
  request.setQueueName("testqueue");
  request.setIncludeApplications(true);
  GetQueueInfoResponse queueInfo = rmService.getQueueInfo(request);
  List<ApplicationReport> applications = queueInfo.getQueueInfo()
      .getApplications();
  Assert.assertEquals(2, applications.size());
  request.setQueueName("nonexistentqueue");
  request.setIncludeApplications(true);
  // should not throw exception on nonexistent queue
  queueInfo = rmService.getQueueInfo(request);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:21,代码来源:TestClientRMService.java


示例20: getRMApps

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler; //导入依赖的package包/类
private ConcurrentHashMap<ApplicationId, RMApp> getRMApps(
    RMContext rmContext, YarnScheduler yarnScheduler) {
  ConcurrentHashMap<ApplicationId, RMApp> apps = 
    new ConcurrentHashMap<ApplicationId, RMApp>();
  ApplicationId applicationId1 = getApplicationId(1);
  ApplicationId applicationId2 = getApplicationId(2);
  ApplicationId applicationId3 = getApplicationId(3);
  YarnConfiguration config = new YarnConfiguration();
  apps.put(applicationId1, getRMApp(rmContext, yarnScheduler, applicationId1,
      config, "testqueue"));
  apps.put(applicationId2, getRMApp(rmContext, yarnScheduler, applicationId2,
      config, "a"));
  apps.put(applicationId3, getRMApp(rmContext, yarnScheduler, applicationId3,
      config, "testqueue"));
  return apps;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:17,代码来源:TestClientRMService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConnectorContext类代码示例发布时间:2022-05-22
下一篇:
Java RequestContext类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap