gpt4 book ai didi

org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore.close()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 23:49:31 24 4
gpt4 key购买 nike

本文整理了Java中org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore.close()方法的一些代码示例,展示了YarnConfigurationStore.close()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnConfigurationStore.close()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore
类名称:YarnConfigurationStore
方法名:close

YarnConfigurationStore.close介绍

[英]Closes the configuration store, releasing any required resources.
[中]关闭配置存储,释放所有必需的资源。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Override
public void close() throws IOException {
 confStore.close();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testPersistConfiguration() throws Exception {
 schedConf.set("key", "val");
 confStore.initialize(conf, schedConf, rmContext);
 assertEquals("val", confStore.retrieve().get("key"));
 confStore.close();
 // Create a new configuration store, and check for old configuration
 confStore = createConfStore();
 schedConf.set("key", "badVal");
 // Should ignore passed-in scheduler configuration.
 confStore.initialize(conf, schedConf, rmContext);
 assertEquals("val", confStore.retrieve().get("key"));
 confStore.close();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
 public void testNullConfigurationUpdate() throws Exception {
  schedConf.set("key", "val");
  confStore.initialize(conf, schedConf, rmContext);
  assertEquals("val", confStore.retrieve().get("key"));

  Map<String, String> update = new HashMap<>();
  update.put("key", null);
  YarnConfigurationStore.LogMutation mutation =
    new YarnConfigurationStore.LogMutation(update, TEST_USER);
  confStore.logMutation(mutation);
  confStore.confirmMutation(true);
  assertNull(confStore.retrieve().get("key"));
  confStore.close();
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testPersistUpdatedConfiguration() throws Exception {
 confStore.initialize(conf, schedConf, rmContext);
 assertNull(confStore.retrieve().get("key"));
 Map<String, String> update = new HashMap<>();
 update.put("key", "val");
 YarnConfigurationStore.LogMutation mutation =
   new YarnConfigurationStore.LogMutation(update, TEST_USER);
 confStore.logMutation(mutation);
 confStore.confirmMutation(true);
 assertEquals("val", confStore.retrieve().get("key"));
 confStore.close();
 // Create a new configuration store, and check for updated configuration
 confStore = createConfStore();
 schedConf.set("key", "badVal");
 // Should ignore passed-in scheduler configuration.
 confStore.initialize(conf, schedConf, rmContext);
 assertEquals("val", confStore.retrieve().get("key"));
 confStore.close();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testConfigurationUpdate() throws Exception {
 schedConf.set("key1", "val1");
 confStore.initialize(conf, schedConf, rmContext);
 assertEquals("val1", confStore.retrieve().get("key1"));
 Map<String, String> update1 = new HashMap<>();
 update1.put("keyUpdate1", "valUpdate1");
 YarnConfigurationStore.LogMutation mutation1 =
   new YarnConfigurationStore.LogMutation(update1, TEST_USER);
 confStore.logMutation(mutation1);
 confStore.confirmMutation(true);
 assertEquals("valUpdate1", confStore.retrieve().get("keyUpdate1"));
 Map<String, String> update2 = new HashMap<>();
 update2.put("keyUpdate2", "valUpdate2");
 YarnConfigurationStore.LogMutation mutation2 =
   new YarnConfigurationStore.LogMutation(update2, TEST_USER);
 confStore.logMutation(mutation2);
 confStore.confirmMutation(false);
 assertNull("Configuration should not be updated",
   confStore.retrieve().get("keyUpdate2"));
 confStore.close();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

assertEquals("val2", logs.get(0).getUpdates().get("key2"));
assertEquals("val3", logs.get(1).getUpdates().get("key3"));
confStore.close();

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testVersioning() throws Exception {
 confStore.initialize(conf, schedConf, rmContext);
 assertNull(confStore.getConfStoreVersion());
 confStore.checkVersion();
 assertEquals(LeveldbConfigurationStore.CURRENT_VERSION_INFO,
   confStore.getConfStoreVersion());
 confStore.close();
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com