----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58171/ -----------------------------------------------------------
Review request for oozie and Peter Bacsko. Repository: oozie-git Description ------- In several Oozie actions we face the problem that if `log4j.properties` is not readable by current thread, or not present on the classpath, while taking an `URL.openStream()` call afterwards, an `IOException` is thrown and the action won't run. Such actions are: * [`DistcpMain`](https://github.com/apache/oozie/blob/master/sharelib/distcp/src/main/java/org/apache/oozie/action/hadoop/DistcpMain.java#L135) * [`HiveMain`](https://github.com/apache/oozie/blob/master/sharelib/hive/src/main/java/org/apache/oozie/action/hadoop/HiveMain.java#L146) * [`PigMain`](https://github.com/apache/oozie/blob/master/sharelib/pig/src/main/java/org/apache/oozie/action/hadoop/PigMain.java#L173) * [`PigMainWithOldApi`](https://github.com/apache/oozie/blob/master/sharelib/pig/src/main/java/org/apache/oozie/action/hadoop/PigMainWithOldAPI.java#L160) * [`SparkMain`](https://github.com/apache/oozie/blob/master/sharelib/spark/src/main/java/org/apache/oozie/action/hadoop/SparkMain.java#L430) * [`SqoopMain`](https://github.com/apache/oozie/blob/master/sharelib/sqoop/src/main/java/org/apache/oozie/action/hadoop/SqoopMain.java#L124) Extend [`LauncherMain.run()`](https://github.com/apache/oozie/blob/master/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherMain.java#L62-L65) by a convenience method that loads Hadoop's `log4j.properties` in beforehand. In case `URL.openStream()` would throw `IOException` we resort to a call to a new file `hadoop-default-log4j.properties` on the classpath (packaged along w/ `LauncherMain.class`) that has the same contents as the `log4j.properties` that is not accessible / readable / present. Diffs ----- sharelib/distcp/src/main/java/org/apache/oozie/action/hadoop/DistcpMain.java fcaadefd215368565fb126ca92515792e1f1a09b sharelib/hive/src/main/java/org/apache/oozie/action/hadoop/HiveMain.java bc8ab29c25405806f40232d32254ba2a7f5271e4 sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherMain.java 7ae48e168a310b4d55feda7cbce8b2d29c2ec505 sharelib/oozie/src/main/resources/auxiliary-log4j.properties PRE-CREATION sharelib/oozie/src/test/java/org/apache/oozie/action/hadoop/TestLauncherMain.java PRE-CREATION sharelib/pig/src/main/java/org/apache/oozie/action/hadoop/PigMain.java ba393eee53e92d144159f83893d4baab00737a44 sharelib/pig/src/main/java/org/apache/oozie/action/hadoop/PigMainWithOldAPI.java 14ab65e7d00c426036ced3e80400c80deea0e282 sharelib/spark/src/main/java/org/apache/oozie/action/hadoop/SparkMain.java c24d95c88be0dbf6fe80241d887a70100a5e1b4a sharelib/sqoop/src/main/java/org/apache/oozie/action/hadoop/SqoopMain.java cb8f56e9b66de0eb2799e68bc56d0ee36d4ba317 Diff: https://reviews.apache.org/r/58171/diff/1/ Testing ------- Relevant unit tests run. Thanks, András Piros