From 3ad150ad6068fbcea5ece2c46df85d6ea2cc066f Mon Sep 17 00:00:00 2001 From: Bo-Jhang Ho Date: Mon, 6 Apr 2026 19:30:36 +0000 Subject: [PATCH 1/3] Replace ordering key prober's --should_cleanup with --should_not_cleanup so that we can use the flag The current implmenetation will not be able to disable the flag (i.e., specify that I don't want to cleanup). This can be resolved by adding `arity=1` in the @parameter() (see https://jcommander.org/ section 2.1), but I try to keep the style consistent with `--no_publish` flag. --- .../java/com/google/cloud/pubsub/prober/ProberStarter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java b/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java index 858f7841..83e1dd0c 100644 --- a/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java +++ b/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java @@ -40,8 +40,8 @@ public static class Args { @Parameter(names = "--endpoint", description = "Cloud Pub/Sub endpoint to run against.") private String endpoint = "pubsub.googleapis.com:443"; - @Parameter(names = "--should_cleanup", description ="Whether the prober should start by cleaning up the topic and subscription.") - private boolean shouldCleanup = true; + @Parameter(names = "--should_not_cleanup", description = "Whether the prober should start by not cleaning up the topic and subscription.") + private boolean shouldNotCleanup = false; @Parameter(names = "--no_publish", description ="Whether the prober should skip publishing.") private boolean noPublish = false; @@ -176,7 +176,7 @@ public static void main(String[] args) throws IOException { builder .setProject(parsedArgs.project) .setEndpoint(parsedArgs.endpoint) - .setShouldCleanup(parsedArgs.shouldCleanup) + .setShouldCleanup(!parsedArgs.shouldNotCleanup) .setNoPublish(parsedArgs.noPublish) .setTopicName(parsedArgs.topicName) .setSubscriptionName(parsedArgs.subscriptionName) From d04beba4d9e36cb05bcb0b639d3e7afe0d615c7a Mon Sep 17 00:00:00 2001 From: Bo-Jhang Ho Date: Mon, 6 Apr 2026 20:09:29 +0000 Subject: [PATCH 2/3] Replace --should_not_cleanup with --no_cleanup and revise the flag description per suggestion. --- .../main/java/com/google/cloud/pubsub/prober/ProberStarter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java b/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java index 83e1dd0c..cfc510b7 100644 --- a/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java +++ b/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java @@ -40,7 +40,7 @@ public static class Args { @Parameter(names = "--endpoint", description = "Cloud Pub/Sub endpoint to run against.") private String endpoint = "pubsub.googleapis.com:443"; - @Parameter(names = "--should_not_cleanup", description = "Whether the prober should start by not cleaning up the topic and subscription.") + @Parameter(names = "--no_cleanup", description = "Skip the cleanup of the topic and subscription on startup.") private boolean shouldNotCleanup = false; @Parameter(names = "--no_publish", description ="Whether the prober should skip publishing.") From b0484eabb5c06a27cec4aac6f3fc0e9a93cf54b7 Mon Sep 17 00:00:00 2001 From: Bo-Jhang Ho Date: Mon, 6 Apr 2026 20:19:05 +0000 Subject: [PATCH 3/3] Also replace the variable associated with --no_cleanup --- .../java/com/google/cloud/pubsub/prober/ProberStarter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java b/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java index cfc510b7..a6be3c32 100644 --- a/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java +++ b/ordering-keys-prober/src/main/java/com/google/cloud/pubsub/prober/ProberStarter.java @@ -41,7 +41,7 @@ public static class Args { private String endpoint = "pubsub.googleapis.com:443"; @Parameter(names = "--no_cleanup", description = "Skip the cleanup of the topic and subscription on startup.") - private boolean shouldNotCleanup = false; + private boolean noCleanup = false; @Parameter(names = "--no_publish", description ="Whether the prober should skip publishing.") private boolean noPublish = false; @@ -176,7 +176,7 @@ public static void main(String[] args) throws IOException { builder .setProject(parsedArgs.project) .setEndpoint(parsedArgs.endpoint) - .setShouldCleanup(!parsedArgs.shouldNotCleanup) + .setShouldCleanup(!parsedArgs.noCleanup) .setNoPublish(parsedArgs.noPublish) .setTopicName(parsedArgs.topicName) .setSubscriptionName(parsedArgs.subscriptionName)