Skip to content

[SPARK-22914][DEPLOY] Register history.ui.port #20098

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

Conversation

gerashegalov
Copy link
Contributor

@gerashegalov gerashegalov commented Dec 27, 2017

What changes were proposed in this pull request?

Register spark.history.ui.port as a known spark conf to be used in substitution expressions even if it's not set explicitly.

How was this patch tested?

Added unit test to demonstrate the issue

@srowen
Copy link
Member

srowen commented Dec 28, 2017

CC @vanzin

Copy link
Contributor

@vanzin vanzin left a comment

Choose a reason for hiding this comment

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

Idea sounds ok, although it requires the client configuration to also contain history server configuration to properly work, which may not be the case in the most common case.

It needs to be rebased, though.

@@ -836,6 +833,20 @@ object ApplicationMaster extends Logging {

}

object ApplicationMasterUtil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just add this to the ApplicationMaster object instead of creating yet another utils object... and also add private[spark] to the method there.

import org.scalatest.Matchers

class ApplicationMasterUtilSuite extends SparkFunSuite with Matchers with Logging
with ResetSystemProperties {
Copy link
Contributor

Choose a reason for hiding this comment

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

ResetSystemProperties not needed since you're not changing system properties.

import org.apache.spark.util.ResetSystemProperties
import org.scalatest.Matchers

class ApplicationMasterUtilSuite extends SparkFunSuite with Matchers with Logging
Copy link
Contributor

Choose a reason for hiding this comment

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

Logging not needed, you're not logging anything.

val shsAddr = ApplicationMasterUtil
.getHistoryServerAddress(sparkConf, yarnConf, appId, attemptId)

shsAddr shouldEqual "http://rm.host.com:18080/history/application_123_1/application_123_1_1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Use assert(foo === bar) (and then you also don't need Matchers).

Also, better to use interpolation to check. e.g. foo === s"http://$host:$post/history/$appId/$attemptId". You can set the history port in SparkConf to avoid having to read the default value in some other way.


package org.apache.spark.deploy.yarn

import org.apache.hadoop.yarn.conf.YarnConfiguration
Copy link
Contributor

Choose a reason for hiding this comment

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

These imports will fail style checks. Make sure to run them locally.

@@ -836,6 +833,20 @@ object ApplicationMaster extends Logging {

}

object ApplicationMasterUtil {
def getHistoryServerAddress(
sparkConf: SparkConf,
Copy link
Contributor

Choose a reason for hiding this comment

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

Multi-line parameter lists are double-indented.

@gerashegalov gerashegalov force-pushed the gera/register-SHS-port-conf branch from 04fa7fd to 03e0e27 Compare January 4, 2018 23:38
@gerashegalov
Copy link
Contributor Author

Thanks @vanzin for review. Please take a look again

@vanzin
Copy link
Contributor

vanzin commented Jan 4, 2018

ok to test

@SparkQA
Copy link

SparkQA commented Jan 5, 2018

Test build #85705 has finished for PR 20098 at commit 03e0e27.

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

@vanzin
Copy link
Contributor

vanzin commented Jan 6, 2018

Merging to master / 2.3.

@asfgit asfgit closed this in ea95683 Jan 6, 2018
asfgit pushed a commit that referenced this pull request Jan 6, 2018
## What changes were proposed in this pull request?

Register spark.history.ui.port as a known spark conf to be used in substitution expressions even if it's not set explicitly.

## How was this patch tested?

Added unit test to demonstrate the issue

Author: Gera Shegalov <gera@apache.org>
Author: Gera Shegalov <gshegalov@salesforce.com>

Closes #20098 from gerashegalov/gera/register-SHS-port-conf.

(cherry picked from commit ea95683)
Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
@gerashegalov gerashegalov deleted the gera/register-SHS-port-conf branch January 6, 2018 10:54
@gerashegalov
Copy link
Contributor Author

Thank you for review and commit @vanzin !

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