hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 李光谱 <cstjy...@gmail.com>
Subject Using Java.lang.instrumentation to print all the classes
Date Thu, 24 Dec 2015 18:05:21 GMT
Dear All,

I want to print all the classes name executed in one job. But the result is
missing some important classes.
I used hadoop-0.23.1.
I even cannot find  MRAppMaster.
Is anyone here who met the same problem?

The source code is:
public static void premain (String agentArguments, Instrumentation
instrumentation){
        instrumentation.addTransformer(new
SimpleTransformer(agentArguments));

In SimpleTransformer.java:
public byte[] transform (ClassLoader loader, String className, Class
redefiningClass, ProtectionDomain domain, byte[] bytes) throws
IllegalClassFormatException {
            System.out.println("Loading " + className +" from
"+loader.toString());
            /////
            WORK
            /////
    }
Thanks a lot!

Best,
Guangpu

Mime
View raw message