----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/68317/#review212905 -----------------------------------------------------------
sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAM.java Lines 94-96 (patched) <https://reviews.apache.org/r/68317/#comment298785> I think we already support Java8, so it can be a good practice to use lambdas. I recently faced a similar problem with System.getEnv(), I think this solution should be considered because it's more compact: ``` import java.util.function.Function; ... private static Function<String, String> envProvider = System::getenv; ... @VisibleForTesting static void setEnvProvider(Function<String, String> envProvider) { LauncherAM.envProvider = envProvider; } ... String envValue = envProvider.apply(key); ``` Then in the test code, you can just override like that: ``` LauncherAM.setEnvProvider(s -> { return dummyEnv.get(s); }); ``` So we don't need that tiny helper class, just replace the method reference with a new one. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/SystemEnvironment.java Lines 25 (patched) <https://reviews.apache.org/r/68317/#comment298786> See my comment at LauncherAM.java - this can be eliminated. - Peter Bacsko On febr. 15, 2019, 11:33 de, Denes Bodo wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/68317/ > ----------------------------------------------------------- > > (Updated febr. 15, 2019, 11:33 de) > > > Review request for oozie and Andras Salamon. > > > Bugs: OOZIE-3326 > https://issues.apache.org/jira/browse/OOZIE-3326 > > > Repository: oozie-git > > > Description > ------- > > SqoopMain needs to support tez delegation tokens for hive-imports. > Implementation is similar to that of HiveMain and Hive2Main. > > At present, hive-import will fail to start a tez session in secure > environment. > > > Diffs > ----- > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAM.java > 63afd91d3 > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherMain.java > b6599f7f3 > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/SystemEnvironment.java > PRE-CREATION > sharelib/sqoop/src/main/java/org/apache/oozie/action/hadoop/SqoopMain.java > 27f9306a0 > > sharelib/sqoop/src/test/java/org/apache/oozie/action/hadoop/TestSqoopMain.java > d6f96d546 > > > Diff: https://reviews.apache.org/r/68317/diff/6/ > > > Testing > ------- > > > Thanks, > > Denes Bodo > >