ACCUMULO-4178: Updated the sender thread to include the table ids in thread name.
Closes apache/accumulo#87 Signed-off-by: Josh Elser <els...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/07124716 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/07124716 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/07124716 Branch: refs/heads/1.7 Commit: 071247167613b490bf6b722f97299fb8aca3c3a6 Parents: 2afc3dc Author: Ivan Bella <i...@bella.name> Authored: Sun Apr 3 00:49:55 2016 -0400 Committer: Josh Elser <els...@apache.org> Committed: Tue Apr 5 11:19:07 2016 -0400 ---------------------------------------------------------------------- .../core/client/impl/TabletServerBatchWriter.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/07124716/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java index 491bcc1..35d1e49 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java @@ -31,6 +31,7 @@ import java.util.Map.Entry; import java.util.Set; import java.util.Timer; import java.util.TimerTask; +import java.util.TreeSet; import java.util.concurrent.ExecutorService; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; @@ -38,6 +39,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; +import com.google.common.base.Joiner; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.BatchWriterConfig; @@ -831,10 +833,15 @@ public class TabletServerBatchWriter { 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; + + String msg = "sending " + String.format("%,d", count) + " mutations to " + String.format("%,d", mutationBatch.size()) + " tablets at " + location + + " tids: [" + Joiner.on(',').join(tableIds) + ']'; Thread.currentThread().setName(msg); Span span = Trace.start("sendMutations");