hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiten...@apache.org
Subject svn commit: r1080775 - in /hadoop/common/trunk: CHANGES.txt src/java/org/apache/hadoop/util/Daemon.java
Date Fri, 11 Mar 2011 21:57:21 GMT
Author: jitendra
Date: Fri Mar 11 21:57:21 2011
New Revision: 1080775

URL: http://svn.apache.org/viewvc?rev=1080775&view=rev
Log:
HADOOP-7166. Add DaemonFactory to common. Contributed by Erik Steffl and jitendra.

Modified:
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/src/java/org/apache/hadoop/util/Daemon.java

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=1080775&r1=1080774&r2=1080775&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Fri Mar 11 21:57:21 2011
@@ -74,6 +74,8 @@ Trunk (unreleased changes)
     HADOOP-7133. Batch the calls in DataStorage to FileUtil.createHardLink().
     (Matt Foley via jghoman)
 
+    HADOOP-7166. Add DaemonFactory to common. (Erik Steffl & jitendra)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/util/Daemon.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/util/Daemon.java?rev=1080775&r1=1080774&r2=1080775&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/util/Daemon.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/util/Daemon.java Fri Mar 11 21:57:21 2011
@@ -18,6 +18,8 @@
 
 package org.apache.hadoop.util;
 
+import java.util.concurrent.ThreadFactory;
+
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
 
@@ -30,6 +32,20 @@ public class Daemon extends Thread {
     setDaemon(true);                              // always a daemon
   }
 
+  /**
+   * Provide a factory for named daemon threads,
+   * for use in ExecutorServices constructors
+   */
+  @InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce"})
+  public static class DaemonFactory extends Daemon implements ThreadFactory {
+
+    @Override
+    public Thread newThread(Runnable runnable) {
+      return new Daemon(runnable);
+    }
+
+  }
+
   Runnable runnable = null;
   /** Construct a daemon thread. */
   public Daemon() {



Mime
View raw message