----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/52737/#review152319 -----------------------------------------------------------
sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/AMRMCallBackHandler.java (line 41) <https://reviews.apache.org/r/52737/#comment221291> Why `synchronized`? I don't see we reach out to global state, or shared resources. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/AMRMCallBackHandler.java (line 59) <https://reviews.apache.org/r/52737/#comment221292> Why `synchronized`? I don't see we reach out to global state, or shared resources. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/AMRMCallBackHandler.java (line 68) <https://reviews.apache.org/r/52737/#comment221296> Why `synchronized`? I don't see we reach out to global state, or shared resources. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/ErrorHolder.java (line 20) <https://reviews.apache.org/r/52737/#comment221297> Consider using the existing `ErrorCode` and `XException` classes instead. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/HdfsAndLocalFSOperations.java (line 38) <https://reviews.apache.org/r/52737/#comment221309> I'd separate concerns to different classes. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/HdfsAndLocalFSOperations.java (line 43) <https://reviews.apache.org/r/52737/#comment221301> Better would be `"seqFileWriterFactory should not be null"`. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/HdfsAndLocalFSOperations.java (line 44) <https://reviews.apache.org/r/52737/#comment221302> Better would be `"ugi should not be null"`. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/HdfsAndLocalFSOperations.java (line 57) <https://reviews.apache.org/r/52737/#comment221305> What about using `Files#walkFileTree` instead? https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#walkFileTree(java.nio.file.Path,%20java.util.Set,%20int,%20java.nio.file.FileVisitor) sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/HdfsAndLocalFSOperations.java (line 81) <https://reviews.apache.org/r/52737/#comment221306> What about using Guava's `Files#toString()`? https://google.github.io/guava/releases/19.0/api/docs/com/google/common/io/Files.html#toString(java.io.File, java.nio.charset.Charset) sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/HdfsAndLocalFSOperations.java (line 102) <https://reviews.apache.org/r/52737/#comment221307> What about using Guava's `Files#toString()`? https://google.github.io/guava/releases/19.0/api/docs/com/google/common/io/Files.html#toString(java.io.File, java.nio.charset.Charset) sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAM.java (lines 350 - 352) <https://reviews.apache.org/r/52737/#comment221311> Dead code, pls. remove. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAM.java (lines 350 - 352) <https://reviews.apache.org/r/52737/#comment221314> Dead code, pls. remove. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAM.java (lines 355 - 356) <https://reviews.apache.org/r/52737/#comment221312> Dead code, pls. remove. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAM.java (lines 373 - 375) <https://reviews.apache.org/r/52737/#comment221313> Dead code, pls. remove. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAM.java (line 425) <https://reviews.apache.org/r/52737/#comment221315> Why not use `AtomicReference#compareAndSet()` instead? sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAM.java (lines 475 - 476) <https://reviews.apache.org/r/52737/#comment221318> Consider Guava's `Files#toString()`: https://google.github.io/guava/releases/19.0/api/docs/com/google/common/io/Files.html#toString(java.io.File, java.nio.charset.Charset) sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAM.java (lines 512 - 514) <https://reviews.apache.org/r/52737/#comment221320> Consider Guava's `Files#toString()`: https://google.github.io/guava/releases/19.0/api/docs/com/google/common/io/Files.html#toString(java.io.File, java.nio.charset.Charset) sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/PrepareActionsHandler.java (line 67) <https://reviews.apache.org/r/52737/#comment221322> Why is `operation` a `String`? sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/PrepareActionsHandler.java (lines 69 - 74) <https://reviews.apache.org/r/52737/#comment221323> `switch case default` would be nicer here. sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/PrepareActionsHandler.java (line 89) <https://reviews.apache.org/r/52737/#comment221321> `Charsets.UTF_8.toString()` - András Piros On Oct. 11, 2016, 1:42 p.m., Peter Bacsko wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/52737/ > ----------------------------------------------------------- > > (Updated Oct. 11, 2016, 1:42 p.m.) > > > Review request for oozie, András Piros, Attila Sasvari, Peter Cseh, and > Robert Kanter. > > > Repository: oozie-git > > > Description > ------- > > This review contains a suggested approach for refactoring LauncherAM on the > OYA branch. > > The main idea is to inject all dependencies of the class via the constructor. > In some cases, this requires factory objects. Note that this is necessary > because in unit tests, because we don't want to create actual resources such > as UGI or async ResourceManager callback. > > In the tests, we can instantiate this class with mocks. The testability is > greatly enhanced because various checks and verifications can be performed on > the mocks. Tests are currently not in this review (see > https://issues.apache.org/jira/browse/OOZIE-2685). > > > Diffs > ----- > > core/src/test/java/org/apache/oozie/action/hadoop/TestLauncherAM.java > ed29299 > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/AMRMCallBackHandler.java > PRE-CREATION > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/AMRMClientAsyncFactory.java > PRE-CREATION > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/ErrorHolder.java > PRE-CREATION > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/HdfsAndLocalFSOperations.java > PRE-CREATION > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAM.java > 85d78c6 > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAMCallbackNotifier.java > 23648b8 > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherAMCallbackNotifierFactory.java > PRE-CREATION > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/PrepareActionsDriver.java > 4a51d48 > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/PrepareActionsHandler.java > PRE-CREATION > > sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/SequenceFileWriterFactory.java > PRE-CREATION > > Diff: https://reviews.apache.org/r/52737/diff/ > > > Testing > ------- > > Unit tests are being written right now. > > > Thanks, > > Peter Bacsko > >
