Github user chtyim commented on a diff in the pull request:
https://github.com/apache/twill/pull/71#discussion_r221661290
--- Diff:
twill-yarn/src/main/java/org/apache/twill/internal/yarn/YarnUtils.java ---
@@ -202,6 +223,28 @@ public static void cloneHaNnCredentials(Configuration
config) throws IOException
}
}
+ /***
+ * When hadoop_version > 2.8.0, class DFSUtils has no method
getHaNnRpcAddresses(Configuration config)
+ * @param config
+ * @return
+ */
+ private static Set<Map.Entry<String, Map<String, InetSocketAddress>>>
getEntries(Configuration config) {
+ return iDFSUtilClientExists ? invoke(config) :
+ DFSUtil.getHaNnRpcAddresses(config).entrySet();
+ }
+
+ private static Set<Map.Entry<String, Map<String, InetSocketAddress>>>
invoke(Configuration config) {
+ try {
+ return ((Map) getHaNnRpcAddressesMethod.invoke(null,
config)).entrySet();
--- End diff --
Why casting to `Map` while the return type of this method is `Set`??
---