@@ -0,0 +1,1636 @@
+package aj.hadoop.monitor.examples;%0A%0Aimport java.io.*;%0Aimport java.net.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.lang.*;%0Aimport java.lang.management.*;%0Aimport java.util.StringTokenizer;%0Aimport java.util.logging.FileHandler;%0Aimport java.util.logging.Level;%0Aimport java.util.logging.Logger;%0A%0Aimport org.apache.hadoop.io.Text;%0Aimport org.apache.hadoop.io.IntWritable;%0Aimport org.apache.hadoop.mapreduce.*;%0Aimport org.apache.hadoop.mapreduce.Mapper.Context;%0Aimport org.aspectj.lang.annotation.Aspect;%0Aimport org.aspectj.lang.annotation.Pointcut;%0Aimport org.aspectj.lang.annotation.After;%0Aimport org.aspectj.lang.annotation.Before;%0Aimport org.aspectj.lang.JoinPoint;%0Aimport org.aspectj.lang.Signature;%0A%0Aimport aj.hadoop.monitor.util.PickerClient;%0A%0A@Aspect%0Apublic class WordCountMonitor %7B%0A%0A%09private String HOST = %22127.0.0.1%22;%0A%09private int PORT = 55000;%0A%0A%09/** log file */%0A%09public static final String LOGFILE = %22Hanoi-MethodTraceMonitor.log%22;%0A%0A%09/**%0A%09 * pointcut%0A%09 * @param word%0A%09 * @param one%0A%09 */%0A%09@Pointcut (%22call(void org.apache.hadoop.mapreduce.Mapper.Context.write%22 +%0A%09%09%09%22(%22 +%0A%09%09%09%22java.lang.Object, %22 +%0A%09%09%09%22java.lang.Object%22 +%0A%09%09%09%22))%22 +%0A%09%09%09%22&& cflow(execution(public void org.apache.hadoop.examples.WordCount$TokenizerMapper.map(..)))%22 +%0A%09%09%09%22&& args(word, one)%22)%0A%09public void catch_map_method(Object word, Object one)%7B%7D%0A%0A%09@Before ( value = %22catch_map_method( key, one )%22)%0A%09public void logging_current_method( JoinPoint thisJoinPoint,%0A%09%09%09Object key,%0A%09%09%09Object one) %7B%0A%0A%09%09try %7B %0A%09%09%09PickerClient client = new PickerClient();%0A%09%09%09client.send(key);%0A%09%09%09client.socketClose();%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%7D%0A

add WordCountMonitor