MAPREDUCE-2093. Herriot JT and TT clients should vend statistics. Contributed by Konstantin Boudnik.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/mapreduce/trunk@1034091 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/.gitignore b/.gitignore
index addaeb1..0a0c9b6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,7 @@
 .settings
 .svn
 build/
+build-fi/
 build.properties
 conf/masters
 conf/slaves
diff --git a/CHANGES.txt b/CHANGES.txt
index a28d4d7..dfcdf67 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -166,6 +166,8 @@
     MAPREDUCE-2073. TestTrackerDistributedCacheManager should be up-front
     about requirements on build environment. (Todd Lipcon via tomwhite)
 
+    MAPREDUCE-2093. Herriot JT and TT clients should vend statistics. (cos)
+
   OPTIMIZATIONS
 
     MAPREDUCE-1354. Enhancements to JobTracker for better performance and
diff --git a/src/test/system/java/org/apache/hadoop/mapreduce/test/system/JTClient.java b/src/test/system/java/org/apache/hadoop/mapreduce/test/system/JTClient.java
index d744cdc..8c9146c 100644
--- a/src/test/system/java/org/apache/hadoop/mapreduce/test/system/JTClient.java
+++ b/src/test/system/java/org/apache/hadoop/mapreduce/test/system/JTClient.java
@@ -45,6 +45,7 @@
 public class JTClient extends MRDaemonClient<JTProtocol> {
   static final Log LOG = LogFactory.getLog(JTClient.class);
   private JobClient client;
+  private static final String HADOOP_JT_OPTS_ENV = "HADOOP_JOBTRACKER_OPTS";
 
   /**
    * Create JobTracker client to talk to {@link JobTracker} specified in the
@@ -327,4 +328,21 @@
     }
     LOG.info("Verified the job history for the jobId : " + jobId);
   }
+
+  @Override
+  public String getHadoopOptsEnvName() {
+    return HADOOP_JT_OPTS_ENV;
+  }
+
+  /**
+   * Concrete implementation of abstract super class method
+   *
+   * @param attributeName name of the attribute to be retrieved
+   * @return Object value of the given attribute
+   * @throws IOException is thrown in case of communication errors
+   */
+  @Override
+  public Object getDaemonAttribute(String attributeName) throws IOException {
+    return getJmxAttribute("JobTracker", "JobTrackerInfo", attributeName);
+  }
 }
diff --git a/src/test/system/java/org/apache/hadoop/mapreduce/test/system/TTClient.java b/src/test/system/java/org/apache/hadoop/mapreduce/test/system/TTClient.java
index 35ce0fe..5303309 100644
--- a/src/test/system/java/org/apache/hadoop/mapreduce/test/system/TTClient.java
+++ b/src/test/system/java/org/apache/hadoop/mapreduce/test/system/TTClient.java
@@ -39,6 +39,7 @@
 
   TTProtocol proxy;
   private static final String SYSTEM_TEST_FILE = "system-test.xml";
+  private static final String HADOOP_TT_OPTS_ENV = "HADOOP_TASKTRACKER_OPTS";
 
   public TTClient(Configuration conf, RemoteProcess daemon) 
       throws IOException {
@@ -89,4 +90,20 @@
     return getProxy().getStatus();
   }
 
+  @Override
+  public String getHadoopOptsEnvName() {
+    return HADOOP_TT_OPTS_ENV;
+  }
+
+  /**
+   * Concrete implementation of abstract super class method
+   *
+   * @param attributeName name of the attribute to be retrieved
+   * @return Object value of the given attribute
+   * @throws IOException is thrown in case of communication errors
+   */
+  @Override
+  public Object getDaemonAttribute(String attributeName) throws IOException {
+    return getJmxAttribute("TaskTracker", "TaskTrackerInfo", attributeName);
+  }
 }