You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2019/12/11 06:23:51 UTC

[GitHub] [hadoop-ozone] bharatviswa504 commented on a change in pull request #333: HDDS-2279. Ozone S3 CLI commands not working on HA cluster

bharatviswa504 commented on a change in pull request #333: HDDS-2279. Ozone S3 CLI commands not working on HA cluster
URL: https://github.com/apache/hadoop-ozone/pull/333#discussion_r356420818
 
 

 ##########
 File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/web/ozShell/OzoneAddress.java
 ##########
 @@ -124,6 +126,41 @@ public OzoneClient createClient(OzoneConfiguration conf)
     return client;
   }
 
+  /**
+   * Create OzoneClient for S3Commands.
+   * @param conf
+   * @param omServiceID
+   * @return OzoneClient
+   * @throws IOException
+   * @throws OzoneClientException
+   */
+  public OzoneClient  createClientForS3Commands(OzoneConfiguration conf,
+      String omServiceID)
+      throws IOException, OzoneClientException {
+    if (omServiceID != null) {
+      // OM HA cluster
+      if (OmUtils.isOmHAServiceId(conf, omServiceID)) {
+        return OzoneClientFactory.getRpcClient(omServiceID, conf);
+      } else {
+        throw new OzoneClientException("Service ID specified does not match" +
+            " with " + OZONE_OM_SERVICE_IDS_KEY + " defined in the " +
+            "configuration. Configured " + OZONE_OM_SERVICE_IDS_KEY + " are" +
+            conf.getTrimmedStringCollection(OZONE_OM_SERVICE_IDS_KEY));
+      }
+    } else {
+      // If om service id is not specified, consider it as a non-HA cluster.
 
 Review comment:
   I too thought that, but later I got a doubt that if conf has service ID, but it is of the remote cluster. (I think this can happen when conf has remote HA cluster details and the local non-HA cluster) . So, thrown exception and have marked this mandatory for HA cluster. Let me know your view on this.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org