You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "slfan1989 (via GitHub)" <gi...@apache.org> on 2023/04/10 22:01:52 UTC
[GitHub] [hadoop] slfan1989 commented on a diff in pull request #5537: YARN-11438. [Federation] ZookeeperFederationStateStore Support Version.
slfan1989 commented on code in PR #5537:
URL: https://github.com/apache/hadoop/pull/5537#discussion_r1162123080
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/impl/ZookeeperFederationStateStore.java:
##########
@@ -643,22 +652,52 @@ public GetSubClusterPoliciesConfigurationsResponse getPoliciesConfigurations(
@Override
public Version getCurrentVersion() {
- throw new NotImplementedException("Code is not implemented");
+ return CURRENT_VERSION_INFO;
}
@Override
public Version loadVersion() throws Exception {
- throw new NotImplementedException("Code is not implemented");
+ if (exists(versionNode)) {
+ byte[] data = get(versionNode);
+ if (data != null) {
+ return new VersionPBImpl(VersionProto.parseFrom(data));
+ }
+ }
+ return null;
}
@Override
public void storeVersion() throws Exception {
- throw new NotImplementedException("Code is not implemented");
+ byte[] data = ((VersionPBImpl) CURRENT_VERSION_INFO).getProto().toByteArray();
+ boolean isUpdate = false;
Review Comment:
Thank you very much for your help to review the code! I will modify the code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org