Issue Details (XML | Word | Printable)

Key: HADOOP-3772
Type: Improvement Improvement
Status: Closed Closed
Resolution: Incomplete
Priority: Major Major
Assignee: Ari Rabkin
Reporter: Ari Rabkin
Votes: 1
Watchers: 7
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

Proposed hadoop instrumentation API

Created: 16/Jul/08 05:19 PM   Updated: 16/Sep/08 05:24 PM
Return to search
Component/s: metrics
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File instrumentation-2.patch 2008-07-18 06:09 PM Ari Rabkin 30 kB
Text File Licensed for inclusion in ASF works instrumentation-3.patch 2008-07-18 09:59 PM Ari Rabkin 33 kB
Text File Licensed for inclusion in ASF works instrumentation-4.patch 2008-07-28 05:01 PM Ari Rabkin 33 kB
Text File instrumentation.patch 2008-07-16 11:34 PM Ari Rabkin 9 kB
Text File Licensed for inclusion in ASF works tweak_inst.patch 2008-08-04 03:47 PM Ari Rabkin 0.6 kB
Issue Links:
Reference
 

Resolution Date: 07/Aug/08 05:27 PM


 Description  « Hide
We want to evolve the Hadoop metrics subsystem into a more generic Instrumentation facility. The ultimate goal is to add structured logging to Hadoop, with causal tags, a la X-trace. The existing metrics framework is not quite suitable for our needs, since the implementation and interface are tightly coupled. There's no way to use the metrics instrumentation points for anything other than metricss, and there's no way for a metrics context to find out what event just happened.

We want to tease apart the generic notion of hookable instrumentation points, from the specifics of the information recording. The latter ought to be pluggable at run-time.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Ari Rabkin added a comment - 16/Jul/08 05:20 PM
I think the right way to do this is to add several Instrumentation interfaces, such as JobInstrumentation, NameNodeInstrumentation, DNInstrumentation. These classes would have one method per instrumentation point; and all the metrics computation, causal logging, Chukwa integration, and so forth would be hidden in implementations. Much of Metrics, such as the visible methods of JobTrackerMetrics and much of the MetricsContextFactory, can be reused. Other parts can be encapsulated.

We'll probably start with TaskTrackerMetrics. We can then build an implementation of TaskTrackerInstrumentation that notifies Chukwa to pick up the task's stdout and stderr. This gives us the hooks to do log and console out harvesting for Chukwa, which lets us close HADOOP-2206, and probably HADOOP-1199.


Ari Rabkin added a comment - 16/Jul/08 11:34 PM
Here's a patch showing the sort of refactoring I was talking about.

Unfortunately, the surgery was more involved than I expected: I had forgotten that TaskTracker.TaskTrackerMetrics was an inner class, which had to change.


Doug Cutting added a comment - 17/Jul/08 07:33 PM
This looks like a reasonable approach. A few nits:

It would be cleaner if TaskTracker.Instrumentation were a standalone class. TaskTracker.java is already plenty big! Also, since it is public, this class needs javadoc. The 'tt' field should be private w/ accessor methods or set by the constructor. Should it be abstract? The reference to 'tt.mapTotal' should be replaced with a call to a public method, etc.

Static accessor methods should be added to TaskTracker to get/set the instrumentation impl, e.g.:

public static void setInstrumentation(Configuration conf, Class clazz) { ... }
public Class getInstrumentation(Configuration conf) { ... }

These should refer to a constant that names the configuration parameter name. These methods should be used in preference to using the paramter name literal. An entry should be added to hadoop-default.xml, documenting this new configuration option.


Ari Rabkin added a comment - 18/Jul/08 04:29 PM
Corrects nits identified by Doug.

Note – no test cases included, since it's basically a refactoring, and not a new feature.


Ari Rabkin added a comment - 18/Jul/08 06:09 PM
add JobTracker instrumentation, document options in hadoop-default.xml

Hadoop QA added a comment - 18/Jul/08 09:05 PM
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12386422/instrumentation-2.patch
against trunk revision 677872.

