[ 
https://issues.apache.org/jira/browse/HBASE-12729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14274017#comment-14274017
 ] 

Lars Hofhansl commented on HBASE-12729:
---------------------------------------

Did a 10 minute looksee, lgtm.

Spelling Nit:
{code}
+/**
+ * A wrapper for a runnable for a group of actions for a single regionserver.
+ * <p>
+ * This can be used to build up the actions that should be taken and then
+ * </p>
+ * <p>
{code}

Is the synchronized needed here:
{code}
+    if (stat == null) {
+      // create a stats object and update the stats
+      synchronized (this) {
+        stat = stats.get(server);
+        // we don't have stats for that server yet, so we need to make some
+        if (stat == null) {
+          stat = new ServerStatistics();
+          stats.put(server, stat);
+        }
+      }
+    }
{code}
Could get the ServerStatitics, if null create one and then use putIfAbsent. In 
the race case we'd create the object in vain, but we'd save the synchronized. 
Is this even on the hot path?


> Backport HBASE-5162 (Basic client pushback mechanism) to 0.98
> -------------------------------------------------------------
>
>                 Key: HBASE-12729
>                 URL: https://issues.apache.org/jira/browse/HBASE-12729
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Client, regionserver
>            Reporter: Andrew Purtell
>            Assignee: Andrew Purtell
>             Fix For: 0.98.10
>
>         Attachments: HBASE-12729-0.98.patch, HBASE-12729-0.98.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to