You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org> on 2025/09/02 07:21:55 UTC
Re: [PR] Add builders for Kafka supervisor spec, ioConfig, tuningConfig (druid)
github-advanced-security[bot] commented on code in PR #18460:
URL: https://github.com/apache/druid/pull/18460#discussion_r2315157517
##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/KafkaSamplerSpecTest.java:
##########
@@ -357,59 +256,24 @@
);
InputRowParser parser = new StringInputRowParser(new JSONParseSpec(timestampSpec, dimensionsSpec, JSONPathSpec.DEFAULT, null, null), "UTF8");
- DataSchema dataSchema = DataSchema.builder()
- .withDataSource("test_ds")
- .withParserMap(
- objectMapper.readValue(objectMapper.writeValueAsBytes(parser), Map.class)
- )
- .withAggregators(
- new DoubleSumAggregatorFactory("met1sum", "met1"),
- new CountAggregatorFactory("rows")
- )
- .withGranularity(new UniformGranularitySpec(Granularities.DAY, Granularities.NONE, null))
- .withObjectMapper(objectMapper)
- .build();
-
- KafkaSupervisorSpec supervisorSpec = new KafkaSupervisorSpec(
- null,
- null,
- dataSchema,
- null,
- new KafkaSupervisorIOConfig(
- TOPIC,
- null,
- null,
- null,
- null,
- null,
- kafkaServer.consumerProperties(),
- null,
- null,
- null,
- null,
- null,
- true,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- false
- ),
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null
- );
+ Consumer<DataSchema.Builder> dataSchema =
+ builder -> builder.withDataSource("test_ds")
+ .withParserMap(objectMapper.convertValue(parser, Map.class))
+ .withAggregators(
+ new DoubleSumAggregatorFactory("met1sum", "met1"),
+ new CountAggregatorFactory("rows")
+ )
+ .withGranularity(new UniformGranularitySpec(Granularities.DAY, Granularities.NONE, null))
+ .withObjectMapper(objectMapper);
Review Comment:
## Deprecated method or constructor invocation
Invoking [Builder.withObjectMapper](1) should be avoided because it has been deprecated.
[Show more details](https://github.com/apache/druid/security/code-scanning/10264)
##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/KafkaSamplerSpecTest.java:
##########
@@ -357,59 +256,24 @@
);
InputRowParser parser = new StringInputRowParser(new JSONParseSpec(timestampSpec, dimensionsSpec, JSONPathSpec.DEFAULT, null, null), "UTF8");
- DataSchema dataSchema = DataSchema.builder()
- .withDataSource("test_ds")
- .withParserMap(
- objectMapper.readValue(objectMapper.writeValueAsBytes(parser), Map.class)
- )
- .withAggregators(
- new DoubleSumAggregatorFactory("met1sum", "met1"),
- new CountAggregatorFactory("rows")
- )
- .withGranularity(new UniformGranularitySpec(Granularities.DAY, Granularities.NONE, null))
- .withObjectMapper(objectMapper)
- .build();
-
- KafkaSupervisorSpec supervisorSpec = new KafkaSupervisorSpec(
- null,
- null,
- dataSchema,
- null,
- new KafkaSupervisorIOConfig(
- TOPIC,
- null,
- null,
- null,
- null,
- null,
- kafkaServer.consumerProperties(),
- null,
- null,
- null,
- null,
- null,
- true,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- false
- ),
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null
- );
+ Consumer<DataSchema.Builder> dataSchema =
+ builder -> builder.withDataSource("test_ds")
+ .withParserMap(objectMapper.convertValue(parser, Map.class))
Review Comment:
## Deprecated method or constructor invocation
Invoking [Builder.withParserMap](1) should be avoided because it has been deprecated.
[Show more details](https://github.com/apache/druid/security/code-scanning/10265)
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org