Skip to content

Commit

Permalink
feat(automq-kafka-admin.sh): Optimize command line standard output me…
Browse files Browse the repository at this point in the history
…ssages (#1178)
  • Loading branch information
amos201600 committed Apr 26, 2024
1 parent 19dbb4a commit a592523
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ public static ArgumentParser addArguments(Subparser parser) {
}

public String run() {
System.out.println("#################################### S3 PRECHECK #################################");
System.out.println("############ Ping s3 ####################");
System.out.println();

//precheck
// precheck
var context = S3Utils.S3Context.builder()
.setEndpoint(parameter.endpointProtocol.getName() + "://" + parameter.s3Endpoint)
.setCredentialsProviders(List.of(() -> AwsBasicCredentials.create(parameter.s3AccessKey, parameter.s3SecretKey)))
Expand All @@ -160,22 +160,21 @@ public String run() {
S3Utils.checkS3Access(context);

String s3Url = buildS3Url();
System.out.println("########## S3 URL RESULT ############");
System.out.println("############ string of s3url ############");
System.out.println();
System.out.println("Your S3 URL is: \n");
System.out.println("Your s3url is: \n");
System.out.println(s3Url);
System.out.println("\n");

System.out.println("############ S3 URL USAGE ##############");
System.out.println("You can use s3url to generate start command to start AutoMQ");
System.out.println("------------------------ COPY ME ------------------");
System.out.println("############ s3url usage ################");
System.out.println("To start AutoMQ, generate the start commandline using s3url.");
//tips: Not add whitespace after \\
System.out.println(String.format("bin/automq-kafka-admin.sh %s \\%n"
+ "--s3-url=\"%s\" \\%n"
+ "--controller-list=\"192.168.0.1:9093;192.168.0.2:9093;192.168.0.3:9093\" \\%n"
+ "--broker-list=\"192.168.0.4:9092;192.168.0.5:9092\" %n", GENERATE_START_COMMAND_CMD, s3Url
));
System.out.println("TIPS: Replace the controller-list and broker-list with your real ip list.");
System.out.println("TIPS: Please replace the controller-list and broker-list with your actual IP addresses.");

return s3Url;
}
Expand Down

0 comments on commit a592523

Please sign in to comment.