[
https://issues.apache.org/jira/browse/YARN-1239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13821050#comment-13821050
]
Tsuyoshi OZAWA commented on YARN-1239:
--------------------------------------
IMO, version number should be defined in RMStateStore class like
TaskUmbilicalProtocol. Are there any use cases to need to declare or override
the version in configuration?
We should check version of RM when ZKRMStateStore is initialised. I've created
this function for YARN-1307 as follows:
{code}
private void ensureVersion() throws Exception {
byte[] versionData = getDataWithRetries(versionInfoPath, false).getData();
if (versionData != null) {
ByteArrayInputStream versionIs = new ByteArrayInputStream(versionData);
DataInputStream versionIn = new DataInputStream(versionIs);
try {
int currentVersion = versionIn.readInt();
if (currentVersion != VERSION_INFO) {
throw new YarnRuntimeException("Incompatible version!");
}
} finally {
versionIn.close();
}
} else {
ByteArrayOutputStream versionOs = new ByteArrayOutputStream();
DataOutputStream versionOut = new DataOutputStream(versionOs);
try {
versionOut.writeInt(VERSION_INFO);
} finally {
versionOut.close();
}
}
}
{code}
> Save version information in the state store
> -------------------------------------------
>
> Key: YARN-1239
> URL: https://issues.apache.org/jira/browse/YARN-1239
> Project: Hadoop YARN
> Issue Type: Sub-task
> Components: resourcemanager
> Reporter: Bikas Saha
> Assignee: Jian He
> Attachments: YARN-1239.patch
>
>
> When creating root dir for the first time we should write version 1. If root
> dir exists then we should check that the version in the state store matches
> the version from config.
--
This message was sent by Atlassian JIRA
(v6.1#6144)