Skip to content

Commit

Permalink
chore(cli): rename configs to config (#1708)
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Han <[email protected]>
  • Loading branch information
superhx authored Aug 2, 2024
1 parent be31452 commit f57fb52
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static void main(String... args) throws Exception {
private static void bucketReadinessCheck(ClusterTopology topo) {
try {
Properties properties = new Properties();
properties.load(new StringReader(topo.getGlobal().getConfigs()));
properties.load(new StringReader(topo.getGlobal().getConfig()));
String dataBuckets = properties.getProperty("s3.data.buckets");
String opsBuckets = properties.getProperty("s3.ops.buckets");
if (StringUtils.isBlank(dataBuckets) || StringUtils.isBlank(opsBuckets)) {
Expand Down Expand Up @@ -131,7 +131,7 @@ private static String genServerStartupCmd(ClusterTopology topo, Node node) {
appendEnvs(sb, topo);
sb.append("./bin/kafka-server-start.sh config/kraft/server.properties ");
appendCommonConfigsOverride(sb, topo, node);
appendExtConfigsOverride(sb, topo.getGlobal().getConfigs());
appendExtConfigsOverride(sb, topo.getGlobal().getConfig());
return sb.toString();
}

Expand All @@ -140,7 +140,7 @@ private static String genBrokerStartupCmd(ClusterTopology topo, Node node) {
appendEnvs(sb, topo);
sb.append("./bin/kafka-server-start.sh -daemon config/kraft/broker.properties ");
appendCommonConfigsOverride(sb, topo, node);
appendExtConfigsOverride(sb, topo.getGlobal().getConfigs());
appendExtConfigsOverride(sb, topo.getGlobal().getConfig());
return sb.toString();
}

Expand Down
10 changes: 5 additions & 5 deletions automq-shell/src/main/java/com/automq/shell/model/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class Global {
private String clusterId;
private String configs;
private String config;
private List<Env> envs;

public String getClusterId() {
Expand All @@ -29,12 +29,12 @@ public void setClusterId(String clusterId) {
this.clusterId = clusterId;
}

public String getConfigs() {
return configs;
public String getConfig() {
return config;
}

public void setConfigs(String configs) {
this.configs = configs;
public void setConfig(String config) {
this.config = config;
}

public List<Env> getEnvs() {
Expand Down
3 changes: 2 additions & 1 deletion automq-shell/src/main/resources/template/topo.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
global:
clusterId: ''
# bucket URI pattern: 0@s3://$bucket?region=$region&endpoint=$endpoint
# bucket URI example:
# AWS : 0@s3://xxx_bucket?region=us-east-1
# AWS-CN: 0@s3://xxx_bucket?region=cn-northwest-1&endpoint=https://s3.amazonaws.com.cn
# ALIYUN: 0@s3://xxx_bucket?region=oss-cn-shanghai&endpoint=https://oss-cn-shanghai.aliyuncs.com
# TENCENT: 0@s3://xxx_bucket?region=ap-beijing&endpoint=https://cos.ap-beijing.myqcloud.com
configs: |
config: |
s3.data.buckets=0@s3://xxx_bucket?region=us-east-1
s3.ops.buckets=1@s3://xxx_bucket?region=us-east-1
envs:
Expand Down

0 comments on commit f57fb52

Please sign in to comment.