[ 
https://issues.apache.org/jira/browse/HADOOP-18931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17787690#comment-17787690
 ] 

ASF GitHub Bot commented on HADOOP-18931:
-----------------------------------------

virajjasani commented on code in PR #6197:
URL: https://github.com/apache/hadoop/pull/6197#discussion_r1398534424


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ClassUtil.java:
##########
@@ -36,13 +36,25 @@ public class ClassUtil {
    * @return a jar file that contains the class, or null.
    */
   public static String findContainingJar(Class<?> clazz) {
-    ClassLoader loader = clazz.getClassLoader();
-    String classFile = clazz.getName().replaceAll("\\.", "/") + ".class";
+    return findContainingResource(clazz.getClassLoader(), clazz.getName(), 
"jar");
+  }
+
+  /**
+   * Find the absolute location of the class.
+   *
+   * @param clazz the class to find.
+   * @return the class file with absolute location, or null.
+   */
+  public static String findClassLocation(Class<?> clazz) {

Review Comment:
   done





> FileSystem.getFileSystemClass() to log at debug the jar the .class came from
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-18931
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18931
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: 3.3.6
>            Reporter: Steve Loughran
>            Priority: Minor
>              Labels: pull-request-available
>
> we want to be able to log the jar the filesystem implementation class, so 
> that we can identify which version of a module the class came from.
> this is to help track down problems where different machines in the cluster 
> or the .tar.gz bundle is out of date. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to