hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1079159 - /hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/util/Daemon.java
Date Tue, 08 Mar 2011 04:40:50 GMT
Author: omalley
Date: Tue Mar  8 04:40:49 2011
New Revision: 1079159

URL: http://svn.apache.org/viewvc?rev=1079159&view=rev
Log:
commit 389b9996c65f24ae8f0d4f512a168c41e6ed8d13
Author: Erik Steffl <steffl@yahoo-inc.com>
Date:   Wed Jan 12 13:08:58 2011 -0800

    . Move DaemonFactory from HDFS to Common
    
    +++ b/YAHOO-CHANGES.txt
    +    . Move DaemonFactory frmo HDFS to Common (Erik Steffl)
    +

Modified:
    hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/util/Daemon.java

Modified: hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/util/Daemon.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/util/Daemon.java?rev=1079159&r1=1079158&r2=1079159&view=diff
==============================================================================
--- hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/util/Daemon.java (original)
+++ hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/util/Daemon.java Tue Mar
 8 04:40:49 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,19 @@ public class Daemon extends Thread {
     setDaemon(true);                              // always a daemon
   }
 
+  /**
+   * Provide a factory for named daemon threads,
+   * for use in ExecutorServices constructors
+   */
+  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