Skip to content

[SPARK-4005][CORE] handle message replies in receive instead of in the individual private methods #2853

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

Closed
wants to merge 4 commits into from

Conversation

liyezhang556520
Copy link
Contributor

In BlockManagermasterActor, when handling message type UpdateBlockInfo, the message replies is in handled in individual private methods, should handle it in receive of Akka.

@SparkQA
Copy link

SparkQA commented Oct 20, 2014

QA tests have started for PR 2853 at commit d4b929b.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Oct 20, 2014

QA tests have finished for PR 2853 at commit d4b929b.

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

if (!blockManagerInfo.contains(blockManagerId)) {
if (blockManagerId.isDriver && !isLocal) {
// We intentionally do not register the master (except in local mode),
// so we should not indicate failure.
sender ! true
// do nothing here, "updated == true".
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just return true here, and return false in the other branch so that we can eliminate the mutable updated variable?

@JoshRosen
Copy link
Contributor

Just noticed this old PR while trying to clear the PR review backlog. This seems like a good change and I left a couple of comments on how we could avoid introducing mutability. If you have a chance to update this, that would be great; otherwise, just comment to let me know if you don't have time to do it and I can take care of these fixes myself. Thanks!

@liyezhang556520
Copy link
Contributor Author

@JoshRosen , thank you for your comments, I'll update it soon.

@liyezhang556520
Copy link
Contributor Author

@JoshRosen , code updated according to your comments, can you have a look?

// individual private methods.
updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size, tachyonSize)
sender ! updateBlockInfo(
blockManagerId, blockId, storageLevel, deserializedSize, size, tachyonSize)
Copy link
Contributor

Choose a reason for hiding this comment

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

Super-minor nit, but could you change this line so that it's indented two spaces from the previous one instead of four?

@JoshRosen
Copy link
Contributor

LGTM; thanks! I'll merge this in a little bit.

@SparkQA
Copy link

SparkQA commented Dec 5, 2014

Test build #24155 has finished for PR 2853 at commit 242166b.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 5, 2014

Test build #24157 has finished for PR 2853 at commit bf518cd.

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

@JoshRosen
Copy link
Contributor

It occurred to me that we should probably document this method's return value.

}
return
return true
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I think you should just remove this line since it's unreachable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, remove the line will be the same logic with the original one.

@liyezhang556520
Copy link
Contributor Author

@JoshRosen , thanks for your detailed review.

@liyezhang556520
Copy link
Contributor Author

jenkins, retest this please

@JoshRosen
Copy link
Contributor

Jenkins, retest this please.

I think that this Jenkins failure was due to one of the machines' disks filling up; I've taken that machine offline while we investigate.

@SparkQA
Copy link

SparkQA commented Dec 5, 2014

Test build #541 has finished for PR 2853 at commit 9b06f0a.

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

@JoshRosen
Copy link
Contributor

LGTM. Since this is code-cleanup and not a bugfix, I'm only going to merge this into master (1.3.0). Thanks!

@asfgit asfgit closed this in 98a7d09 Dec 5, 2014
@liyezhang556520 liyezhang556520 deleted the akkaRecv branch August 26, 2015 01:27
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.

3 participants