[ 
https://issues.apache.org/jira/browse/HADOOP-15830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

BELUGA BEHR updated HADOOP-15830:
---------------------------------
    Status: Patch Available  (was: Open)

I just submitted another patch which I was a bit more aggressive on.  It has 
all the changes before, plus:

#  Removed some instances of "log and throw" error handling.  This is an 
anti-pattern and should be avoided. (try.. catch... log... throw)  Log or 
throw; do not do both.
# Applied some code formatting to improve readability and check-style of 
certain areas
# Removed a lot of dead white space
# Remove logging guards {{LOG.isDebugEnabled()}} in favor of SLF4j parameter 
logging
# Removed many instances of logging containing 
{{Thread.currentThread().getName()}} to record the thread name performing the 
logging.  Emitting the thread name can be configured with the logging framework 
and does not need to be done explicitly by the caller.

> Server.java Prefer ArrayList
> ----------------------------
>
>                 Key: HADOOP-15830
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15830
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: ipc
>    Affects Versions: 3.2.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Minor
>         Attachments: HADOOP-15830.2.patch, 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: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to