Skip to content

Commit

Permalink
rename ingestor_url to ingestor_endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Eshanatnight committed Apr 15, 2024
1 parent 6018975 commit a2e34b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions server/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub struct Cli {
pub mode: Mode,

/// public address for the parseable server ingestor
pub ingestor_url: String,
pub ingestor_endpoint: 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 INGESTOR_URL: &'static str = "ingestor-url";
pub const INGESTOR_ENDPOINT: &'static str = "ingestor-endpoint";
pub const DEFAULT_USERNAME: &'static str = "admin";
pub const DEFAULT_PASSWORD: &'static str = "admin";

Expand Down Expand Up @@ -317,9 +317,9 @@ impl Cli {
.help("Mode of operation"),
)
.arg(
Arg::new(Self::INGESTOR_URL)
.long(Self::INGESTOR_URL)
.env("P_INGESTOR_URL")
Arg::new(Self::INGESTOR_ENDPOINT)
.long(Self::INGESTOR_ENDPOINT)
.env("P_INGESTOR_ENDPOINT")
.value_name("URL")
.required(false)
.help("URL to connect to this specific ingestor. Default is the address of the server.")
Expand Down Expand Up @@ -367,8 +367,8 @@ impl FromArgMatches for Cli {
.cloned()
.expect("default value for address");

self.ingestor_url = m
.get_one::<String>(Self::INGESTOR_URL)
self.ingestor_endpoint = m
.get_one::<String>(Self::INGESTOR_ENDPOINT)
.cloned()
.unwrap_or_else(String::default);

Expand Down
12 changes: 6 additions & 6 deletions server/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,19 @@ impl TimePeriod {
}
}

// TODO: CLEAN UP
pub fn get_address() -> Url {
if CONFIG.parseable.ingestor_url.is_empty() {
let url = format!(
if CONFIG.parseable.ingestor_endpoint.is_empty() {
return format!(
"{}://{}",
CONFIG.parseable.get_scheme(),
CONFIG.parseable.address
);
return url.parse::<Url>().unwrap();
)
.parse::<Url>() // if the value was improperly set, this will panic before hand
.unwrap();
}
let addr_from_env = CONFIG
.parseable
.ingestor_url
.ingestor_endpoint
.split(':')
.collect::<Vec<&str>>();

Expand Down

0 comments on commit a2e34b9

Please sign in to comment.