deepujain commented on code in PR #8303:
URL: https://github.com/apache/hadoop/pull/8303#discussion_r2907254825
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java:
##########
@@ -663,7 +663,17 @@ public static <InstanceT> InstanceT
getInstanceFromReflection(String className,
try {
ClassLoader classLoader;
if (conf != null) {
- classLoader = conf.getClassLoader();
+ if (conf.getBoolean(AWS_S3_CLASSLOADER_ISOLATION,
+ DEFAULT_AWS_S3_CLASSLOADER_ISOLATION)) {
+ classLoader = conf.getClassLoader();
+ } else {
+ ClassLoader confLoader = conf.getClassLoader();
+ classLoader = (confLoader != null) ? confLoader
+ : Thread.currentThread().getContextClassLoader();
+ }
+ if (classLoader == null) {
+ classLoader = S3AUtils.class.getClassLoader();
+ }
Review Comment:
the implementation was simplified to always use conf.getClassLoader() when
conf != null, since the Configuration’s classloader is set by the caller and is
never null.
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java:
##########
@@ -663,7 +663,17 @@ public static <InstanceT> InstanceT
getInstanceFromReflection(String className,
try {
ClassLoader classLoader;
if (conf != null) {
- classLoader = conf.getClassLoader();
+ if (conf.getBoolean(AWS_S3_CLASSLOADER_ISOLATION,
+ DEFAULT_AWS_S3_CLASSLOADER_ISOLATION)) {
+ classLoader = conf.getClassLoader();
+ } else {
Review Comment:
the implementation was simplified to always use conf.getClassLoader() when
conf != null, since the Configuration’s classloader is set by the caller and is
never null.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]