This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 265c5160ac6 KAFKA-17585 `offsetResetStrategyTimestamp` should return
`long` instead of `Long` (#17252)
265c5160ac6 is described below
commit 265c5160ac6742c01f59e2d4e259447dc1ffe87a
Author: xijiu <[email protected]>
AuthorDate: Wed Sep 25 01:17:43 2024 +0800
KAFKA-17585 `offsetResetStrategyTimestamp` should return `long` instead of
`Long` (#17252)
Reviewers: Chia-Ping Tsai <[email protected]>
---
.../apache/kafka/clients/consumer/internals/OffsetFetcherUtils.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git
a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcherUtils.java
b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcherUtils.java
index f504c57b4ae..89940087611 100644
---
a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcherUtils.java
+++
b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcherUtils.java
@@ -234,9 +234,7 @@ class OffsetFetcherUtils {
Set<TopicPartition> partitions =
subscriptionState.partitionsNeedingReset(time.milliseconds());
final Map<TopicPartition, Long> offsetResetTimestamps = new
HashMap<>();
for (final TopicPartition partition : partitions) {
- Long timestamp = offsetResetStrategyTimestamp(partition);
- if (timestamp != null)
- offsetResetTimestamps.put(partition, timestamp);
+ offsetResetTimestamps.put(partition,
offsetResetStrategyTimestamp(partition));
}
return offsetResetTimestamps;
@@ -286,7 +284,7 @@ class OffsetFetcherUtils {
return offsetsResults;
}
- private Long offsetResetStrategyTimestamp(final TopicPartition partition) {
+ private long offsetResetStrategyTimestamp(final TopicPartition partition) {
OffsetResetStrategy strategy =
subscriptionState.resetStrategy(partition);
if (strategy == OffsetResetStrategy.EARLIEST)
return ListOffsetsRequest.EARLIEST_TIMESTAMP;