Skip to content
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

[Spark-22952][CORE] Deprecate stageAttemptId in favour of stageAttemptNumber #20178

Closed
wants to merge 2 commits into from

Conversation

advancedxy
Copy link
Contributor

What changes were proposed in this pull request?

  1. Deprecate attemptId in StageInfo and add def attemptNumber() = attemptId
  2. Replace usage of stageAttemptId with stageAttemptNumber

How was this patch tested?

I manually checked the compiler warning info

@advancedxy
Copy link
Contributor Author

cc @cloud-fan @zsxwing and @squito

I only included the changes related to StageInfo's deprecated getter. It would involve too much changes if we want to replace attemptId with attemptNumber everywhere, which I think we should do that until we are targeting Spark 3.0.

I even think some of the changes in this patch may not be applied as mixed attemptId and attemptNumber appears in the same context.

@advancedxy
Copy link
Contributor Author

Please add me to whitelist...

@cloud-fan
Copy link
Contributor

cloud-fan commented Jan 8, 2018

add to whitelist

@cloud-fan
Copy link
Contributor

ok to test

@@ -56,6 +56,8 @@ class StageInfo(
completionTime = Some(System.currentTimeMillis)
}

def attemptNumber(): Int = attemptId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about

class StageInfo(
    ...
    val attempNumber: Int,
   ...  {
  @deprecated
  def attempId: Int = attemptNumber
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go this way, I believe it would break source compatibility for Developer API.

Code like new StageInfo(stageId = xx, attemptId = yy, ...) couldn't by compiled any more.

Not sure about binary compatibility

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah i see, let's keep it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, can we add a new constructor for attemptId?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmmm, maybe.. Let me try it out after work...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we do not fully deprecate it, it's still attemptId in json. Shall we fix the json too? We may need to add some logic at the parser side to recognize attemptId

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, keep it this way or add a constructor and fix Json parser?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to add a constructor and fix the json parser, otherwise we are not fully deprecating it. But let's do it in a new PR, as it may need quite a lot of changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I was wrong. It seems the rest api doesn't use this class. It's using org.apache.spark.status.api.v1.StageData. However, it's also called attemptId in this class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But let's do it in a new PR, as it may need quite a lot of changes.

Lets's do that after Spark 2.3 release then?

However, it's also called attemptId in this class.

Yeah, (stage)attemptId is over a lot of places...

@SparkQA
Copy link

SparkQA commented Jan 8, 2018

Test build #85785 has finished for PR 20178 at commit 2ec9197.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

thanks, merging to master/2.3!

asfgit pushed a commit that referenced this pull request Jan 8, 2018
…tNumber

## What changes were proposed in this pull request?
1.  Deprecate attemptId in StageInfo and add `def attemptNumber() = attemptId`
2. Replace usage of stageAttemptId with stageAttemptNumber

## How was this patch tested?
I manually checked the compiler warning info

Author: Xianjin YE <[email protected]>

Closes #20178 from advancedxy/SPARK-22952.

(cherry picked from commit 40b983c)
Signed-off-by: Wenchen Fan <[email protected]>
@asfgit asfgit closed this in 40b983c Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants