bharatviswa504 commented on a change in pull request #752: HDDS-3319. Handle HA for BasicOzoneClientAdapterImpl#renew/cancel(). URL: https://github.com/apache/hadoop-ozone/pull/752#discussion_r402057401
########## File path: hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneClientFactory.java ########## @@ -159,6 +163,47 @@ private static OzoneClient getRpcClient(ClientProtocol clientProtocol, return new OzoneClient(config, proxy); } + /** + * Create OzoneClient for token renew/cancel operations. + * @param conf Configuration to be used for OzoneCient creation + * @param token ozone token is involved + * @return + * @throws IOException + */ + public static OzoneClient getOzoneClient(Configuration conf, + Token<OzoneTokenIdentifier> token) throws IOException { + Preconditions.checkNotNull(token, "Null token is not allowed"); + String omServiceId = token.decodeIdentifier().getOmServiceId(); + if (StringUtils.isNotEmpty(omServiceId)) { + // new OM should always issue token with omServiceId + if (omServiceId.equals(OzoneConsts.OM_SERVICE_ID_DEFAULT)) { Review comment: Do we need to update it to something like this if (omServiceId.equals(OzoneConsts.OM_SERVICE_ID_DEFAULT) && !OmUtils.isOmHAServiceId(conf, omServiceId)) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org