當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。