Commit 3e3f0c4
authored
KAFKA-19946: Simplify skipping of empty ShareFetch requests (#21033)
ShareFetch requests can be used to fetch records for share consumers,
but in some cases, no records are required and the request is just being
used to update the share session or send acknowledgements. As a result,
there are situations in which a ShareFetch request would be built, only
for it to be entirely empty (no fetch, no asks, no share session
update). This PR simplifies the logic for detecting when the request is
empty and then to avoid building it entirely. It also adds some tests
for this case.
Reviewers: Apoorv Mittal <apoorvmittal10@gmail.com>1 parent c9fa8c5 commit 3e3f0c4
File tree
4 files changed
+110
-50
lines changed- clients/src
- main/java/org/apache/kafka/clients/consumer/internals
- test/java/org/apache/kafka/clients/consumer/internals
4 files changed
+110
-50
lines changedLines changed: 9 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | 256 | | |
260 | 257 | | |
261 | 258 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
272 | 266 | | |
273 | 267 | | |
| 268 | + | |
| 269 | + | |
274 | 270 | | |
275 | 271 | | |
276 | 272 | | |
| |||
Lines changed: 23 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | | - | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | 162 | | |
171 | 163 | | |
172 | 164 | | |
| |||
187 | 179 | | |
188 | 180 | | |
189 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
| |||
196 | 201 | | |
197 | 202 | | |
198 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
199 | 212 | | |
200 | 213 | | |
201 | 214 | | |
| |||
0 commit comments