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 2020/01/13 02:12:33 UTC

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

arp7 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_r365631208
 
 

 ##########
 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 think this approach makes sense.

----------------------------------------------------------------
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