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


Java StringHelper类代码示例

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


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

示例1: scheduler

import org.apache.hadoop.yarn.util.StringHelper; //导入依赖的package包/类
public void scheduler() {
  // limit applications to those in states relevant to scheduling
  set(YarnWebParams.APP_STATE, StringHelper.cjoin(
      YarnApplicationState.NEW.toString(),
      YarnApplicationState.NEW_SAVING.toString(),
      YarnApplicationState.SUBMITTED.toString(),
      YarnApplicationState.ACCEPTED.toString(),
      YarnApplicationState.RUNNING.toString()));

  ResourceManager rm = getInstance(ResourceManager.class);
  ResourceScheduler rs = rm.getResourceScheduler();
  if (rs == null || rs instanceof CapacityScheduler) {
    setTitle("Capacity Scheduler");
    render(CapacitySchedulerPage.class);
    return;
  }
  
  if (rs instanceof FairScheduler) {
    setTitle("Fair Scheduler");
    render(FairSchedulerPage.class);
    return;
  }
  
  setTitle("Default Scheduler");
  render(DefaultSchedulerPage.class);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:27,代码来源:RmController.java

示例2: testView

import org.apache.hadoop.yarn.util.StringHelper; //导入依赖的package包/类
@Test
public void testView() throws Exception {
  Injector injector =
      WebAppTests.createMockInjector(ApplicationBaseProtocol.class,
        mockApplicationHistoryClientService(5, 1, 1));
  AHSView ahsViewInstance = injector.getInstance(AHSView.class);

  ahsViewInstance.render();
  WebAppTests.flushOutput(injector);

  ahsViewInstance.set(YarnWebParams.APP_STATE,
    YarnApplicationState.FAILED.toString());
  ahsViewInstance.render();
  WebAppTests.flushOutput(injector);

  ahsViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin(
    YarnApplicationState.FAILED.toString(), YarnApplicationState.KILLED));
  ahsViewInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TestAHSWebApp.java

示例3: singleJobCounter

import org.apache.hadoop.yarn.util.StringHelper; //导入依赖的package包/类
/**
 * Render the /singlejobcounter page
 * @throws IOException on any error.
 */
public void singleJobCounter() throws IOException{
  try {
    requireJob();
  }
  catch (Exception e) {
    renderText(e.getMessage());
    return;
  }
  set(COUNTER_GROUP, URLDecoder.decode($(COUNTER_GROUP), "UTF-8"));
  set(COUNTER_NAME, URLDecoder.decode($(COUNTER_NAME), "UTF-8"));
  if (app.getJob() != null) {
    setTitle(StringHelper.join($(COUNTER_GROUP)," ",$(COUNTER_NAME),
        " for ", $(JOB_ID)));
  }
  render(singleCounterPage());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:AppController.java

示例4: singleTaskCounter

import org.apache.hadoop.yarn.util.StringHelper; //导入依赖的package包/类
/**
 * Render the /singletaskcounter page
 * @throws IOException on any error.
 */
public void singleTaskCounter() throws IOException{
  try {
    requireTask();
  }
  catch (Exception e) {
    renderText(e.getMessage());
    return;
  }
  set(COUNTER_GROUP, URLDecoder.decode($(COUNTER_GROUP), "UTF-8"));
  set(COUNTER_NAME, URLDecoder.decode($(COUNTER_NAME), "UTF-8"));
  if (app.getTask() != null) {
    setTitle(StringHelper.join($(COUNTER_GROUP)," ",$(COUNTER_NAME),
        " for ", $(TASK_ID)));
  }
  render(singleCounterPage());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:AppController.java

示例5: testView

import org.apache.hadoop.yarn.util.StringHelper; //导入依赖的package包/类
@Test public void testView() {
  Injector injector = WebAppTests.createMockInjector(RMContext.class,
      mockRMContext(15, 1, 2, 8*GiB),
      new Module() {
    @Override
    public void configure(Binder binder) {
      try {
        binder.bind(ResourceManager.class).toInstance(mockRm(3, 1, 2, 8*GiB));
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
    }
  });
  RmView rmViewInstance = injector.getInstance(RmView.class);
  rmViewInstance.set(YarnWebParams.APP_STATE,
      YarnApplicationState.RUNNING.toString());
  rmViewInstance.render();
  WebAppTests.flushOutput(injector);

  rmViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin(
      YarnApplicationState.ACCEPTED.toString(),
      YarnApplicationState.RUNNING.toString()));
  rmViewInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:26,代码来源:TestRMWebApp.java

示例6: testView

import org.apache.hadoop.yarn.util.StringHelper; //导入依赖的package包/类
@Test
public void testView() throws Exception {
  Injector injector =
      WebAppTests.createMockInjector(ApplicationContext.class,
        mockApplicationHistoryManager(5, 1, 1));
  AHSView ahsViewInstance = injector.getInstance(AHSView.class);

  ahsViewInstance.render();
  WebAppTests.flushOutput(injector);

  ahsViewInstance.set(YarnWebParams.APP_STATE,
    YarnApplicationState.FAILED.toString());
  ahsViewInstance.render();
  WebAppTests.flushOutput(injector);

  ahsViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin(
    YarnApplicationState.FAILED.toString(), YarnApplicationState.KILLED));
  ahsViewInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:21,代码来源:TestAHSWebApp.java

示例7: testView

import org.apache.hadoop.yarn.util.StringHelper; //导入依赖的package包/类
@Test public void testView() {
  Injector injector = WebAppTests.createMockInjector(RMContext.class,
      mockRMContext(15, 1, 2, 8*GiB),
      new Module() {
    @Override
    public void configure(Binder binder) {
      try {
        binder.bind(ResourceManager.class).toInstance(mockRm(3, 1, 2, 8*GiB));
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
    }
  });
  RmView rmViewInstance = injector.getInstance(RmView.class);
  rmViewInstance.set(YarnWebParams.APP_STATE, RMAppState.RUNNING.toString());
  rmViewInstance.render();
  WebAppTests.flushOutput(injector);

  rmViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin(
      RMAppState.ACCEPTED.toString(), RMAppState.RUNNING.toString()));
  rmViewInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:24,代码来源:TestRMWebApp.java

示例8: WebAppProxyServlet

import org.apache.hadoop.yarn.util.StringHelper; //导入依赖的package包/类
/**
 * Default constructor
 */
public WebAppProxyServlet() {
  super();
  conf = new YarnConfiguration();
  this.trackingUriPlugins =
      conf.getInstances(YarnConfiguration.YARN_TRACKING_URL_GENERATOR,
          TrackingUriPlugin.class);
  this.rmAppPageUrlBase = StringHelper.pjoin(
      WebAppUtils.getResolvedRMWebAppURLWithScheme(conf), "cluster", "app");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:WebAppProxyServlet.java

示例9: testView

import org.apache.hadoop.yarn.util.StringHelper; //导入依赖的package包/类
@Test public void testView() {
  Injector injector = WebAppTests.createMockInjector(RMContext.class,
      mockRMContext(15, 1, 2, 8*GiB),
      new Module() {
    @Override
    public void configure(Binder binder) {
      try {
        ResourceManager mockRm = mockRm(3, 1, 2, 8*GiB);
        binder.bind(ResourceManager.class).toInstance(mockRm);
        binder.bind(ApplicationBaseProtocol.class)
            .toInstance(mockRm.getClientRMService());
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
    }
  });
  RmView rmViewInstance = injector.getInstance(RmView.class);
  rmViewInstance.set(YarnWebParams.APP_STATE,
      YarnApplicationState.RUNNING.toString());
  rmViewInstance.render();
  WebAppTests.flushOutput(injector);

  rmViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin(
      YarnApplicationState.ACCEPTED.toString(),
      YarnApplicationState.RUNNING.toString()));
  rmViewInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:TestRMWebApp.java

示例10: putDomainIntoCache

import org.apache.hadoop.yarn.util.StringHelper; //导入依赖的package包/类
private AccessControlListExt putDomainIntoCache(
    TimelineDomain domain) {
  Map<ApplicationAccessType, AccessControlList> acls
  = new HashMap<ApplicationAccessType, AccessControlList>(2);
  acls.put(ApplicationAccessType.VIEW_APP,
      new AccessControlList(StringHelper.cjoin(domain.getReaders())));
  acls.put(ApplicationAccessType.MODIFY_APP,
      new AccessControlList(StringHelper.cjoin(domain.getWriters())));
  AccessControlListExt aclExt =
      new AccessControlListExt(domain.getOwner(), acls);
  aclExts.put(domain.getId(), aclExt);
  return aclExt;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:TimelineACLsManager.java


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