-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TEZ-4527: Add generic and pluggable hooks for DAGs and task attempts #324
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
*/ | ||
@ConfigurationScope(Scope.DAG) | ||
@ConfigurationProperty | ||
public static final String TEZ_THREAD_DUMP_INTERVAL = "tez.thread.dump.interval"; | ||
public static final String TEZ_THREAD_DUMP_INTERVAL_DEFAULT = "0ms"; | ||
public static final String TEZ_THREAD_DUMP_INTERVAL_DEFAULT = "100ms"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we introduce pluggable hooks, I think we can change the default value. We may remove NOOP_TEZ_THREAD_DUMP_HELPER, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense
I think for package clarity's sake, all the hook related configs can go a namespace that implies they're hooks:
tez.hook.thread.dump.internal
also:
TEZ_HOOK_THREAD_DUMP_INTERVAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove the NoopTezThreadDumpHelper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was marked as outdated.
This comment was marked as outdated.
💔 -1 overall
This message was automatically generated. |
@@ -2207,7 +2210,9 @@ public Void run() throws Exception { | |||
} | |||
|
|||
// Check if the thread dump service is up in any case, if yes attempt a shutdown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove thread dump helper related comment, and change to a more generic one that tells we're about to stop hooks if they are running in any case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
943012a
@okumin : thanks for the patch, nice refactor, only minor comments, other than that, it looks good to me! |
e33316d
to
943012a
Compare
Thanks. I think all the points follow your suggestions. I rebased the branch as the original one was already obsolete |
🎊 +1 overall
This message was automatically generated. |
@@ -70,21 +71,17 @@ private TezThreadDumpHelper(long duration, Configuration conf) throws IOExceptio | |||
"path: {}", duration, basePath); | |||
} | |||
|
|||
public TezThreadDumpHelper() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, cannot recall what the purpose was of this constructor, does reflection work without this explicitly defined?
I'm afraid that as there is private parameterized constructor, class.newInstance() throws an InstantiationException, doesn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is originally needed to instantiate
tez/tez-runtime-internals/src/main/java/org/apache/tez/runtime/TezThreadDumpHelper.java
Lines 182 to 194 in ca15119
private static class NoopTezThreadDumpHelper extends TezThreadDumpHelper { | |
@Override | |
public TezThreadDumpHelper start(String name) { | |
// Do Nothing | |
return this; | |
} | |
@Override | |
public void stop() { | |
// Do Nothing | |
} | |
} |
I think the class is not constructed in a reflective way, or it doesn't assume it's reflectively operated. I slightly updated the modifiers to make sure it
61d8249
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I was wrong, the hooks are created by reflection, but the TezThreadDumpHelper is not
helper = TezThreadDumpHelper.getInstance(conf).start(id.toString());
*/ | ||
@ConfigurationScope(Scope.DAG) | ||
@ConfigurationProperty | ||
public static final String TEZ_THREAD_DUMP_INTERVAL = "tez.thread.dump.interval"; | ||
public static final String TEZ_THREAD_DUMP_INTERVAL_DEFAULT = "0ms"; | ||
public static final String TEZ_HOOK_THREAD_DUMP_INTERVAL = "tez.hook.thread.dump.interval"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@okumin : I'm terribly sorry, I just realized that changing this causes more problems than benefits (changing config opts from one release to another), the class name also doesn't have "hook" in it, so it's fine to have this as "tez.thread.dump.interval", are you fine with changing back? TEZ_THREAD_DUMP_INTERVAL was also fine from this point of view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np. I renamed them back
293ce63
thanks @okumin , this is very close, just left 2 comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM +1
🎊 +1 overall
This message was automatically generated. |
Thank you. This change is so helpful for us |
https://issues.apache.org/jira/browse/TEZ-4527