[ 
https://issues.apache.org/jira/browse/HDFS-13274?focusedWorklogId=793427&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-793427
 ]

ASF GitHub Bot logged work on HDFS-13274:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Jul/22 20:58
            Start Date: 20/Jul/22 20:58
    Worklog Time Spent: 10m 
      Work Description: goiri commented on code in PR #4531:
URL: https://github.com/apache/hadoop/pull/4531#discussion_r926048644


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/ConnectionPool.java:
##########
@@ -210,24 +217,22 @@ public AtomicInteger getClientIndex() {
    * @return Connection context.
    */
   protected ConnectionContext getConnection() {
-
     this.lastActiveTime = Time.now();
-
-    // Get a connection from the pool following round-robin
-    ConnectionContext conn = null;
     List<ConnectionContext> tmpConnections = this.connections;
-    int size = tmpConnections.size();
-    // Inc and mask off sign bit, lookup index should be non-negative int
-    int threadIndex = this.clientIndex.getAndIncrement() & 0x7FFFFFFF;
-    for (int i=0; i<size; i++) {
-      int index = (threadIndex + i) % size;
-      conn = tmpConnections.get(index);
-      if (conn != null && conn.isUsable()) {
-        return conn;
+    for (ConnectionContext tmpConnection : tmpConnections) {

Review Comment:
   I'm fine with that, this is just an optimization.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 793427)
    Time Spent: 3h  (was: 2h 50m)

> RBF: Extend RouterRpcClient to use multiple sockets
> ---------------------------------------------------
>
>                 Key: HDFS-13274
>                 URL: https://issues.apache.org/jira/browse/HDFS-13274
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Íñigo Goiri
>            Assignee: Íñigo Goiri
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> HADOOP-13144 introduces the ability to create multiple connections for the 
> same user and use different sockets. The RouterRpcClient should use this 
> approach to get a better throughput.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to