-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-3543] Write TaskContext in Java and expose it through a static accessor. #2425
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
Conversation
} | ||
|
||
|
||
private static ThreadLocal<TaskContext> taskContext = |
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.
u don't need to wrap this, do u?
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.
You mean text wrap ?, yes in one line they are 114 chars.
QA tests have started for PR 2425 at commit
|
List<TaskCompletionListener> revlist = | ||
new ArrayList<TaskCompletionListener>(onCompleteCallbacks); | ||
Collections.reverse(revlist); | ||
for (TaskCompletionListener tcl : revlist){ |
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.
space before {
@rxin One side question, Java8ApiSuite(s) don't compile, looks like we have been overlooking them for a while. May be we could just remove them ? |
QA tests have started for PR 2425 at commit
|
QA tests have finished for PR 2425 at commit
|
QA tests have started for PR 2425 at commit
|
QA tests have finished for PR 2425 at commit
|
QA tests have finished for PR 2425 at commit
|
interrupted = true; | ||
} | ||
|
||
public Integer stageId() { |
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.
int? why box?
QA tests have started for PR 2425 at commit
|
QA tests have finished for PR 2425 at commit
|
@@ -45,7 +45,8 @@ import org.apache.spark.util.Utils | |||
private[spark] abstract class Task[T](val stageId: Int, var partitionId: Int) extends Serializable { | |||
|
|||
final def run(attemptId: Long): T = { | |||
context = new TaskContext(stageId, partitionId, attemptId, runningLocally = false) | |||
context = new TaskContext(stageId, partitionId, attemptId, false) |
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.
any reason to drop the naming for runningLocally
? the correct style is to name all optional paremeters.
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 the parameter is defined in java it cannot be named
@ScrapCodes made another pass with some comments. Overall this is looking good |
@ScrapCodes will you have time to address the feedback? |
QA tests have started for PR 2425 at commit
|
QA tests have finished for PR 2425 at commit
|
Test FAILed. |
155bc3b
to
5f8555b
Compare
QA tests have started for PR 2425 at commit
|
QA tests have finished for PR 2425 at commit
|
Test FAILed. |
5f8555b
to
8ae414c
Compare
QA tests have started for PR 2425 at commit
|
QA tests have finished for PR 2425 at commit
|
Test PASSed. |
Ok I'm merging this. I will push some minor cleanups after merging. |
* @param taskMetrics performance metrics of the task | ||
*/ | ||
@DeveloperApi | ||
public TaskContext(Integer stageId, Integer partitionId, Long attemptId, Boolean runningLocally, |
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.
fyi all these should be primitives rather than boxed Integers/Longs/Booleans. I'm going to fix it in a separate pr.
This addresses some minor issues in #2425 Author: Reynold Xin <rxin@apache.org> Closes #2557 from rxin/TaskContext and squashes the following commits: a51e5f6 [Reynold Xin] [SPARK-3543] Clean up Java TaskContext implementation.
No description provided.