You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ad...@apache.org on 2023/04/26 12:39:29 UTC
[ozone] branch master updated: HDDS-8482. Let Ozone shell support multiple OM services (#4613)
This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 73809175c6 HDDS-8482. Let Ozone shell support multiple OM services (#4613)
73809175c6 is described below
commit 73809175c677022e63f841775a466f68bdaa48dc
Author: Hongbing Wang <28...@qq.com>
AuthorDate: Wed Apr 26 20:39:22 2023 +0800
HDDS-8482. Let Ozone shell support multiple OM services (#4613)
---
.../java/org/apache/hadoop/ozone/shell/OzoneAddress.java | 2 +-
.../hadoop/ozone/shell/TestOzoneAddressClientCreation.java | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/OzoneAddress.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/OzoneAddress.java
index 6adf1cf701..5932489231 100644
--- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/OzoneAddress.java
+++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/OzoneAddress.java
@@ -146,7 +146,7 @@ public class OzoneAddress {
+ ozoneURI.getHost() + "' is a logical (HA) OzoneManager "
+ "and does not use port information.");
}
- client = createRpcClient(conf);
+ client = createRpcClientFromServiceId(ozoneURI.getHost(), conf);
} else if (ozoneURI.getPort() == -1) {
client = createRpcClientFromHostPort(ozoneURI.getHost(),
OmUtils.getOmRpcPort(conf), conf);
diff --git a/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddressClientCreation.java b/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddressClientCreation.java
index fd66a2adbf..31d64993d1 100644
--- a/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddressClientCreation.java
+++ b/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddressClientCreation.java
@@ -64,6 +64,18 @@ public class TestOzoneAddressClientCreation {
"service1,service2"));
}
+ @Test
+ public void explicitHaMultipleServiceId()
+ throws OzoneClientException, IOException {
+ TestableOzoneAddress address =
+ new TestableOzoneAddress("o3://service1/vol1/bucket1/key1");
+ address.createClient(
+ new InMemoryConfiguration(OZONE_OM_SERVICE_IDS_KEY,
+ "service1,service2"));
+ Assert.assertFalse(address.simpleCreation);
+ Assert.assertEquals("service1", address.serviceId);
+ }
+
@Test
public void explicitNonHAHostPort() throws OzoneClientException, IOException {
TestableOzoneAddress address =
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org