Skip to content

Commit

Permalink
[Impeove] hadoopUtils minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfboys committed Aug 31, 2024
1 parent 1eaaecf commit 55ad9b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ object ClassLoaderUtils extends Logger {
} catch {
case _: NoSuchFieldException =>
throw new UnsupportedOperationException(
s"Add resource to classpath unsupported jdk version: ${System.getProperty("java.version")}")
s"Add resource to classpath unsupported, jdk version: ${System.getProperty("java.version")}")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ object HadoopUtils extends Logger {
def hadoopConf: Configuration = Option(reusableConf).getOrElse {
reusableConf = getConfigurationFromHadoopConfDir(hadoopConfDir)
// add hadoopConfDir to classpath...you know why???
ClassLoaderUtils.loadResource(hadoopConfDir)
Try(ClassLoaderUtils.loadResource(hadoopConfDir)) match {
case Failure(e) => logWarn(s"Load hadoop resource to classpath failed. $e")
case _ =>
}

if (StringUtils.isBlank(reusableConf.get("hadoop.tmp.dir"))) {
reusableConf.set("hadoop.tmp.dir", "/tmp")
Expand Down

0 comments on commit 55ad9b6

Please sign in to comment.