risingwave_ctl/cmd_impl/
compute.rs1use risingwave_common::config::{BatchConfig, RpcClientConfig, StreamingConfig};
16use risingwave_common::util::addr::HostAddr;
17use risingwave_rpc_client::ComputeClient;
18
19pub async fn show_config(host: &str) -> anyhow::Result<()> {
20    let listen_addr = HostAddr::try_from(host)?;
21    let client = ComputeClient::new(listen_addr, &RpcClientConfig::default()).await?;
22    let config_response = client.show_config().await?;
23    let batch_config: BatchConfig = serde_json::from_str(&config_response.batch_config)?;
24    let stream_config: StreamingConfig = serde_json::from_str(&config_response.stream_config)?;
25    println!("{}", serde_json::to_string_pretty(&batch_config)?);
26    println!("{}", serde_json::to_string_pretty(&stream_config)?);
27    Ok(())
28}