gobblin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject incubator-gobblin git commit: [GOBBLIN-322] The cluster mode failed to find a log4j config file
Date Wed, 29 Nov 2017 00:29:18 GMT
Repository: incubator-gobblin
Updated Branches:
  refs/heads/master f7e3ad062 -> 98ca09210


[GOBBLIN-322] The cluster mode failed to find a log4j config file

Issue:

When running the bin/gobblin-cluster-master.sh
I got an exception below:
Exception in thread "main"
java.io.FileNotFoundException: log4j-
cluster.properties (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.ja
va:195)
at java.io.FileInputStream.<init>(FileInputStream.
java:138)
at java.io.FileInputStream.<init>(FileInputStream.
java:93)
at org.apache.gobblin.util.logs.Log4jConfiguration
Helper.updateLog4jConfiguration(Log4jConfiguration
Helper.java:51)
at org.apache.gobblin.cluster.GobblinClusterManage
r.main(GobblinClusterManager.java:724)
bin/gobblin-cluster-worker.sh has a similar issue.

Analysis:

public static void
updateLog4jConfiguration(Class<?> targetClass,
String log4jPath, String log4jFileName)
throws IOException {
Closer closer = Closer.create();
try {
InputStream fileInputStream = closer.register(new
FileInputStream(log4jPath));

The caller passes a simple file name
Log4jConfigurationHelper.updateLog4jConfiguration(
GobblinClusterManager.class,
GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_LO
G4J_CONFIGURATION_FILE,
GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_LO
G4J_CONFIGURATION_FILE);

Solution:
This logic can be removed.

Users can simply pass in a custom log4j
configuration directly if needed.
e.g.
-Dlog4j.configuration=file:/Users/foo/oss/gobblin/
temp/my-log4j.properties
Or
add a custom log4j.properties file in the class
path.

Closes #2173 from HappyRay/remove-log4j-update-
code


Project: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/commit/98ca0921
Tree: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/tree/98ca0921
Diff: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/diff/98ca0921

Branch: refs/heads/master
Commit: 98ca09210f10fe42f09c162934c071cc1449c946
Parents: f7e3ad0
Author: Ray Yang <ruiguo@gmail.com>
Authored: Tue Nov 28 16:29:11 2017 -0800
Committer: Abhishek Tiwari <abhishektiwari.btech@gmail.com>
Committed: Tue Nov 28 16:29:11 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/gobblin/cluster/GobblinClusterManager.java   | 4 ----
 .../main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java  | 4 ----
 2 files changed, 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-gobblin/blob/98ca0921/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterManager.java
----------------------------------------------------------------------
diff --git a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterManager.java
b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterManager.java
index cdb5b29..8ced294 100644
--- a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterManager.java
+++ b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterManager.java
@@ -725,10 +725,6 @@ public class GobblinClusterManager implements ApplicationLauncher {
         isStandaloneClusterManager = Boolean.parseBoolean(cmd.getOptionValue(GobblinClusterConfigurationKeys.STANDALONE_CLUSTER_MODE,
"false"));
       }
 
-      Log4jConfigurationHelper.updateLog4jConfiguration(GobblinClusterManager.class,
-          GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_LOG4J_CONFIGURATION_FILE,
-          GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_LOG4J_CONFIGURATION_FILE);
-
       LOGGER.info(JvmUtils.getJvmInputArguments());
       Config config = ConfigFactory.load();
 

http://git-wip-us.apache.org/repos/asf/incubator-gobblin/blob/98ca0921/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java
----------------------------------------------------------------------
diff --git a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java
b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java
index 7877da8..f86874b 100644
--- a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java
+++ b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java
@@ -480,10 +480,6 @@ public class GobblinTaskRunner {
         System.exit(1);
       }
 
-      Log4jConfigurationHelper.updateLog4jConfiguration(GobblinTaskRunner.class,
-          GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_LOG4J_CONFIGURATION_FILE,
-          GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_LOG4J_CONFIGURATION_FILE);
-
       LOGGER.info(JvmUtils.getJvmInputArguments());
 
       String applicationName = cmd.getOptionValue(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME);


Mime
View raw message