LZD-PratyushBhatt commented on code in PR #4953: URL: https://github.com/apache/ozone/pull/4953#discussion_r1238080274
########## hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/OzoneAddress.java: ########## @@ -200,12 +200,22 @@ public OzoneClient createClientForS3Commands( } else { // If om service id is not specified, consider it as a non-HA cluster. // But before that check if serviceId is defined. If it is defined - // throw an error om service ID needs to be specified. + // and has length = 1, then take that ID as default. + // otherwise throw an error om service ID needs to be specified. if (OmUtils.isServiceIdsDefined(conf)) { - throw new OzoneClientException("Service ID must not" - + " be omitted when " + OZONE_OM_SERVICE_IDS_KEY + " is defined. " + - "Configured " + OZONE_OM_SERVICE_IDS_KEY + " are " + - conf.getTrimmedStringCollection(OZONE_OM_SERVICE_IDS_KEY)); + Collection<String> serviceIds=conf. + getTrimmedStringCollection(OZONE_OM_SERVICE_IDS_KEY); + if (serviceIds.size() == 1) { Review Comment: Maybe make it >=1, else if there arise a case when someone has configured more than one serviceID, this will go to the else statement. Open for discussion here -- 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