nileshkumar3 commented on code in PR #22607:
URL: https://github.com/apache/kafka/pull/22607#discussion_r3448446512
##########
tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommandOptions.java:
##########
@@ -31,51 +31,50 @@ public class StreamsGroupCommandOptions extends
CommandDefaultOptions {
private static final String NL = System.lineSeparator();
private static final String BOOTSTRAP_SERVER_DOC = "REQUIRED: The
server(s) to connect to.";
- private static final String GROUP_DOC = "The streams group we wish to act
on.";
+ private static final String GROUP_DOC = "The streams group id.";
private static final String ALL_GROUPS_DOC = "Apply to all streams
groups.";
private static final String INPUT_TOPIC_DOC = "The input topic whose
committed offset should be deleted or reset. " +
- "In `reset-offsets` case, partitions can be specified using this
format: `topic1:0,1,2`, where 0,1,2 are the partition to be included in the
process. " +
+ "In --reset-offsets case, partitions can be specified using this
format: `topic:0,1,2`, where 0,1,2 are the partitions to be included. " +
"Multiple input topics can be specified. Supported operations:
delete-offsets, reset-offsets.";
- private static final String ALL_INPUT_TOPICS_DOC = "Consider all source
topics used in the topology of the group. Supported operations: delete-offsets,
reset-offsets.";
+ private static final String ALL_INPUT_TOPICS_DOC = "Consider all input
topics used in the topology of the group. Supported operations: delete-offsets,
reset-offsets.";
private static final String LIST_DOC = "List all streams groups.";
private static final String DESCRIBE_DOC = "Describe streams group and
list offset lag related to given group.";
- private static final String DELETE_DOC = "Pass in groups to delete topic
partition offsets and ownership information " +
- "over the entire streams group. For instance --group g1 --group g2";
- private static final String DELETE_OFFSETS_DOC = "Delete offsets of
streams group. Supports one streams group at the time, and multiple topics.";
+ private static final String DELETE_DOC = "Delete topic partition offsets
and ownership information for one or more streams groups.";
+ private static final String DELETE_OFFSETS_DOC = "Delete offsets of
streams group. Supports one streams group at a time, and multiple topics.";
private static final String TIMEOUT_MS_DOC = "The timeout that can be set
for some use cases. For example, it can be used when describing the group " +
"to specify the maximum amount of time in milliseconds to wait before
the group stabilizes.";
private static final String COMMAND_CONFIG_DOC = "Property file containing
configs to be passed to Admin Client.";
- private static final String STATE_DOC = "When specified with '--list', it
displays the state of all groups. It can also be used to list groups with
specific states. " +
+ private static final String STATE_DOC = "When specified with --list, it
displays the state of all groups. It can also be used to list groups with
specific states. " +
"Valid values are Empty, NotReady, Stable, Assigning, Reconciling, and
Dead.";
- private static final String MEMBERS_DOC = "Describe members of the group.
This option may be used with the '--describe' option only.";
+ private static final String MEMBERS_DOC = "Describe members of the group.
This option may be used with the --describe option only.";
private static final String OFFSETS_DOC = "Describe the group and list all
topic partitions in the group along with their offset information." +
- "This is the default sub-action and may be used with the '--describe'
option only.";
+ "This is the default sub-action and may be used with the --describe
option only.";
private static final String RESET_OFFSETS_DOC = "Reset offsets of streams
group. The instances should be inactive." + NL +
"Has 2 execution options: --dry-run to plan which offsets to reset,
and --execute to update the offsets." + NL +
Review Comment:
Consider adding --export and saying “3 execution options” for consistency.
##########
tools/src/main/java/org/apache/kafka/tools/consumer/group/ShareGroupCommandOptions.java:
##########
@@ -31,45 +28,44 @@
import static org.apache.kafka.tools.ToolsUtils.minus;
public class ShareGroupCommandOptions extends CommandDefaultOptions {
- private static final Logger LOGGER =
LoggerFactory.getLogger(ShareGroupCommandOptions.class);
+ private static final String NL = System.lineSeparator();
private static final String BOOTSTRAP_SERVER_DOC = "REQUIRED: The
server(s) to connect to.";
- private static final String GROUP_DOC = "The share group we wish to act
on.";
- private static final String TOPIC_DOC = "The topic whose offset
information should be deleted or included in the reset offset process. " +
- "When resetting offsets, partitions can be specified using this
format: 'topic1:0,1,2', where 0,1,2 are the partitions to be included.";
- private static final String ALL_TOPICS_DOC = "Consider all topics assigned
to a share group in the 'reset-offsets' process.";
+ private static final String GROUP_DOC = "The share group id.";
+ private static final String TOPIC_DOC = "The topic whose offset
information should be deleted or reset. " +
+ "When resetting offsets, partitions can be specified using this
format: `topic:0,1,2`, where 0,1,2 are the partitions to be included.";
+ private static final String ALL_TOPICS_DOC = "Apply to all topics.
Supported operation: reset-offsets.";
private static final String LIST_DOC = "List all share groups.";
private static final String DESCRIBE_DOC = "Describe share group, members
and offset information.";
private static final String ALL_GROUPS_DOC = "Apply to all share groups.";
- private static final String NL = System.lineSeparator();
private static final String DELETE_DOC = "Delete share group.";
private static final String TIMEOUT_MS_DOC = "The timeout that can be set
for some use cases. For example, it can be used when describing the group " +
"to specify the maximum amount of time in milliseconds to wait before
the group stabilizes.";
private static final String COMMAND_CONFIG_DOC = "Property file containing
configs to be passed to Admin Client.";
- private static final String RESET_OFFSETS_DOC = "Reset offsets of share
group. Supports one share group at the time, and instances must be inactive." +
NL +
+ private static final String RESET_OFFSETS_DOC = "Reset offsets of share
group. Supports one share group at a time, and instances must be inactive." +
NL +
"Has 2 execution options: --dry-run to plan which offsets to reset,
and --execute to reset the offsets. " + NL +
"Additionally, the --export option is used to export the offsets in
CSV format." + NL +
Review Comment:
same here, can we align with new wording
##########
tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommandOptions.java:
##########
@@ -31,51 +31,50 @@ public class StreamsGroupCommandOptions extends
CommandDefaultOptions {
private static final String NL = System.lineSeparator();
private static final String BOOTSTRAP_SERVER_DOC = "REQUIRED: The
server(s) to connect to.";
- private static final String GROUP_DOC = "The streams group we wish to act
on.";
+ private static final String GROUP_DOC = "The streams group id.";
private static final String ALL_GROUPS_DOC = "Apply to all streams
groups.";
private static final String INPUT_TOPIC_DOC = "The input topic whose
committed offset should be deleted or reset. " +
- "In `reset-offsets` case, partitions can be specified using this
format: `topic1:0,1,2`, where 0,1,2 are the partition to be included in the
process. " +
+ "In --reset-offsets case, partitions can be specified using this
format: `topic:0,1,2`, where 0,1,2 are the partitions to be included. " +
"Multiple input topics can be specified. Supported operations:
delete-offsets, reset-offsets.";
- private static final String ALL_INPUT_TOPICS_DOC = "Consider all source
topics used in the topology of the group. Supported operations: delete-offsets,
reset-offsets.";
+ private static final String ALL_INPUT_TOPICS_DOC = "Consider all input
topics used in the topology of the group. Supported operations: delete-offsets,
reset-offsets.";
private static final String LIST_DOC = "List all streams groups.";
private static final String DESCRIBE_DOC = "Describe streams group and
list offset lag related to given group.";
- private static final String DELETE_DOC = "Pass in groups to delete topic
partition offsets and ownership information " +
- "over the entire streams group. For instance --group g1 --group g2";
- private static final String DELETE_OFFSETS_DOC = "Delete offsets of
streams group. Supports one streams group at the time, and multiple topics.";
+ private static final String DELETE_DOC = "Delete topic partition offsets
and ownership information for one or more streams groups.";
+ private static final String DELETE_OFFSETS_DOC = "Delete offsets of
streams group. Supports one streams group at a time, and multiple topics.";
private static final String TIMEOUT_MS_DOC = "The timeout that can be set
for some use cases. For example, it can be used when describing the group " +
"to specify the maximum amount of time in milliseconds to wait before
the group stabilizes.";
private static final String COMMAND_CONFIG_DOC = "Property file containing
configs to be passed to Admin Client.";
- private static final String STATE_DOC = "When specified with '--list', it
displays the state of all groups. It can also be used to list groups with
specific states. " +
+ private static final String STATE_DOC = "When specified with --list, it
displays the state of all groups. It can also be used to list groups with
specific states. " +
"Valid values are Empty, NotReady, Stable, Assigning, Reconciling, and
Dead.";
- private static final String MEMBERS_DOC = "Describe members of the group.
This option may be used with the '--describe' option only.";
+ private static final String MEMBERS_DOC = "Describe members of the group.
This option may be used with the --describe option only.";
private static final String OFFSETS_DOC = "Describe the group and list all
topic partitions in the group along with their offset information." +
- "This is the default sub-action and may be used with the '--describe'
option only.";
+ "This is the default sub-action and may be used with the --describe
option only.";
private static final String RESET_OFFSETS_DOC = "Reset offsets of streams
group. The instances should be inactive." + NL +
"Has 2 execution options: --dry-run to plan which offsets to reset,
and --execute to update the offsets." + NL +
"If you use --execute, all internal topics linked to the group will
also be deleted." + NL +
"You must choose one of the following reset specifications:
--to-datetime, --by-duration, --to-earliest, " +
"--to-latest, --shift-by, --from-file, --to-current, --to-offset." +
NL +
- "To define the scope use --all-input-topics or --input-topic. One
scope must be specified unless you use '--from-file'." + NL +
- "Fails if neither '--dry-run' nor '--execute' is specified.";
- private static final String DRY_RUN_DOC = "Only show results without
executing changes on streams group. Supported operations: reset-offsets.";
- private static final String EXECUTE_DOC = "Execute operation. Supported
operations: reset-offsets.";
- private static final String EXPORT_DOC = "Export operation execution to a
CSV file. Supported operations: reset-offsets.";
+ "To define the scope, use --all-input-topics or --input-topic. The
scope must be specified unless you use --from-file." + NL +
+ "Fails if neither --dry-run nor --execute is specified.";
+ private static final String DRY_RUN_DOC = "Only show results without
executing changes on streams group. Supported operation: reset-offsets.";
Review Comment:
nit: For consistency, should we consider updating this to align with other 2
DRY_RUN_DOC text.
##########
clients/src/main/java/org/apache/kafka/clients/admin/AlterShareGroupOffsetsResult.java:
##########
@@ -76,8 +76,8 @@ public KafkaFuture<Void> all() {
.collect(Collectors.toList());
for (ApiException exception : topicPartitionErrorsMap.values()) {
if (exception != null) {
- throw Errors.forException(exception).exception(
- "Failed altering group offsets for the following
partitions: " + partitionsFailed);
+ throw
Errors.forException(exception).exception(exception.getMessage() +
Review Comment:
If exception.getMessage() is null, this produces "null Failed altering...".
Consider guarding with a null/empty check before concatenation.
##########
docs/operations/basic-kafka-operations.md:
##########
@@ -309,6 +310,9 @@ It has 2 execution options:
* \--to-datetime <String: datetime> : Reset offsets to offsets from
datetime. Format: 'YYYY-MM-DDThh:mm:ss.sss'
* \--to-earliest : Reset offsets to earliest offset.
* \--to-latest : Reset offsets to latest offset.
+ * \--from-file : Reset offsets to values defined in CSV file.
+ * \--to-current : Resets offsets to current offset.
Review Comment:
typo Resets -> Reset
##########
tools/src/main/java/org/apache/kafka/tools/consumer/group/ConsumerGroupCommandOptions.java:
##########
@@ -28,57 +28,55 @@
import static org.apache.kafka.tools.ToolsUtils.minus;
public class ConsumerGroupCommandOptions extends CommandDefaultOptions {
+ private static final String NL = System.lineSeparator();
private static final String BOOTSTRAP_SERVER_DOC = "The server(s) to
connect to. REQUIRED for all options except for --validate-regex.";
- private static final String GROUP_DOC = "The consumer group we wish to act
on.";
- private static final String TOPIC_DOC = "The topic whose consumer group
information should be deleted or topic whose should be included in the reset
offset process. " +
- "In `reset-offsets` case, partitions can be specified using this
format: `topic1:0,1,2`, where 0,1,2 are the partition to be included in the
process. " +
- "Reset-offsets also supports multiple topic inputs.";
- private static final String ALL_TOPICS_DOC = "Consider all topics assigned
to a group in the `reset-offsets` process.";
+ private static final String GROUP_DOC = "The consumer group id.";
+ private static final String TOPIC_DOC = "The topic whose offset
information should be deleted or reset. " +
+ "In `reset-offsets` case, partitions can be specified using this
format: `topic:0,1,2`, where 0,1,2 are the partitions to be included. " +
+ "Reset-offsets also supports multiple topics.";
+ private static final String ALL_TOPICS_DOC = "Apply to all topics.";
private static final String LIST_DOC = "List all consumer groups.";
private static final String DESCRIBE_DOC = "Describe consumer group and
list offset lag (number of messages not yet processed) related to given group.";
private static final String ALL_GROUPS_DOC = "Apply to all consumer
groups.";
- private static final String NL = System.lineSeparator();
- private static final String DELETE_DOC = "Pass in groups to delete topic
partition offsets and ownership information " +
- "over the entire consumer group. For instance --group g1 --group g2";
+ private static final String DELETE_DOC = "Delete topic partition offsets
and ownership information for one or more consumer groups.";
private static final String TIMEOUT_MS_DOC = "The timeout that can be set
for some use cases. For example, it can be used when describing the group " +
"to specify the maximum amount of time in milliseconds to wait before
the group stabilizes (when the group is just created, " +
"or is going through some changes).";
private static final String COMMAND_CONFIG_DOC = "Property file containing
configs to be passed to Admin Client and Consumer.";
- private static final String RESET_OFFSETS_DOC = "Reset offsets of consumer
group. Supports one consumer group at the time, and instances should be
inactive" + NL +
+ private static final String RESET_OFFSETS_DOC = "Reset offsets of consumer
group. Supports one consumer group at a time, and instances should be inactive"
+ NL +
"Has 2 execution options: --dry-run (the default) to plan which
offsets to reset, and --execute to update the offsets. " +
"Additionally, the --export option is used to export the offsets in
CSV format." + NL +
Review Comment:
Can we align this line similar to EXPORT_DOC (line 55)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]