You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "BELUGA BEHR (JIRA)" <ji...@apache.org> on 2018/10/08 14:21:00 UTC

[jira] [Created] (HDFS-13969) Server.java Prefer Array List

BELUGA BEHR created HDFS-13969:
----------------------------------

             Summary: Server.java Prefer Array List
                 Key: HDFS-13969
                 URL: https://issues.apache.org/jira/browse/HDFS-13969
             Project: Hadoop HDFS
          Issue Type: Improvement
          Components: ipc
    Affects Versions: 3.2.0
            Reporter: BELUGA BEHR
         Attachments: HDFS-13969.1.patch

*  Prefer ArrayDeque over LinkedList (faster, less memory overhead)
* Address this code:

{code}
    //
    // Remove calls that have been pending in the responseQueue 
    // for a long time.
    //
    private void doPurge(RpcCall call, long now) {
      LinkedList<RpcCall> responseQueue = call.connection.responseQueue;
      synchronized (responseQueue) {
        Iterator<RpcCall> iter = responseQueue.listIterator(0);
        while (iter.hasNext()) {
          call = iter.next();
          if (now > call.timestamp + PURGE_INTERVAL) {
            closeConnection(call.connection);
            break;
          }
        }
      }
    }
{code}

It says "Remove calls" (plural) but only one call will be removed because of the 'break' statement.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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