+1 @author. The patch does not contain any @author tags.

-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.

+1 javadoc. The javadoc tool did not generate any warning messages.

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

-1 findbugs. The patch appears to introduce 1 new Findbugs warnings.

-1 release audit. The applied patch generated 213 release audit warnings (more than the trunk's current 209 warnings).

+1 core tests. The patch passed core unit tests.

+1 contrib tests. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2904/testReport/
Release audit warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2904/artifact/trunk/current/releaseAuditDiffWarnings.txt
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2904/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2904/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2904/console

This message is automatically generated.


Ari Rabkin added a comment - 18/Jul/08 09:59 PM
this time, with Apache license at the top.

Ari Rabkin added a comment - 18/Jul/08 09:59 PM
fixed findbugs, release warnings.

Hadoop QA added a comment - 19/Jul/08 05:43 AM
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12386436/instrumentation-3.patch
against trunk revision 678080.

+1 @author. The patch does not contain any @author tags.

-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.

+1 javadoc. The javadoc tool did not generate any warning messages.

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

+1 findbugs. The patch does not introduce any new Findbugs warnings.

+1 release audit. The applied patch does not increase the total number of release audit warnings.

+1 core tests. The patch passed core unit tests.

+1 contrib tests. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2909/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2909/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2909/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2909/console

This message is automatically generated.


Ari Rabkin added a comment - 21/Jul/08 05:57 PM
As mentioned above – no test cases included, since this is a refactoring, with no functional changes.

Ari Rabkin added a comment - 28/Jul/08 05:01 PM
patch was broken by a hadoop update; about to fix.

Ari Rabkin added a comment - 28/Jul/08 05:01 PM
revised to match Hadoop trunk

Hadoop QA added a comment - 28/Jul/08 07:37 PM
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12387040/instrumentation-4.patch
against trunk revision 679930.

+1 @author. The patch does not contain any @author tags.

-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.

+1 javadoc. The javadoc tool did not generate any warning messages.

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

+1 findbugs. The patch does not introduce any new Findbugs warnings.

+1 release audit. The applied patch does not increase the total number of release audit warnings.

+1 core tests. The patch passed core unit tests.

+1 contrib tests. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2961/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2961/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2961/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2961/console

This message is automatically generated.


Doug Cutting added a comment - 01/Aug/08 10:01 PM
+1 This looks good to me.

Arun C Murthy added a comment - 01/Aug/08 10:58 PM
I just committed this. Thanks, Ari!

Vinod K V added a comment - 04/Aug/08 01:06 PM
Seems like errors crept into hadoop-default.xml:

<property>
<name>mapred.job.instrumentation</name>
<value>org.apache.hadoop.mapred.JobTrackerMetricsInst</value>
<description>Expert: The instrumentation class to associate with each TaskTracker.
</description>
</property>

The property name should be mapred.jobtracker.instrumentation. Also, the description above should be "[...] class to associate with the JobTracker."


Ari Rabkin added a comment - 04/Aug/08 03:46 PM
Whups, conf file part of patch was slightly wrong

Ari Rabkin added a comment - 04/Aug/08 03:47 PM
Fix conf file mishap. Good catch, Vinod!

Ari Rabkin added a comment - 04/Aug/08 03:48 PM
Fixes mistake in conf file. No alteration to code, no functional change, no tests.

Hadoop QA added a comment - 06/Aug/08 07:40 AM
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12387481/tweak_inst.patch
against trunk revision 682978.

+1 @author. The patch does not contain any @author tags.

-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.

+1 javadoc. The javadoc tool did not generate any warning messages.

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

+1 findbugs. The patch does not introduce any new Findbugs warnings.

+1 release audit. The applied patch does not increase the total number of release audit warnings.

+1 core tests. The patch passed core unit tests.

+1 contrib tests. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3011/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3011/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3011/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3011/console

This message is automatically generated.


Hudson added a comment - 22/Aug/08 12:34 PM