You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@falcon.apache.org by ra...@apache.org on 2014/09/19 01:46:45 UTC

git commit: FALCON-745 LogUtil requires fine control over what to dump. Contributed by Raghav Kumar Gautam

Repository: incubator-falcon
Updated Branches:
  refs/heads/master 7dbec734e -> 7540887ae


FALCON-745 LogUtil requires fine control over what to dump. Contributed by Raghav Kumar Gautam


Project: http://git-wip-us.apache.org/repos/asf/incubator-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-falcon/commit/7540887a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-falcon/tree/7540887a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-falcon/diff/7540887a

Branch: refs/heads/master
Commit: 7540887ae3d8b6e20c5e8c8a09830f6123a5e26b
Parents: 7dbec73
Author: Raghav Kumar Gautam <ra...@apache.org>
Authored: Thu Sep 18 16:46:40 2014 -0700
Committer: Raghav Kumar Gautam <ra...@apache.org>
Committed: Thu Sep 18 16:46:40 2014 -0700

----------------------------------------------------------------------
 falcon-regression/CHANGES.txt                   |  3 ++
 .../falcon/regression/core/util/Config.java     |  5 +++
 .../falcon/regression/core/util/LogUtil.java    | 32 ++++++++++++++++----
 3 files changed, 34 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/7540887a/falcon-regression/CHANGES.txt
----------------------------------------------------------------------
diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt
index 2d8d631..e5c0ad0 100644
--- a/falcon-regression/CHANGES.txt
+++ b/falcon-regression/CHANGES.txt
@@ -9,6 +9,9 @@ Trunk (Unreleased)
    via Samarth Gupta)
 
   IMPROVEMENTS
+   FALCON-745 LogUtil requires fine control over what to dump (Raghav Kumar
+   Gautam)
+
    FALCON-739 JmsMessageConsumer should start daemon threads (Raghav Kumar
    Gautam)
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/7540887a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/Config.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/Config.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/Config.java
index 9ae3f0b..9172455 100644
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/Config.java
+++ b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/Config.java
@@ -20,6 +20,7 @@ package org.apache.falcon.regression.core.util;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;
 import org.apache.log4j.Logger;
 import org.testng.Assert;
 
@@ -35,6 +36,10 @@ public final class Config {
         try {
             LOGGER.info("Going to read properties from: " + propFileName);
             confObj = new PropertiesConfiguration(Config.class.getResource("/" + propFileName));
+            //if changed configuration will be reloaded within 2 min
+            final FileChangedReloadingStrategy reloadingStrategy = new FileChangedReloadingStrategy();
+            reloadingStrategy.setRefreshDelay(2 * 60 * 1000);
+            confObj.setReloadingStrategy(reloadingStrategy);
         } catch (ConfigurationException e) {
             Assert.fail("Could not read properties because of exception: " + e);
         }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/7540887a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/LogUtil.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/LogUtil.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/LogUtil.java
index 42583fa..ae157ad 100644
--- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/LogUtil.java
+++ b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/LogUtil.java
@@ -61,8 +61,12 @@ public class LogUtil {
                 }
                 for (BundleJob oneJobInfo : bundleJobsInfo) {
                     final String bundleJobId = oneJobInfo.getId();
-                    writeOneJobInfo(oozieClient, bundleJobId, location, filter);
-                    writeOneJobLog(oozieClient, bundleJobId, location, filter);
+                    if(!skipInfo()) {
+                        writeOneJobInfo(oozieClient, bundleJobId, location, filter);
+                    }
+                    if(!skipLog()) {
+                        writeOneJobLog(oozieClient, bundleJobId, location, filter);
+                    }
                 }
             }
 
@@ -131,8 +135,12 @@ public class LogUtil {
                 }
                 for (CoordinatorJob oneJobInfo : coordJobsInfo) {
                     final String coordJobId = oneJobInfo.getId();
-                    writeOneJobInfo(oozieClient, coordJobId, location, filter);
-                    writeOneJobLog(oozieClient, coordJobId, location, filter);
+                    if(!skipInfo()) {
+                        writeOneJobInfo(oozieClient, coordJobId, location, filter);
+                    }
+                    if(!skipLog()) {
+                        writeOneJobLog(oozieClient, coordJobId, location, filter);
+                    }
                 }
             }
 
@@ -199,8 +207,12 @@ public class LogUtil {
                 }
                 for (WorkflowJob oneJobInfo : wfJobsInfo) {
                     final String wfJobId = oneJobInfo.getId();
-                    writeOneJobInfo(oozieClient, wfJobId, location, filter);
-                    writeOneJobLog(oozieClient, wfJobId, location, filter);
+                    if(!skipInfo()) {
+                        writeOneJobInfo(oozieClient, wfJobId, location, filter);
+                    }
+                    if(!skipLog()) {
+                        writeOneJobLog(oozieClient, wfJobId, location, filter);
+                    }
                 }
             }
 
@@ -260,6 +272,14 @@ public class LogUtil {
         },
         ;
 
+        private static boolean skipInfo() {
+            return Config.getBoolean("log.capture.oozie.skip_info", false);
+        }
+
+        private static boolean skipLog() {
+            return Config.getBoolean("log.capture.oozie.skip_log", false);
+        }
+
         /**
          * Pull and dump info and log of all jobs of a type
          * @param oozieClient oozie client that will be used for pulling log