KAFKA-20524: CSV reset offset plan for kafka-share-groups.sh#22197
KAFKA-20524: CSV reset offset plan for kafka-share-groups.sh#22197AndrewJSchofield wants to merge 1 commit intoapache:trunkfrom
Conversation
| return offsetsUtils.resetToLatest(partitionsToReset); | ||
| } else if (opts.options.has(opts.resetToDatetimeOpt)) { | ||
| return offsetsUtils.resetToDateTime(partitionsToReset); | ||
| } else if (offsetsUtils.resetPlanFromFile().isPresent()) { |
There was a problem hiding this comment.
This call resetPlanFromFile and next call resetFromFile seem to do same reading and parsing the entire csv. May be use opts to check for presence?
| withTimeoutMs(new ListShareGroupOffsetsOptions()) | ||
| ).partitionsToOffsetInfo(groupId).get(); | ||
| } catch (InterruptedException | ExecutionException e) { | ||
| throw new RuntimeException(e); |
There was a problem hiding this comment.
Is it better to interrupt the currentThread for RunTimeException?
For ExecutionException, getting the instance type for ex if it's of KafkaException(GroupAuthorizationException etc), it could be more visible to the caller ?
| offsetsUtils.checkAllTopicPartitionsValid(partitionsToReset); | ||
| if (opts.options.has(opts.resetToEarliestOpt)) { | ||
| if (opts.options.has(opts.resetToOffsetOpt)) { | ||
| return offsetsUtils.resetToOffset(partitionsToReset); |
There was a problem hiding this comment.
Not related to this pr, but this call sets offset to 0L, if opts.resetToOffsetOpt is empty or null. Is that ok instead of throwing an exception?
This is also the same in CosnumerGroupCommand too I think.
muralibasani
left a comment
There was a problem hiding this comment.
@AndrewJSchofield thanks for the pr. I have some minor comments.
Thanks for the review. I basically mapped the consumer group tool options across to the share group tool, and you're quite right that there are a few things to improve. I'll sort it out. |
This is the implementation of
https://cwiki.apache.org/confluence/display/KAFKA/KIP-1323%3A+Initialization+of+share+group+offsets+from+a+specific+offset+or+a+file.