Skip to content

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

ConfigBuilder builds ConfigEntry which can only read value with one key, if we wanna change the config name but still keep the old one, it's hard to do.

This PR introduce ConfigBuilder.withAlternative, to support reading config value with alternative keys. And also rename spark.scheduler.listenerbus.eventqueue.size to spark.scheduler.listenerbus.eventqueue.capacity with this feature, according to #14269 (comment)

How was this patch tested?

a new test

@cloud-fan
Copy link
Contributor Author

cc @JoshRosen @dhruve

@JoshRosen
Copy link
Contributor

JoshRosen commented May 25, 2017 via email

@cloud-fan
Copy link
Contributor Author

@JoshRosen actually there are more use cases. Currently we have 2 ways to define a config: create a config entry in the config package object, or SQLConf object, and read conf value with the config entry in code. Or read conf value with hard-coded conf name directly in the code. Ideally we should always create config entry, but we can't because it doesn't support alternative keys.

@JoshRosen
Copy link
Contributor

@cloud-fan
Copy link
Contributor Author

It's only used in the SparkCong.get(key: String) code path, not SparkConf.get(entry: ConfigEntry[T]) code path. That's why we only support alternative keys if users get conf value by hard-coded conf name.

@JoshRosen
Copy link
Contributor

Ahhh, makes sense. Thanks for the clarification.

@SparkQA
Copy link

SparkQA commented May 25, 2017

Test build #77372 has finished for PR 18110 at commit cc51dd0.

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

Copy link
Contributor

@jiangxb1987 jiangxb1987 left a comment

Choose a reason for hiding this comment

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

LGTM only have a nit.

}
}

private def getOrDefault(conf: ConfigProvider, key: String): Option[String] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: add comment for this method.

@SparkQA
Copy link

SparkQA commented May 26, 2017

Test build #77398 has finished for PR 18110 at commit 3f9d202.

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

@jiangxb1987
Copy link
Contributor

retest please

@SparkQA
Copy link

SparkQA commented May 26, 2017

Test build #77411 has started for PR 18110 at commit a637e95.

@cloud-fan
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented May 26, 2017

Test build #77417 has finished for PR 18110 at commit a637e95.

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

@cloud-fan
Copy link
Contributor Author

thanks for the review, merging to master!

@asfgit asfgit closed this in 629f38e May 26, 2017
turboFei added a commit to apache/kyuubi that referenced this pull request Oct 18, 2022
### _Why are the changes needed?_

Refer Spark PR: apache/spark#18110
ConfigBuilder builds ConfigEntry which can only read value with one key, if we wanna change the config name but still keep the old one, it's hard to do.

This PR introduce ConfigBuilder.withAlternative, to support reading config value with alternative keys.

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #3659 from turboFei/conf_alternative.

Closes #3659

e268fef [Fei Wang] add ut
a2300b2 [Fei Wang] add ut
53eccf9 [Fei Wang] Support alternative keys in ConfigBuilder

Authored-by: Fei Wang <[email protected]>
Signed-off-by: Fei Wang <[email protected]>
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