accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From keith-turner <...@git.apache.org>
Subject [GitHub] accumulo pull request: ACCUMULO-4178: Updated the sender thread to...
Date Mon, 04 Apr 2016 14:17:30 GMT
Github user keith-turner commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/87#discussion_r58382167
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
---
    @@ -831,11 +814,16 @@ public void send(TabletServerMutations<Mutation> tsm) throws
AccumuloServerExcep
             try {
     
               long count = 0;
    -          for (List<Mutation> list : mutationBatch.values()) {
    -            count += list.size();
    +
    +          Set<Text> tableIds = new TreeSet<Text>();
    +          for (Map.Entry<KeyExtent,List<Mutation>> entry : mutationBatch.entrySet())
{
    +            count += entry.getValue().size();
    +            tableIds.add(entry.getKey().getTableId());
               }
    -          String msg = "sending " + String.format("%,d", count) + " mutations to " +
String.format("%,d", mutationBatch.size()) + " tablets at " + location;
    -          Thread.currentThread().setName(msg);
    +          StringBuilder msg = new StringBuilder();
    --- End diff --
    
    When java generates code for string concatenation, it uses StringBuilder.   Is there any
value in this case for using StringBuilder over concatenation?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message