You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by GitBox <gi...@apache.org> on 2022/07/29 14:42:19 UTC
[GitHub] [incubator-uniffle] jerqi commented on pull request #104: [Improvement] Use ConfigBuilder to rewrite the class RssSparkConfig
jerqi commented on PR #104:
URL: https://github.com/apache/incubator-uniffle/pull/104#issuecomment-1199427843
We find that we can rewrite the method `converter` to create a ConfigEntry<Integer> instead of ConfigEntry<Object>.
The simple code is as below.
```
public static final scala.Function1<String, Integer> f =
x -> ConfigUtils.convertValue(x, Integer.class);
void test() {
ConfigBuilder builder = new ConfigBuilder(RSS_PARTITION_NUM_PER_RANGE);
TypedConfigBuilder tbuilder = new TypedConfigBuilder<Integer>(builder, f);
new SparkConf().get(tbuilder.createWithDefault(1));
// .createWithDefault(Integer.valueOf(1));
//new SparkConf().getInt(entry);
// SparkConf conf = new SparkConf();
// int x = conf.get(RSS_PARTITION_NUM_PER_RANGE_ENTRY)
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org