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 2021/05/28 05:03:50 UTC

[GitHub] [ozone] bharatviswa504 opened a new pull request #2289: HDDS-5280. Make XceiverClientManager creation when necessary in ContainerOperationClient

bharatviswa504 opened a new pull request #2289:
URL: https://github.com/apache/ozone/pull/2289


   ## What changes were proposed in this pull request?
   
   Avoid creation of XceiverClientManager in constructor of ContainerOperationClient.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5280
   
   ## How was this patch tested?
   
   Existing admin test suite should cover 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



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


[GitHub] [ozone] adoroszlai commented on a change in pull request #2289: HDDS-5280. Make XceiverClientManager creation when necessary in ContainerOperationClient

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #2289:
URL: https://github.com/apache/ozone/pull/2289#discussion_r642233854



##########
File path: hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/ContainerOperationClient.java
##########
@@ -131,7 +135,7 @@ public ContainerWithPipeline createContainer(String owner)
               allocateContainer(replicationType, replicationFactor, owner);
 
       Pipeline pipeline = containerWithPipeline.getPipeline();
-      client = xceiverClientManager.acquireClient(pipeline);
+      client = getXceiverClientManager().acquireClient(pipeline);

Review comment:
       Nit: please store `XceiverClientManager` and use the reference for `releaseClient`.  (Also in other methods.)

##########
File path: hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/ContainerOperationClient.java
##########
@@ -69,16 +69,20 @@
   private final StorageContainerLocationProtocol
       storageContainerLocationClient;
   private final boolean containerTokenEnabled;
+  private final OzoneConfiguration configuration;
+  private XceiverClientManager xceiverClientManager;
 
-  public XceiverClientManager getXceiverClientManager() {
+  public synchronized XceiverClientManager getXceiverClientManager()
+      throws IOException {
+    if (this.xceiverClientManager == null) {
+      this.xceiverClientManager = newXCeiverClientManager(configuration);
+    }
     return xceiverClientManager;
   }
 
-  private final XceiverClientManager xceiverClientManager;
-
   public ContainerOperationClient(OzoneConfiguration conf) throws IOException {

Review comment:
       The constructor no longer throws `IOException`.
   
   ```suggestion
     public ContainerOperationClient(OzoneConfiguration conf) {
   ```
   
   It will need corresponding changes in places where `ContainerOperationClient` is created.




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



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


[GitHub] [ozone] bharatviswa504 merged pull request #2289: HDDS-5280. Make XceiverClientManager creation when necessary in ContainerOperationClient

Posted by GitBox <gi...@apache.org>.
bharatviswa504 merged pull request #2289:
URL: https://github.com/apache/ozone/pull/2289


   


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



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


[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2289: HDDS-5280. Make XceiverClientManager creation when necessary in ContainerOperationClient

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #2289:
URL: https://github.com/apache/ozone/pull/2289#discussion_r642589916



##########
File path: hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/ContainerOperationClient.java
##########
@@ -131,7 +135,7 @@ public ContainerWithPipeline createContainer(String owner)
               allocateContainer(replicationType, replicationFactor, owner);
 
       Pipeline pipeline = containerWithPipeline.getPipeline();
-      client = xceiverClientManager.acquireClient(pipeline);
+      client = getXceiverClientManager().acquireClient(pipeline);

Review comment:
       Done




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



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


[GitHub] [ozone] bharatviswa504 commented on pull request #2289: HDDS-5280. Make XceiverClientManager creation when necessary in ContainerOperationClient

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on pull request #2289:
URL: https://github.com/apache/ozone/pull/2289#issuecomment-852015701


   Thank You @adoroszlai for the review.


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



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


[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2289: HDDS-5280. Make XceiverClientManager creation when necessary in ContainerOperationClient

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #2289:
URL: https://github.com/apache/ozone/pull/2289#discussion_r642589743



##########
File path: hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/ContainerOperationClient.java
##########
@@ -131,7 +135,7 @@ public ContainerWithPipeline createContainer(String owner)
               allocateContainer(replicationType, replicationFactor, owner);
 
       Pipeline pipeline = containerWithPipeline.getPipeline();
-      client = xceiverClientManager.acquireClient(pipeline);
+      client = getXceiverClientManager().acquireClient(pipeline);

Review comment:
       Done

##########
File path: hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/ContainerOperationClient.java
##########
@@ -69,16 +69,20 @@
   private final StorageContainerLocationProtocol
       storageContainerLocationClient;
   private final boolean containerTokenEnabled;
+  private final OzoneConfiguration configuration;
+  private XceiverClientManager xceiverClientManager;
 
-  public XceiverClientManager getXceiverClientManager() {
+  public synchronized XceiverClientManager getXceiverClientManager()
+      throws IOException {
+    if (this.xceiverClientManager == null) {
+      this.xceiverClientManager = newXCeiverClientManager(configuration);
+    }
     return xceiverClientManager;
   }
 
-  private final XceiverClientManager xceiverClientManager;
-
   public ContainerOperationClient(OzoneConfiguration conf) throws IOException {

Review comment:
       Done




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



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


[GitHub] [ozone] bharatviswa504 commented on pull request #2289: HDDS-5280. Make XceiverClientManager creation when necessary in ContainerOperationClient

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on pull request #2289:
URL: https://github.com/apache/ozone/pull/2289#issuecomment-851587160


   Thank You @adoroszlai for the review. I have addressed review comments.


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



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