Skip to content

Commit db306bf

Browse files
committed
GH-1517: ConsumerSeekCallback Javadoc Polishing
Resolves #1517 GH-1517: More Javadoc Polishing Unsaved local changes.
1 parent d5e69e0 commit db306bf

File tree

1 file changed

+53
-14
lines changed

1 file changed

+53
-14
lines changed

spring-kafka/src/main/java/org/springframework/kafka/listener/ConsumerSeekAware.java

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,25 @@ default void onIdleContainer(Map<TopicPartition, Long> assignments, ConsumerSeek
7878
interface ConsumerSeekCallback {
7979

8080
/**
81-
* Queue a seek operation to the consumer. The seek will occur after any pending
82-
* offset commits. The consumer must be currently assigned the specified partition.
81+
* Perform a seek operation. When called from
82+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
83+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
84+
* perform the seek immediately on the consumer. When called from elsewhere,
85+
* queue the seek operation to the consumer. The queued seek will occur after any
86+
* pending offset commits. The consumer must be currently assigned the specified
87+
* partition.
8388
* @param topic the topic.
8489
* @param partition the partition.
8590
* @param offset the offset (absolute).
8691
*/
8792
void seek(String topic, int partition, long offset);
8893

8994
/**
90-
* Queue a seekToBeginning operation to the consumer. The seek will occur after
95+
* Perform a seek to beginning operation. When called from
96+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
97+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
98+
* perform the seek immediately on the consumer. When called from elsewhere, queue
99+
* the seek operation to the consumer. The queued seek will occur after
91100
* any pending offset commits. The consumer must be currently assigned the
92101
* specified partition.
93102
* @param topic the topic.
@@ -96,7 +105,11 @@ interface ConsumerSeekCallback {
96105
void seekToBeginning(String topic, int partition);
97106

98107
/**
99-
* Queue a seekToBeginning operation to the consumer for each
108+
* Perform a seek to beginning operation. When called from
109+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
110+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
111+
* perform the seek immediately on the consumer. When called from elsewhere,
112+
* queue the seek operation to the consumer for each
100113
* {@link TopicPartition}. The seek will occur after any pending offset commits.
101114
* The consumer must be currently assigned the specified partition(s).
102115
* @param partitions the {@link TopicPartition}s.
@@ -107,16 +120,25 @@ default void seekToBeginning(Collection<TopicPartition> partitions) {
107120
}
108121

109122
/**
110-
* Queue a seekToEnd operation to the consumer. The seek will occur after any pending
111-
* offset commits. The consumer must be currently assigned the specified partition.
123+
* Perform a seek to end operation. When called from
124+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
125+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
126+
* perform the seek immediately on the consumer. When called from elsewhere, queue
127+
* the seek operation to the consumer. The queued seek will occur after any
128+
* pending offset commits. The consumer must be currently assigned the specified
129+
* partition.
112130
* @param topic the topic.
113131
* @param partition the partition.
114132
*/
115133
void seekToEnd(String topic, int partition);
116134

117135
/**
118-
* Queue a seekToEnd operation to the consumer for each {@link TopicPartition}.
119-
* The seek will occur after any pending offset commits. The consumer must be
136+
* Perform a seek to end operation. When called from
137+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
138+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
139+
* perform the seek immediately on the consumer. When called from elsewhere, queue
140+
* the seek operation to the consumer for each {@link TopicPartition}. The queued
141+
* seek(s) will occur after any pending offset commits. The consumer must be
120142
* currently assigned the specified partition(s).
121143
* @param partitions the {@link TopicPartition}s.
122144
* @since 2.3.4
@@ -126,20 +148,31 @@ default void seekToEnd(Collection<TopicPartition> partitions) {
126148
}
127149

128150
/**
129-
* Queue a seek to a position relative to the start or end of the current position.
151+
* Perform a seek relative to the start, end, or current position. When called
152+
* from {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)}
153+
* or from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
154+
* perform the seek immediately on the consumer. When called from elsewhere, queue
155+
* the seek operation. The queued seek will occur after any pending offset
156+
* commits. The consumer must be currently assigned the specified partition.
130157
* @param topic the topic.
131158
* @param partition the partition.
132159
* @param offset the offset; positive values are relative to the start, negative
133160
* values are relative to the end, unless toCurrent is true.
134-
* @param toCurrent true for the offset to be relative to the current position rather
135-
* than the beginning or end.
161+
* @param toCurrent true for the offset to be relative to the current position
162+
* rather than the beginning or end.
136163
* @since 2.3
137164
*/
138165
void seekRelative(String topic, int partition, long offset, boolean toCurrent);
139166

140167
/**
141-
* Seek to the first offset greater than or equal to the time stamp.
142-
* Use {@link #seekToTimestamp(Collection, long)} when seeking multiple partitions
168+
* Perform a seek to the first offset greater than or equal to the time stamp.
169+
* When called from
170+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
171+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
172+
* perform the seek immediately on the consumer. When called from elsewhere, queue
173+
* the seek operation. The queued seek will occur after any pending offset
174+
* commits. The consumer must be currently assigned the specified partition. Use
175+
* {@link #seekToTimestamp(Collection, long)} when seeking multiple partitions
143176
* because the offset lookup is blocking.
144177
* @param topic the topic.
145178
* @param partition the partition.
@@ -150,7 +183,13 @@ default void seekToEnd(Collection<TopicPartition> partitions) {
150183
void seekToTimestamp(String topic, int partition, long timestamp);
151184

152185
/**
153-
* Seek to the first offset greater than or equal to the time stamp.
186+
* Perform a seek to the first offset greater than or equal to the time stamp.
187+
* When called from
188+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
189+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
190+
* perform the seek immediately on the consumer. When called from elsewhere, queue
191+
* the seek operation. The queued seek will occur after any pending offset
192+
* commits. The consumer must be currently assigned the specified partition.
154193
* @param topicPartitions the topic/partitions.
155194
* @param timestamp the time stamp.
156195
* @since 2.3

0 commit comments

Comments
 (0)