github-advanced-security[bot] commented on code in PR #16190:
URL: https://github.com/apache/druid/pull/16190#discussion_r1548924208
##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/KafkaDataSourceMetadataTest.java:
##########
@@ -203,19 +462,60 @@
}
private static KafkaDataSourceMetadata startMetadata(Map<Integer, Long>
offsets)
+ {
+ return startMetadata("foo", offsets);
+ }
+
+ private static KafkaDataSourceMetadata startMetadata(
+ String topic,
+ Map<Integer, Long> offsets
+ )
{
Map<KafkaTopicPartition, Long> newOffsets = CollectionUtils.mapKeys(
offsets,
k -> new KafkaTopicPartition(
false,
- "foo",
+ topic,
k
)
);
- return new KafkaDataSourceMetadata(new
SeekableStreamStartSequenceNumbers<>("foo", newOffsets, ImmutableSet.of()));
+ return new KafkaDataSourceMetadata(new
SeekableStreamStartSequenceNumbers<>(topic, newOffsets, ImmutableSet.of()));
}
+ private static KafkaDataSourceMetadata startMetadataMultiTopic(
+ String topicPattern,
+ List<String> topics,
+ Map<Integer, Long> offsets
+ )
+ {
+ Assert.assertFalse(topics.isEmpty());
+ Pattern pattern = Pattern.compile(topicPattern);
+ Assert.assertTrue(topics.stream().allMatch(t ->
pattern.matcher(t).matches()));
+ int i = 0;
Review Comment:
## Unread local variable
Variable 'int i' is never read.
[Show more
details](https://github.com/apache/druid/security/code-scanning/7206)
##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/KafkaDataSourceMetadataTest.java:
##########
@@ -225,7 +525,34 @@
k
)
);
- return new KafkaDataSourceMetadata(new
SeekableStreamEndSequenceNumbers<>("foo", newOffsets));
+ return new KafkaDataSourceMetadata(new
SeekableStreamEndSequenceNumbers<>(topic, newOffsets));
+ }
+
+ private static KafkaDataSourceMetadata endMetadataMultiTopic(
+ String topicPattern,
+ List<String> topics,
+ Map<Integer, Long> offsets
+ )
+ {
+ Assert.assertFalse(topics.isEmpty());
+ Pattern pattern = Pattern.compile(topicPattern);
+ Assert.assertTrue(topics.stream().allMatch(t ->
pattern.matcher(t).matches()));
+ int i = 0;
Review Comment:
## Unread local variable
Variable 'int i' is never read.
[Show more
details](https://github.com/apache/druid/security/code-scanning/7207)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]