accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/2] git commit: ACCUMULO-1602 compactor to set thread name
Date Thu, 25 Jul 2013 20:51:21 GMT
Updated Branches:
  refs/heads/1.5.1-SNAPSHOT 44dfbf91a -> d8e5de664


ACCUMULO-1602 compactor to set thread name


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/978770c4
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/978770c4
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/978770c4

Branch: refs/heads/1.5.1-SNAPSHOT
Commit: 978770c4745b8a67861b0fefa1f705a5322394ef
Parents: 44dfbf9
Author: Eric Newton <ecn@apache.org>
Authored: Wed Jul 24 15:09:49 2013 -0400
Committer: Eric Newton <ecn@apache.org>
Committed: Wed Jul 24 15:09:49 2013 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/server/tabletserver/Compactor.java  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/978770c4/server/src/main/java/org/apache/accumulo/server/tabletserver/Compactor.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/Compactor.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/Compactor.java
index df26779..8e4af64 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/Compactor.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/Compactor.java
@@ -17,8 +17,11 @@
 package org.apache.accumulo.server.tabletserver;
 
 import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -138,6 +141,7 @@ public class Compactor implements Callable<CompactionStats> {
   
   private AtomicLong entriesRead = new AtomicLong(0);
   private AtomicLong entriesWritten = new AtomicLong(0);
+  private DateFormat dateFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS");
   
   private synchronized void setLocalityGroup(String name) {
     this.currentLocalityGroup = name;
@@ -280,6 +284,9 @@ public class Compactor implements Callable<CompactionStats> {
     
     clearStats();
 
+    String oldThreadName = Thread.currentThread().getName();
+    String newThreadName = "MajC compacting " + extent.toString() + " started " + dateFormatter.format(new
Date()) + " file: " + outputFile;
+    Thread.currentThread().setName(newThreadName);
     try {
       FileOperations fileFactory = FileOperations.getInstance();
       mfw = fileFactory.openWriter(outputFile, fs, conf, acuTableConf);
@@ -333,7 +340,7 @@ public class Compactor implements Callable<CompactionStats> {
       log.error(e, e);
       throw e;
     } finally {
-      
+      Thread.currentThread().setName(oldThreadName);
       if (remove)
         runningCompactions.remove(this);
 


Mime
View raw message