swamirishi commented on code in PR #6812: URL: https://github.com/apache/ozone/pull/6812#discussion_r1639870448
########## hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java: ########## @@ -97,6 +98,28 @@ public final class ContainerProtocolCalls { private ContainerProtocolCalls() { } + /** + * Creates a ContainerCommandRequestProto with version set. + */ + public static ContainerCommandRequestProto.Builder getContainerCommandRequestProtoBuilder(int version) { + return getContainerCommandRequestProtoBuilder(null, version); + } + + public static ContainerCommandRequestProto.Builder getContainerCommandRequestProtoBuilder() { + return getContainerCommandRequestProtoBuilder(null, ClientVersion.CURRENT.toProtoValue()); + } + + public static ContainerCommandRequestProto.Builder getContainerCommandRequestProtoBuilder( + ContainerCommandRequestProto req, int version) { + return (req == null ? + ContainerCommandRequestProto.newBuilder() : ContainerCommandRequestProto.newBuilder(req)).setVersion(version); + } Review Comment: or we can just add a validation check and throw an exception if the version is not set. -- 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: issues-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org