- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore
类的一些代码示例,展示了YarnConfigurationStore
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnConfigurationStore
类的具体详情如下:
包路径:org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore
类名称:YarnConfigurationStore
[英]YarnConfigurationStore exposes the methods needed for retrieving and persisting CapacityScheduler configuration via key-value using write-ahead logging. When configuration mutation is requested, caller should first log it with logMutation, which persists this pending mutation. This mutation is merged to the persisted configuration only after confirmMutation is called. On startup/recovery, caller should call retrieve to get all confirmed mutations, then get pending mutations which were not confirmed via getPendingMutations, and replay/confirm them via confirmMutation as in the normal case.
[中]YarnConfiguration Store公开了通过使用预写日志记录的键值检索和持久化CapacityScheduler配置所需的方法。当请求配置变异时,调用者应该首先用logMutation记录它,logMutation会持续这个待处理的变异。只有在调用confirmMutation后,此变异才会合并到持久化配置。在启动/恢复时,调用方应调用retrieve获取所有已确认的突变,然后获取未通过GetPending突变确认的待定突变,并像正常情况一样通过confirm突变重播/确认它们。
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public void close() throws IOException {
confStore.close();
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public void confirmPendingMutation(boolean isValid) throws Exception {
confStore.confirmMutation(isValid);
if (!isValid) {
schedConf = oldConf;
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
public void checkVersion() throws Exception {
// TODO this was taken from RMStateStore. Should probably refactor
Version loadedVersion = getConfStoreVersion();
LOG.info("Loaded configuration store version info " + loadedVersion);
if (loadedVersion != null && loadedVersion.equals(getCurrentVersion())) {
return;
}
// if there is no version info, treat it as CURRENT_VERSION_INFO;
if (loadedVersion == null) {
loadedVersion = getCurrentVersion();
}
if (loadedVersion.isCompatibleTo(getCurrentVersion())) {
LOG.info("Storing configuration store version info "
+ getCurrentVersion());
storeVersion();
} else {
throw new RMStateVersionIncompatibleException(
"Expecting configuration store version " + getCurrentVersion()
+ ", but loading version " + loadedVersion);
}
}
代码示例来源: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 testVersioning() throws Exception {
confStore.initialize(conf, schedConf, rmContext);
assertNull(confStore.getConfStoreVersion());
confStore.checkVersion();
assertEquals(LeveldbConfigurationStore.CURRENT_VERSION_INFO,
confStore.getConfStoreVersion());
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(ZKConfigurationStore.CURRENT_VERSION_INFO,
confStore.getConfStoreVersion());
}
代码示例来源: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
confStore.initialize(config, schedConf, rmContext);
confStore.checkVersion();
} catch (Exception e) {
throw new IOException(e);
schedConf = confStore.retrieve();
this.aclMutationPolicy = ConfigurationMutationACLPolicyFactory
.getPolicy(config);
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Test
public void testMaxLogs() throws Exception {
conf.setLong(YarnConfiguration.RM_SCHEDCONF_MAX_LOGS, 2);
confStore.initialize(conf, schedConf, rmContext);
LinkedList<YarnConfigurationStore.LogMutation> logs =
((ZKConfigurationStore) confStore).getLogs();
YarnConfigurationStore.LogMutation mutation =
new YarnConfigurationStore.LogMutation(update1, TEST_USER);
confStore.logMutation(mutation);
logs = ((ZKConfigurationStore) confStore).getLogs();
assertEquals(1, logs.size());
assertEquals("val1", logs.get(0).getUpdates().get("key1"));
confStore.confirmMutation(true);
assertEquals(1, logs.size());
assertEquals("val1", logs.get(0).getUpdates().get("key1"));
update2.put("key2", "val2");
mutation = new YarnConfigurationStore.LogMutation(update2, TEST_USER);
confStore.logMutation(mutation);
logs = ((ZKConfigurationStore) confStore).getLogs();
assertEquals(2, logs.size());
assertEquals("val1", logs.get(0).getUpdates().get("key1"));
assertEquals("val2", logs.get(1).getUpdates().get("key2"));
confStore.confirmMutation(true);
assertEquals(2, logs.size());
assertEquals("val1", logs.get(0).getUpdates().get("key1"));
update3.put("key3", "val3");
mutation = new YarnConfigurationStore.LogMutation(update3, TEST_USER);
代码示例来源: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"));
// 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"));
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public void reloadConfigurationFromStore() throws Exception {
schedConf = confStore.retrieve();
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public void logAndApplyMutation(UserGroupInformation user,
SchedConfUpdateInfo confUpdate) throws Exception {
oldConf = new Configuration(schedConf);
Map<String, String> kvUpdate = constructKeyValueConfUpdate(confUpdate);
LogMutation log = new LogMutation(kvUpdate, user.getShortUserName());
confStore.logMutation(log);
for (Map.Entry<String, String> kv : kvUpdate.entrySet()) {
if (kv.getValue() == null) {
schedConf.unset(kv.getKey());
} else {
schedConf.set(kv.getKey(), kv.getValue());
}
}
}
代码示例来源: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
confProvider.confirmPendingMutation(true);
assertEquals("val", ((MutableCSConfigurationProvider) confProvider)
.getConfStore().retrieve().get("key"));
assertEquals("val", ((MutableCSConfigurationProvider) (
(CapacityScheduler) rm2.getResourceScheduler())
.getMutableConfProvider()).getConfStore().retrieve().get("key"));
assertEquals("val", ((MutableConfScheduler) rm2.getResourceScheduler())
.getConfiguration().get("key"));
代码示例来源: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
.getMutableConfProvider()).getConfStore().retrieve()
.get("yarn.scheduler.capacity.root.queues"));
assertEquals("a", ((MutableConfScheduler) rm2.getResourceScheduler())
代码示例来源: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"));
// 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"));
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
confProvider.confirmPendingMutation(true);
assertEquals("val", ((MutableCSConfigurationProvider) confProvider)
.getConfStore().retrieve().get("key"));
.getMutableConfProvider()).getConfStore().retrieve().get("key"));
assertEquals("val", ((MutableConfScheduler) rm2.getResourceScheduler())
.getConfiguration().get("key"));
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Test
public void testMaxLogs() throws Exception {
conf.setLong(YarnConfiguration.RM_SCHEDCONF_MAX_LOGS, 2);
confStore.initialize(conf, schedConf, rmContext);
LinkedList<YarnConfigurationStore.LogMutation> logs =
((LeveldbConfigurationStore) confStore).getLogs();
YarnConfigurationStore.LogMutation mutation =
new YarnConfigurationStore.LogMutation(update1, TEST_USER);
confStore.logMutation(mutation);
logs = ((LeveldbConfigurationStore) confStore).getLogs();
assertEquals(1, logs.size());
assertEquals("val1", logs.get(0).getUpdates().get("key1"));
confStore.confirmMutation(true);
assertEquals(1, logs.size());
assertEquals("val1", logs.get(0).getUpdates().get("key1"));
update2.put("key2", "val2");
mutation = new YarnConfigurationStore.LogMutation(update2, TEST_USER);
confStore.logMutation(mutation);
logs = ((LeveldbConfigurationStore) confStore).getLogs();
assertEquals(2, logs.size());
assertEquals("val1", logs.get(0).getUpdates().get("key1"));
assertEquals("val2", logs.get(1).getUpdates().get("key2"));
confStore.confirmMutation(true);
assertEquals(2, logs.size());
assertEquals("val1", logs.get(0).getUpdates().get("key1"));
update3.put("key3", "val3");
mutation = new YarnConfigurationStore.LogMutation(update3, TEST_USER);
我正在查看 vector 在 https://www.cs.odu.edu/~zeil/cs361/sum18/Public/vectorImpl/index.html 上的实现. 在1.3.1下,显
我在这两篇论文中发现了“high-capacity cnn”这个短语: 1. Rich feature hierarchies for accurate object detection and se
我在根队列下有 4 个队列,配置如下。 |-------------|-----------------|---------------------|-------------------| | Qu
我正在阅读 Scala,我想知道...... 为什么 val capacity : Int 代替 val Int capacity. 做出这个选择的任何原因。如果不是,在我看来,放弃 Java 的声明
我不明白为什么数据是导致我出现问题的唯一私有(private)变量。本来我以为我可以通过在构造函数中第一次声明变量来解决问题,但我觉得必须有一种方法可以私下定义变量,然后在构造函数中设置它们而不会出现
股票初始值为 1 流量为0.1 Stock1 初始值为 0。 当我运行模拟时,我意识到股票的值(value)低于 0(获得负值)。当 Stock 的值达到零时如何停止流动。 最佳答案 一个应该有一个非
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: Size-limited queue that holds last N elements in Java Java
我可以使用容量来查找 ShortBuffer 的实际大小或长度吗?根据我的阅读,它返回缓冲区中包含的元素数。但是“能力”这个词就是这么含糊。如果我在这个缓冲区中放入一个包含 5 个短裤的数组,capa
我是 C++ 的新手,我目前正在处理这个类(class)表项目,以下是我的 add_course 函数。我在 map 中存储学生的 ID、学期和类(class)列表。它有效(我可以向学生添加类(cla
我理解deque和vector都预留了一定的增长空间。 vector::capacity() 能够获取一个 vector 的内部保留空间。 Deque 在标准中没有这样的成员。有什么方法可以获取这些信
当使用只有一个队列(默认)的 Hadoop 容量调度程序时,hadoop 如何调度该作业中的不同作业?是先进先出吗?它有不同的机制吗? 使用公平调度程序时,这种行为有什么不同吗? 最佳答案 来自 cl
List 上有几个属性这似乎与列表中的项目数量有关 - Capacity , Count (作为属性和方法存在)。这非常令人困惑,尤其是与 Array 相比那只有 Length . 我正在使用 Lis
package main import "fmt" import "time" func main() { message := make(chan string ,1) // no buf
我只打开简单的项目并收到错误 "Gradle sync failed: Illegal Capacity: -182931123" 最佳答案 似乎删除/home//.gradle/daemon/4.1
我遇到了一个非常令人困惑的崩溃,我目前正在用尽我的智慧...... 首先是崩溃日志: 日期/时间:2012-02-14 10:55:09.771 +0100 操作系统版本:Mac OS X 10.7.
作为用户,我有 std::string 的 size()/resize()/reserve() 来了解和管理所有这些字符串的内存。 但是,我什么时候必须使用 capacity()?是否有任何用例或必要
当我创建一个向量时,长度和容量是相同的。这些方法有什么区别? fn main() { let vec = vec![1, 2, 3, 4, 5]; println!("Length:
void enqueue( int item) { if (is Full(this)) return; this.rear = (this.rear + 1)%thi
我想知道如何使用DP解决这样的问题。 给定 n 个球和 m 个箱子,每个箱子有最大值。容量 c1, c2,...cm。将这 n 个球分配到这 m 个箱子中的方法总数是多少。 我面临的问题是 如何找到递
HTTP 状态代码 503 是 described in rfc2616当服务器“由于服务器的临时过载或维护而当前无法处理请求”时是相关的。 在某些情况下,应用程序可能会因维护而停机。在某些情况下,应
我是一名优秀的程序员,十分优秀!