Skip to content

Commit b241fec

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

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
@@ -87,16 +87,25 @@ default void unregisterSeekCallback() {
8787
interface ConsumerSeekCallback {
8888

8989
/**
90-
* Queue a seek operation to the consumer. The seek will occur after any pending
91-
* offset commits. The consumer must be currently assigned the specified partition.
90+
* Perform a seek operation. When called from
91+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
92+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
93+
* perform the seek immediately on the consumer. When called from elsewhere,
94+
* queue the seek operation to the consumer. The queued seek will occur after any
95+
* pending offset commits. The consumer must be currently assigned the specified
96+
* partition.
9297
* @param topic the topic.
9398
* @param partition the partition.
9499
* @param offset the offset (absolute).
95100
*/
96101
void seek(String topic, int partition, long offset);
97102

98103
/**
99-
* Queue a seekToBeginning operation to the consumer. The seek will occur after
104+
* Perform a seek to beginning operation. When called from
105+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
106+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
107+
* perform the seek immediately on the consumer. When called from elsewhere, queue
108+
* the seek operation to the consumer. The queued seek will occur after
100109
* any pending offset commits. The consumer must be currently assigned the
101110
* specified partition.
102111
* @param topic the topic.
@@ -105,7 +114,11 @@ interface ConsumerSeekCallback {
105114
void seekToBeginning(String topic, int partition);
106115

107116
/**
108-
* Queue a seekToBeginning operation to the consumer for each
117+
* Perform a seek to beginning operation. When called from
118+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
119+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
120+
* perform the seek immediately on the consumer. When called from elsewhere,
121+
* queue the seek operation to the consumer for each
109122
* {@link TopicPartition}. The seek will occur after any pending offset commits.
110123
* The consumer must be currently assigned the specified partition(s).
111124
* @param partitions the {@link TopicPartition}s.
@@ -116,16 +129,25 @@ default void seekToBeginning(Collection<TopicPartition> partitions) {
116129
}
117130

118131
/**
119-
* Queue a seekToEnd operation to the consumer. The seek will occur after any pending
120-
* offset commits. The consumer must be currently assigned the specified partition.
132+
* Perform a seek to end operation. When called from
133+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
134+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
135+
* perform the seek immediately on the consumer. When called from elsewhere, queue
136+
* the seek operation to the consumer. The queued seek will occur after any
137+
* pending offset commits. The consumer must be currently assigned the specified
138+
* partition.
121139
* @param topic the topic.
122140
* @param partition the partition.
123141
*/
124142
void seekToEnd(String topic, int partition);
125143

126144
/**
127-
* Queue a seekToEnd operation to the consumer for each {@link TopicPartition}.
128-
* The seek will occur after any pending offset commits. The consumer must be
145+
* Perform a seek to end operation. When called from
146+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
147+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
148+
* perform the seek immediately on the consumer. When called from elsewhere, queue
149+
* the seek operation to the consumer for each {@link TopicPartition}. The queued
150+
* seek(s) will occur after any pending offset commits. The consumer must be
129151
* currently assigned the specified partition(s).
130152
* @param partitions the {@link TopicPartition}s.
131153
* @since 2.3.4
@@ -135,20 +157,31 @@ default void seekToEnd(Collection<TopicPartition> partitions) {
135157
}
136158

137159
/**
138-
* Queue a seek to a position relative to the start or end of the current position.
160+
* Perform a seek relative to the start, end, or current position. When called
161+
* from {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)}
162+
* or from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
163+
* perform the seek immediately on the consumer. When called from elsewhere, queue
164+
* the seek operation. The queued seek will occur after any pending offset
165+
* commits. The consumer must be currently assigned the specified partition.
139166
* @param topic the topic.
140167
* @param partition the partition.
141168
* @param offset the offset; positive values are relative to the start, negative
142169
* values are relative to the end, unless toCurrent is true.
143-
* @param toCurrent true for the offset to be relative to the current position rather
144-
* than the beginning or end.
170+
* @param toCurrent true for the offset to be relative to the current position
171+
* rather than the beginning or end.
145172
* @since 2.3
146173
*/
147174
void seekRelative(String topic, int partition, long offset, boolean toCurrent);
148175

149176
/**
150-
* Seek to the first offset greater than or equal to the time stamp.
151-
* Use {@link #seekToTimestamp(Collection, long)} when seeking multiple partitions
177+
* Perform a seek to the first offset greater than or equal to the time stamp.
178+
* When called from
179+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
180+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
181+
* perform the seek immediately on the consumer. When called from elsewhere, queue
182+
* the seek operation. The queued seek will occur after any pending offset
183+
* commits. The consumer must be currently assigned the specified partition. Use
184+
* {@link #seekToTimestamp(Collection, long)} when seeking multiple partitions
152185
* because the offset lookup is blocking.
153186
* @param topic the topic.
154187
* @param partition the partition.
@@ -159,7 +192,13 @@ default void seekToEnd(Collection<TopicPartition> partitions) {
159192
void seekToTimestamp(String topic, int partition, long timestamp);
160193

161194
/**
162-
* Seek to the first offset greater than or equal to the time stamp.
195+
* Perform a seek to the first offset greater than or equal to the time stamp.
196+
* When called from
197+
* {@link ConsumerSeekAware#onPartitionsAssigned(Map, ConsumerSeekCallback)} or
198+
* from {@link ConsumerSeekAware#onIdleContainer(Map, ConsumerSeekCallback)}
199+
* perform the seek immediately on the consumer. When called from elsewhere, queue
200+
* the seek operation. The queued seek will occur after any pending offset
201+
* commits. The consumer must be currently assigned the specified partition.
163202
* @param topicPartitions the topic/partitions.
164203
* @param timestamp the time stamp.
165204
* @since 2.3

0 commit comments

Comments
 (0)