You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/cli.rs
+52-18Lines changed: 52 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -270,6 +270,14 @@ pub struct Options {
270
270
)]
271
271
pubrow_group_size:usize,
272
272
273
+
#[arg(
274
+
long,
275
+
env = "P_EXECUTION_BATCH_SIZE",
276
+
default_value = "20000",
277
+
help = "batch size for query execution"
278
+
)]
279
+
pubexecution_batch_size:usize,
280
+
273
281
#[arg(
274
282
long = "compression-algo",
275
283
env = "P_PARQUET_COMPRESSION_ALGO",
@@ -295,6 +303,14 @@ pub struct Options {
295
303
)]
296
304
pubingestor_endpoint:String,
297
305
306
+
#[arg(
307
+
long,
308
+
env = "P_INDEXER_ENDPOINT",
309
+
default_value = "",
310
+
help = "URL to connect to this specific indexer. Default is the address of the server"
311
+
)]
312
+
pubindexer_endpoint:String,
313
+
298
314
#[command(flatten)]
299
315
puboidc:Option<OidcConfig>,
300
316
@@ -396,29 +412,47 @@ impl Options {
396
412
}
397
413
398
414
/// TODO: refactor and document
399
-
pubfnget_url(&self) -> Url{
400
-
ifself.ingestor_endpoint.is_empty(){
401
-
returnformat!(
402
-
"{}://{}",
403
-
self.get_scheme(),
404
-
self.address
405
-
)
406
-
.parse::<Url>()// if the value was improperly set, this will panic before hand
407
-
.unwrap_or_else(|err| {
408
-
panic!("{err}, failed to parse `{}` as Url. Please set the environment variable `P_ADDR` to `<ip address>:<port>` without the scheme (e.g., 192.168.1.1:8000). Please refer to the documentation: https://logg.ing/env for more details.",self.address)
409
-
});
410
-
}
411
-
412
-
let ingestor_endpoint = &self.ingestor_endpoint;
415
+
pubfnget_url(&self,mode:Mode) -> Url{
416
+
let(endpoint, env_var) = match mode {
417
+
Mode::Ingest => {
418
+
ifself.ingestor_endpoint.is_empty(){
419
+
returnformat!(
420
+
"{}://{}",
421
+
self.get_scheme(),
422
+
self.address
423
+
)
424
+
.parse::<Url>()// if the value was improperly set, this will panic before hand
425
+
.unwrap_or_else(|err| {
426
+
panic!("{err}, failed to parse `{}` as Url. Please set the environment variable `P_ADDR` to `<ip address>:<port>` without the scheme (e.g., 192.168.1.1:8000). Please refer to the documentation: https://logg.ing/env for more details.",self.address)
427
+
});
428
+
}
429
+
(&self.ingestor_endpoint,"P_INGESTOR_ENDPOINT")
430
+
}
431
+
Mode::Index => {
432
+
ifself.indexer_endpoint.is_empty(){
433
+
returnformat!(
434
+
"{}://{}",
435
+
self.get_scheme(),
436
+
self.address
437
+
)
438
+
.parse::<Url>()// if the value was improperly set, this will panic before hand
439
+
.unwrap_or_else(|err| {
440
+
panic!("{err}, failed to parse `{}` as Url. Please set the environment variable `P_ADDR` to `<ip address>:<port>` without the scheme (e.g., 192.168.1.1:8000). Please refer to the documentation: https://logg.ing/env for more details.",self.address)
441
+
});
442
+
}
443
+
(&self.indexer_endpoint,"P_INDEXER_ENDPOINT")
444
+
}
445
+
_ => panic!("Invalid mode"),
446
+
};
413
447
414
-
ifingestor_endpoint.starts_with("http"){
415
-
panic!("Invalid value `{}`, please set the environement variable `P_INGESTOR_ENDPOINT` to `<ip address / DNS>:<port>` without the scheme (e.g., 192.168.1.1:8000 or example.com:8000). Please refer to the documentation: https://logg.ing/env for more details.",ingestor_endpoint);
448
+
ifendpoint.starts_with("http"){
449
+
panic!("Invalid value `{}`, please set the environement variable `{env_var}` to `<ip address / DNS>:<port>` without the scheme (e.g., 192.168.1.1:8000 or example.com:8000). Please refer to the documentation: https://logg.ing/env for more details.",endpoint);
416
450
}
417
451
418
-
let addr_from_env = ingestor_endpoint.split(':').collect::<Vec<&str>>();
452
+
let addr_from_env = endpoint.split(':').collect::<Vec<&str>>();
419
453
420
454
if addr_from_env.len() != 2{
421
-
panic!("Invalid value `{}`, please set the environement variable `P_INGESTOR_ENDPOINT` to `<ip address / DNS>:<port>` without the scheme (e.g., 192.168.1.1:8000 or example.com:8000). Please refer to the documentation: https://logg.ing/env for more details.",ingestor_endpoint);
455
+
panic!("Invalid value `{}`, please set the environement variable `{env_var}` to `<ip address / DNS>:<port>` without the scheme (e.g., 192.168.1.1:8000 or example.com:8000). Please refer to the documentation: https://logg.ing/env for more details.",endpoint);
0 commit comments