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


Java YarnConfiguration.setBoolean方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.conf.YarnConfiguration.setBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java YarnConfiguration.setBoolean方法的具体用法?Java YarnConfiguration.setBoolean怎么用?Java YarnConfiguration.setBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.conf.YarnConfiguration的用法示例。


在下文中一共展示了YarnConfiguration.setBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@Before
public void setup() {
  privilegedOperationExecutorMock = mock(PrivilegedOperationExecutor.class);
  cGroupsHandlerMock = mock(CGroupsHandler.class);
  trafficControllerMock = mock(TrafficController.class);
  conf = new YarnConfiguration();
  tmpPath = new StringBuffer(System.getProperty("test.build.data")).append
      ('/').append("hadoop.tmp.dir").toString();
  device = YarnConfiguration.DEFAULT_NM_NETWORK_RESOURCE_INTERFACE;
  containerIdMock = mock(ContainerId.class);
  containerMock = mock(Container.class);
  when(containerIdMock.toString()).thenReturn(TEST_CONTAINER_ID_STR);
  //mock returning a mock - an angel died somewhere.
  when(containerMock.getContainerId()).thenReturn(containerIdMock);

  conf.setInt(YarnConfiguration
      .NM_NETWORK_RESOURCE_OUTBOUND_BANDWIDTH_MBIT, ROOT_BANDWIDTH_MBIT);
  conf.setInt(YarnConfiguration
      .NM_NETWORK_RESOURCE_OUTBOUND_BANDWIDTH_YARN_MBIT, YARN_BANDWIDTH_MBIT);
  conf.set("hadoop.tmp.dir", tmpPath);
  //In these tests, we'll only use TrafficController with recovery disabled
  conf.setBoolean(YarnConfiguration.NM_RECOVERY_ENABLED, false);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:TestTrafficControlBandwidthHandlerImpl.java

示例2: setup

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@Before
public void setup() throws IOException {
  fakeAppId = ApplicationId.newInstance(System.currentTimeMillis(), 0);
  conf = new YarnConfiguration();
  conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
  conf.set(YarnConfiguration.RM_HA_IDS, RM1_NODE_ID + "," + RM2_NODE_ID);
  setRpcAddressForRM(RM1_NODE_ID, RM1_PORT_BASE);
  setRpcAddressForRM(RM2_NODE_ID, RM2_PORT_BASE);

  conf.setLong(YarnConfiguration.CLIENT_FAILOVER_SLEEPTIME_BASE_MS, 100L);

  conf.setBoolean(YarnConfiguration.YARN_MINICLUSTER_FIXED_PORTS, true);
  conf.setBoolean(YarnConfiguration.YARN_MINICLUSTER_USE_RPC, true);

  cluster = new MiniYARNCluster(TestRMFailover.class.getName(), 2, 1, 1, 1);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestRMFailover.java

示例3: setupServer

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@BeforeClass
public static void setupServer() throws Exception {
  conf = new YarnConfiguration();
  conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
  conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STORE,
      MemoryTimelineStore.class, TimelineStore.class);
  conf.set(YarnConfiguration.YARN_HTTP_POLICY_KEY, "HTTPS_ONLY");

  File base = new File(BASEDIR);
  FileUtil.fullyDelete(base);
  base.mkdirs();
  keystoresDir = new File(BASEDIR).getAbsolutePath();
  sslConfDir =
      KeyStoreTestUtil.getClasspathDir(TestTimelineWebServicesWithSSL.class);

  KeyStoreTestUtil.setupSSLConfig(keystoresDir, sslConfDir, conf, false);
  conf.addResource("ssl-server.xml");
  conf.addResource("ssl-client.xml");

  timelineServer = new ApplicationHistoryServer();
  timelineServer.init(conf);
  timelineServer.start();
  store = timelineServer.getTimelineStore();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:TestTimelineWebServicesWithSSL.java

示例4: testBlockNewContainerRequestsOnStartAndResync

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test(timeout=60000)
public void testBlockNewContainerRequestsOnStartAndResync()
    throws IOException, InterruptedException, YarnException {
  NodeManager nm = new TestNodeManager2();
  YarnConfiguration conf = createNMConfig();
  conf.setBoolean(YarnConfiguration.RM_WORK_PRESERVING_RECOVERY_ENABLED, false);
  nm.init(conf);
  nm.start();

  // Start the container in running state
  ContainerId cId = TestNodeManagerShutdown.createContainerId();
  TestNodeManagerShutdown.startContainer(nm, cId, localFS, tmpDir,
    processStartFile);

  nm.getNMDispatcher().getEventHandler()
    .handle(new NodeManagerEvent(NodeManagerEventType.RESYNC));
  try {
    syncBarrier.await();
  } catch (BrokenBarrierException e) {
  }
  Assert.assertFalse(assertionFailedInThread.get());
  nm.stop();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:TestNodeManagerResync.java

示例5: setup

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@BeforeClass
public static void setup() throws Exception {
  YarnConfiguration conf = new YarnConfiguration();
  conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
  conf.setBoolean(YarnConfiguration.RM_SYSTEM_METRICS_PUBLISHER_ENABLED, true);
  conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STORE,
      MemoryTimelineStore.class, TimelineStore.class);
  conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STATE_STORE_CLASS,
      MemoryTimelineStateStore.class, TimelineStateStore.class);
  conf.setInt(
      YarnConfiguration.RM_SYSTEM_METRICS_PUBLISHER_DISPATCHER_POOL_SIZE,
      2);

  timelineServer = new ApplicationHistoryServer();
  timelineServer.init(conf);
  timelineServer.start();
  store = timelineServer.getTimelineStore();

  metricsPublisher = new SystemMetricsPublisher();
  metricsPublisher.init(conf);
  metricsPublisher.start();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:TestSystemMetricsPublisher.java

示例6: setup

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@Before
public void setup() throws IOException {
  failoverThread = null;
  keepRunning = true;
  conf = new YarnConfiguration();
  conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
  conf.setInt(YarnConfiguration.CLIENT_FAILOVER_MAX_ATTEMPTS, 5);
  conf.set(YarnConfiguration.RM_HA_IDS, RM1_NODE_ID + "," + RM2_NODE_ID);
  setRpcAddressForRM(RM1_NODE_ID, RM1_PORT_BASE);
  setRpcAddressForRM(RM2_NODE_ID, RM2_PORT_BASE);

  conf.setLong(YarnConfiguration.CLIENT_FAILOVER_SLEEPTIME_BASE_MS, 100L);

  conf.setBoolean(YarnConfiguration.YARN_MINICLUSTER_FIXED_PORTS, true);
  conf.setBoolean(YarnConfiguration.YARN_MINICLUSTER_USE_RPC, true);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:ProtocolHATestBase.java

示例7: setup

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@Before
public void setup() throws IOException {
  conf = new YarnConfiguration();
  conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
  conf.setBoolean(YarnConfiguration.AUTO_FAILOVER_ENABLED, true);
  conf.setBoolean(YarnConfiguration.AUTO_FAILOVER_EMBEDDED, true);
  conf.set(YarnConfiguration.RM_CLUSTER_ID, "yarn-test-cluster");
  conf.set(YarnConfiguration.RM_ZK_ADDRESS, hostPort);
  conf.setInt(YarnConfiguration.RM_ZK_TIMEOUT_MS, 2000);

  conf.set(YarnConfiguration.RM_HA_IDS, RM1_NODE_ID + "," + RM2_NODE_ID);
  conf.set(YarnConfiguration.RM_HA_ID, RM1_NODE_ID);
  setRpcAddressForRM(RM1_NODE_ID, RM1_PORT_BASE);
  setRpcAddressForRM(RM2_NODE_ID, RM2_PORT_BASE);

  conf.setLong(YarnConfiguration.CLIENT_FAILOVER_SLEEPTIME_BASE_MS, 100L);

  callbackCalled = new AtomicBoolean(false);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestRMEmbeddedElector.java

示例8: testZKRetryInterval

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@Test
public void testZKRetryInterval() throws Exception {
  TestZKClient zkClientTester = new TestZKClient();
  YarnConfiguration conf = new YarnConfiguration();

  ZKRMStateStore store =
      (ZKRMStateStore) zkClientTester.getRMStateStore(conf);
  assertEquals(YarnConfiguration.DEFAULT_RM_ZK_RETRY_INTERVAL_MS,
      store.zkRetryInterval);
  store.stop();

  conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
  store =
      (ZKRMStateStore) zkClientTester.getRMStateStore(conf);
  assertEquals(YarnConfiguration.DEFAULT_RM_ZK_TIMEOUT_MS /
          YarnConfiguration.DEFAULT_ZK_RM_NUM_RETRIES,
      store.zkRetryInterval);
  store.stop();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestZKRMStateStoreZKClientConnections.java

示例9: setup

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@Before
public void setup() {
  privilegedOperationExecutorMock = mock(PrivilegedOperationExecutor.class);
  conf = new YarnConfiguration();
  tmpPath = System.getProperty("test.build.data") + "/cgroups";
  //no leading or trailing slashes here
  hierarchy = "test-hadoop-yarn";

  conf.set(YarnConfiguration.NM_LINUX_CONTAINER_CGROUPS_HIERARCHY, hierarchy);
  conf.setBoolean(YarnConfiguration.NM_LINUX_CONTAINER_CGROUPS_MOUNT, true);
  conf.set(YarnConfiguration.NM_LINUX_CONTAINER_CGROUPS_MOUNT_PATH, tmpPath);
  controller = CGroupsHandler.CGroupController.NET_CLS;
  controllerPath = new StringBuffer(tmpPath).append('/')
      .append(controller.getName()).append('/').append(hierarchy).toString();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:TestCGroupsHandlerImpl.java

示例10: TestApplicationHistoryManagerOnTimelineStore

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
public TestApplicationHistoryManagerOnTimelineStore(String caller) {
  conf = new YarnConfiguration();
  if (!caller.equals("")) {
    callerUGI = UserGroupInformation.createRemoteUser(caller, AuthMethod.SIMPLE);
    conf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true);
    conf.set(YarnConfiguration.YARN_ADMIN_ACL, "admin");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestApplicationHistoryManagerOnTimelineStore.java

示例11: getConfForCM

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
private YarnConfiguration getConfForCM(boolean pMemEnabled,
    boolean vMemEnabled, int nmPmem, float vMemToPMemRatio) {
  YarnConfiguration conf = new YarnConfiguration();
  conf.setInt(YarnConfiguration.NM_PMEM_MB, nmPmem);
  conf.setBoolean(YarnConfiguration.NM_PMEM_CHECK_ENABLED, pMemEnabled);
  conf.setBoolean(YarnConfiguration.NM_VMEM_CHECK_ENABLED, vMemEnabled);
  conf.setFloat(YarnConfiguration.NM_VMEM_PMEM_RATIO, vMemToPMemRatio);
  return conf;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:TestContainersMonitor.java

示例12: setup

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@Before
public void setup() {
  conf = new YarnConfiguration();
  conf.set(YarnConfiguration.RM_SCHEDULER,
      "org.apache.hadoop.yarn.sls.scheduler.ResourceSchedulerWrapper");
  conf.set(SLSConfiguration.RM_SCHEDULER,
      "org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler");
  conf.setBoolean(SLSConfiguration.METRICS_SWITCH, false);
  rm = new ResourceManager();
  rm.init(conf);
  rm.start();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:TestAMSimulator.java

示例13: setup

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@Before
public void setup() throws IOException {
  FileUtil.fullyDelete(TMP_DIR);
  conf = new YarnConfiguration();
  conf.setBoolean(YarnConfiguration.NM_RECOVERY_ENABLED, true);
  conf.set(YarnConfiguration.NM_RECOVERY_DIR, TMP_DIR.toString());
  restartStateStore();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestNMLeveldbStateStoreService.java

示例14: setUp

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
  conf = new YarnConfiguration();
  conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoSchedulerWithMove.class,
      FifoSchedulerWithMove.class);
  conf.set(YarnConfiguration.YARN_ADMIN_ACL, " ");
  conf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true);
  resourceManager = new ResourceManager();
  resourceManager.init(conf);
  resourceManager.getRMContext().getContainerTokenSecretManager().rollMasterKey();
  resourceManager.getRMContext().getNMTokenSecretManager().rollMasterKey();
  resourceManager.start();
  failMove = false;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestMoveApplication.java

示例15: setup

import org.apache.hadoop.yarn.conf.YarnConfiguration; //导入方法依赖的package包/类
@Before
public void setup() {
  YarnConfiguration conf = new YarnConfiguration();
  conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
  client = createTimelineClient(conf);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:TestTimelineClient.java


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