chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r1367839 - in /incubator/chukwa/trunk: CHANGES.txt src/main/java/org/apache/hadoop/chukwa/extraction/demux/DemuxManager.java
Date Wed, 01 Aug 2012 01:38:56 GMT
Author: asrabkin
Date: Wed Aug  1 01:38:55 2012
New Revision: 1367839

URL: http://svn.apache.org/viewvc?rev=1367839&view=rev
Log:
CHUKWA-650. Re-configure Demux ReduceNumber without re-starting the DemuxManager service.
Contributed by Jie Huang

Modified:
    incubator/chukwa/trunk/CHANGES.txt
    incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/extraction/demux/DemuxManager.java

Modified: incubator/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/CHANGES.txt?rev=1367839&r1=1367838&r2=1367839&view=diff
==============================================================================
--- incubator/chukwa/trunk/CHANGES.txt (original)
+++ incubator/chukwa/trunk/CHANGES.txt Wed Aug  1 01:38:55 2012
@@ -6,6 +6,8 @@ Trunk (unreleased changes)
 
   IMPROVEMENTS
 
+    CHUKWA-650. Re-configure Demux ReduceNumber without re-starting the DemuxManager service.
(Jie Huang via asrabkin)
+    
     CHUKWA-649. Handle pid-file missing case while stoping chukwa processes. (Jie Huang via
asrabkin)
 
     CHUKWA-645. Updated Hadoop and HBase dependency. (Eric Yang)

Modified: incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/extraction/demux/DemuxManager.java
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/extraction/demux/DemuxManager.java?rev=1367839&r1=1367838&r2=1367839&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/extraction/demux/DemuxManager.java
(original)
+++ incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/extraction/demux/DemuxManager.java
Wed Aug  1 01:38:55 2012
@@ -28,6 +28,7 @@ import org.apache.hadoop.chukwa.conf.Chu
 import org.apache.hadoop.chukwa.extraction.CHUKWA_CONSTANT;
 import org.apache.hadoop.chukwa.util.NagiosHelper;
 import org.apache.hadoop.chukwa.util.DaemonWatcher;
+import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -328,17 +329,21 @@ public class DemuxManager implements CHU
     * @param demuxOutputDir
     * @return true id Demux succeed
     */
-   protected boolean runDemux(String demuxInputDir, String demuxOutputDir) {
+   protected boolean runDemux(String demuxInputDir, String demuxOutputDir) { 
+     // to reload the configuration, and demux's reduce number
+     Configuration tempConf = new Configuration(conf);
+     tempConf.reloadConfiguration();
+     demuxReducerCount = tempConf.getInt(CHUKWA_DEMUX_REDUCER_COUNT_FIELD, DEFAULT_REDUCER_COUNT);
      String[] demuxParams;
      int i=0;
-     Demux.addParsers(conf);
+     Demux.addParsers(tempConf);
      demuxParams = new String[4];
      demuxParams[i++] = "-r";
      demuxParams[i++] = "" + demuxReducerCount;
      demuxParams[i++] = demuxInputDir;
      demuxParams[i++] = demuxOutputDir;
      try {
-       return ( 0 == ToolRunner.run(this.conf,new Demux(), demuxParams) );
+       return ( 0 == ToolRunner.run(tempConf,new Demux(), demuxParams) );
      } catch (Throwable e) {
        e.printStackTrace();
        globalErrorcounter ++;



Mime
View raw message