Skip to content

Commit

Permalink
rename P_NODE_URL to P_INGESTOR_URL (#748)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikhil Sinha <[email protected]>
  • Loading branch information
nitisht and nikhilsinhaparseable authored Apr 9, 2024
1 parent 1bf85de commit 91cce24
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions server/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ pub struct Cli {
/// Mode of operation
pub mode: Mode,

/// public address for the parseable server
pub node_url: String,
/// public address for the parseable server ingestor
pub ingestor_url: String,
}

impl Cli {
Expand All @@ -115,7 +115,7 @@ impl Cli {
pub const ROW_GROUP_SIZE: &'static str = "row-group-size";
pub const PARQUET_COMPRESSION_ALGO: &'static str = "compression-algo";
pub const MODE: &'static str = "mode";
pub const NODE_URL: &'static str = "node-url";
pub const INGESTOR_URL: &'static str = "ingestor-url";
pub const DEFAULT_USERNAME: &'static str = "admin";
pub const DEFAULT_PASSWORD: &'static str = "admin";

Expand Down Expand Up @@ -317,13 +317,13 @@ impl Cli {
.help("Mode of operation"),
)
.arg(
Arg::new(Self::NODE_URL)
.long(Self::NODE_URL)
.env("P_NODE_URL")
Arg::new(Self::INGESTOR_URL)
.long(Self::INGESTOR_URL)
.env("P_INGESTOR_URL")
.value_name("URL")
.required(false)
.value_parser(validation::socket_addr)
.help("Node URL for Parseable server")
.help("URL to connect to this specific ingestor. Default is the address of the server.")
)
.arg(
Arg::new(Self::PARQUET_COMPRESSION_ALGO)
Expand Down Expand Up @@ -368,8 +368,8 @@ impl FromArgMatches for Cli {
.cloned()
.expect("default value for address");

self.node_url = m
.get_one::<String>(Self::NODE_URL)
self.ingestor_url = m
.get_one::<String>(Self::INGESTOR_URL)
.cloned()
.unwrap_or_else(|| self.address.clone());

Expand Down
2 changes: 1 addition & 1 deletion server/src/handlers/http/modal/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ impl Server {
pub fn get_server_address() -> SocketAddr {
// this might cause an issue down the line
// best is to make the Cli Struct better, but thats a chore
(CONFIG.parseable.node_url.clone())
(CONFIG.parseable.ingestor_url.clone())
.parse::<SocketAddr>()
.unwrap()
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl TimePeriod {

#[inline(always)]
pub fn get_address() -> (IpAddr, u16) {
let addr = CONFIG.parseable.node_url.parse::<SocketAddr>().unwrap();
let addr = CONFIG.parseable.ingestor_url.parse::<SocketAddr>().unwrap();
(addr.ip(), addr.port())
}

Expand Down

0 comments on commit 91cce24

Please sign in to comment.