-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
mod.rs
2320 lines (2017 loc) Β· 82 KB
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#![allow(deprecated)] // 'vtable' and 'TraitObject' are deprecated.confi
pub mod injection;
pub mod processing_loop;
use crate::cachestore::{
CacheEvictionPolicy, CacheStore, CacheStoreSchedulerImpl, ClusterCacheStoreClient,
LazyRocksCacheStore,
};
use crate::cluster::ingestion::job_processor::{JobProcessor, JobProcessorImpl};
use crate::cluster::rate_limiter::{BasicProcessRateLimiter, ProcessRateLimiter};
use crate::cluster::transport::{
ClusterTransport, ClusterTransportImpl, MetaStoreTransport, MetaStoreTransportImpl,
};
use crate::cluster::{Cluster, ClusterImpl, ClusterMetaStoreClient};
use crate::config::injection::{DIService, Injector};
use crate::config::processing_loop::ProcessingLoop;
use crate::http::HttpServer;
use crate::import::limits::ConcurrencyLimits;
use crate::import::{ImportService, ImportServiceImpl, LocationsValidator, LocationsValidatorImpl};
use crate::metastore::{
BaseRocksStoreFs, MetaStore, MetaStoreRpcClient, RocksMetaStore, RocksStoreConfig,
};
use crate::mysql::{MySqlServer, SqlAuthDefaultImpl, SqlAuthService};
use crate::queryplanner::query_executor::{QueryExecutor, QueryExecutorImpl};
use crate::queryplanner::{QueryPlanner, QueryPlannerImpl};
use crate::remotefs::cleanup::RemoteFsCleanup;
use crate::remotefs::gcs::GCSRemoteFs;
use crate::remotefs::minio::MINIORemoteFs;
use crate::remotefs::queue::QueueRemoteFs;
use crate::remotefs::s3::S3RemoteFs;
use crate::remotefs::{LocalDirRemoteFs, RemoteFs};
use crate::scheduler::SchedulerImpl;
use crate::sql::cache::SqlResultCache;
use crate::sql::{SqlService, SqlServiceImpl};
use crate::store::compaction::{CompactionService, CompactionServiceImpl};
use crate::store::{ChunkDataStore, ChunkStore, WALDataStore, WALStore};
use crate::streaming::kafka::{KafkaClientService, KafkaClientServiceImpl};
use crate::streaming::{KsqlClient, KsqlClientImpl, StreamingService, StreamingServiceImpl};
use crate::table::parquet::{CubestoreParquetMetadataCache, CubestoreParquetMetadataCacheImpl};
use crate::telemetry::tracing::{TracingHelper, TracingHelperImpl};
use crate::telemetry::{
start_agent_event_loop, start_track_event_loop, stop_agent_event_loop, stop_track_event_loop,
};
use crate::util::memory::{MemoryHandler, MemoryHandlerImpl};
use crate::CubeError;
use cuberockstore::rocksdb::{Options, DB};
use datafusion::cube_ext;
use datafusion::physical_plan::parquet::{LruParquetMetadataCache, NoopParquetMetadataCache};
use futures::future::join_all;
use log::Level;
use log::{debug, error};
use mockall::automock;
use simple_logger::SimpleLogger;
use std::fmt::Display;
use std::future::Future;
use std::path::{Path, PathBuf};
use std::pin::Pin;
use std::str::FromStr;
use std::sync::Arc;
use std::{env, fs};
use tokio::sync::broadcast;
use tokio::task::JoinHandle;
use tokio::time::{timeout_at, Duration, Instant};
#[derive(Clone)]
pub struct CubeServices {
pub injector: Arc<Injector>,
pub sql_service: Arc<dyn SqlService>,
pub rocks_meta_store: Option<Arc<RocksMetaStore>>,
pub rocks_cache_store: Option<Arc<LazyRocksCacheStore>>,
pub meta_store: Arc<dyn MetaStore>,
pub cluster: Arc<ClusterImpl>,
}
#[derive(Clone)]
pub struct WorkerServices {
pub query_executor: Arc<dyn QueryExecutor>,
}
impl CubeServices {
pub async fn start_processing_loops(&self) -> Result<(), CubeError> {
let futures = self.spawn_processing_loops().await?;
cube_ext::spawn(async move {
if let Err(e) = Self::wait_loops(futures).await {
error!("Error in processing loop: {}", e);
}
});
Ok(())
}
pub async fn wait_processing_loops(&self) -> Result<(), CubeError> {
Self::wait_loops(self.spawn_processing_loops().await?).await
}
pub async fn wait_loops(loops: Vec<LoopHandle>) -> Result<(), CubeError> {
join_all(loops)
.await
.into_iter()
.collect::<Result<Vec<_>, _>>()?;
Ok(())
}
async fn spawn_processing_loops(&self) -> Result<Vec<LoopHandle>, CubeError> {
let mut futures = Vec::new();
let cluster = self.cluster.clone();
futures.push(cube_ext::spawn(async move {
cluster.wait_processing_loops().await
}));
let remote_fs = self.injector.get_service_typed::<QueueRemoteFs>().await;
futures.push(cube_ext::spawn(async move {
QueueRemoteFs::wait_processing_loops(remote_fs.clone()).await
}));
if self.injector.has_service_typed::<RemoteFsCleanup>().await {
let cleanup = self.injector.get_service_typed::<RemoteFsCleanup>().await;
futures.push(cube_ext::spawn(async move {
cleanup.wait_local_cleanup_loop().await;
Ok(())
}));
}
if !self.cluster.is_select_worker() {
let rocks_meta_store = self.rocks_meta_store.clone().unwrap();
futures.push(cube_ext::spawn(async move {
rocks_meta_store.wait_upload_loop().await;
Ok(())
}));
let rocks_cache_store = self.rocks_cache_store.clone().unwrap();
futures.push(cube_ext::spawn(async move {
let loops = rocks_cache_store.spawn_processing_loops().await;
Self::wait_loops(loops).await?;
Ok(())
}));
let cluster = self.cluster.clone();
let (started_tx, started_rx) = tokio::sync::oneshot::channel();
futures.push(cube_ext::spawn(async move {
ClusterImpl::listen_on_metastore_port(cluster, started_tx).await
}));
started_rx.await?;
if self.injector.has_service_typed::<SchedulerImpl>().await {
let scheduler = self.injector.get_service_typed::<SchedulerImpl>().await;
futures.extend(scheduler.spawn_processing_loops());
}
if self
.injector
.has_service_typed::<CacheStoreSchedulerImpl>()
.await
{
let scheduler = self
.injector
.get_service_typed::<CacheStoreSchedulerImpl>()
.await;
futures.extend(scheduler.spawn_processing_loops());
}
if self.injector.has_service_typed::<MySqlServer>().await {
let mysql_server = self.injector.get_service_typed::<MySqlServer>().await;
futures.push(cube_ext::spawn(async move {
mysql_server.processing_loop().await
}));
}
if self.injector.has_service_typed::<HttpServer>().await {
let http_server = self.injector.get_service_typed::<HttpServer>().await;
futures.push(cube_ext::spawn(
async move { http_server.run_server().await },
));
}
} else {
let cluster = self.cluster.clone();
let (started_tx, started_rx) = tokio::sync::oneshot::channel();
futures.push(cube_ext::spawn(async move {
ClusterImpl::listen_on_worker_port(cluster, started_tx).await
}));
started_rx.await?;
let cluster = self.cluster.clone();
futures.push(cube_ext::spawn(async move {
cluster.warmup_select_worker().await;
Ok(())
}))
}
futures.push(cube_ext::spawn(async move {
start_track_event_loop().await;
Ok(())
}));
futures.push(cube_ext::spawn(async move {
start_agent_event_loop().await;
Ok(())
}));
Ok(futures)
}
pub async fn stop_processing_loops(&self) -> Result<(), CubeError> {
#[cfg(not(target_os = "windows"))]
self.cluster.stop_processing_loops().await?;
let remote_fs = self.injector.get_service_typed::<QueueRemoteFs>().await;
remote_fs.stop_processing_loops()?;
if let Some(rocks_meta) = &self.rocks_meta_store {
rocks_meta.stop_processing_loops().await;
}
if let Some(rocks_cache) = &self.rocks_cache_store {
rocks_cache.stop_processing_loops().await;
}
if self.injector.has_service_typed::<MySqlServer>().await {
self.injector
.get_service_typed::<MySqlServer>()
.await
.stop_processing()
.await?;
}
if self.injector.has_service_typed::<HttpServer>().await {
self.injector
.get_service_typed::<HttpServer>()
.await
.stop_processing()
.await;
}
if self.injector.has_service_typed::<SchedulerImpl>().await {
let scheduler = self.injector.get_service_typed::<SchedulerImpl>().await;
scheduler.stop_processing_loops()?;
}
if self.injector.has_service_typed::<RemoteFsCleanup>().await {
let cleanup = self.injector.get_service_typed::<RemoteFsCleanup>().await;
cleanup.stop();
}
if self
.injector
.has_service_typed::<CacheStoreSchedulerImpl>()
.await
{
let scheduler = self
.injector
.get_service_typed::<CacheStoreSchedulerImpl>()
.await;
scheduler.stop_processing_loops()?;
}
stop_track_event_loop().await;
stop_agent_event_loop().await;
Ok(())
}
}
pub struct ValidationMessages {
/// Hard errors, config cannot be used. Application must report these and exit.
pub errors: Vec<String>,
/// Must be reported to the user, but does not stop application from working.
pub warnings: Vec<String>,
}
impl ValidationMessages {
pub fn report_and_abort_on_errors(&self) {
for w in &self.warnings {
log::warn!("{}", w);
}
for e in &self.errors {
log::error!("{}", e);
}
if !self.errors.is_empty() {
log::error!("Cannot proceed with invalid configuration, exiting");
std::process::exit(1)
}
}
}
/// This method also looks at environment variables and assumes [c] was obtained by calling
/// `Config::default()`.
pub fn validate_config(c: &dyn ConfigObj) -> ValidationMessages {
let mut warnings = Vec::new();
let mut errors = Vec::new();
if is_router(c) && c.metastore_remote_address().is_some() {
errors.push(
"Router node cannot use remote metastore. Try removing CUBESTORE_META_ADDR".to_string(),
);
}
if !is_router(c) && !c.select_workers().contains(c.server_name()) {
warnings.push(format!("Current worker '{}' is missing in CUBESTORE_WORKERS. Please check CUBESTORE_SERVER_NAME and CUBESTORE_WORKERS variables", c.server_name()));
}
let mut router_vars = vec![
"CUBESTORE_HTTP_BIND_ADDR",
"CUBESTORE_HTTP_PORT",
"CUBESTORE_BIND_ADDR",
"CUBESTORE_PORT",
"CUBESTORE_META_BIND_ADDR",
"CUBESTORE_META_PORT",
];
router_vars.retain(|v| env::var(v).is_ok());
if !is_router(c) && !router_vars.is_empty() {
warnings.push(format!(
"The following router variable{} ignored on worker node: {}",
if 1 < router_vars.len() { "s" } else { "" },
router_vars.join(", ")
));
}
let mut remote_vars = vec![
"CUBESTORE_MINIO_BUCKET",
"CUBESTORE_S3_BUCKET",
"CUBESTORE_GCS_BUCKET",
"CUBESTORE_REMOTE_DIR",
];
remote_vars.retain(|v| env::var(v).is_ok());
if 1 < remote_vars.len() {
warnings.push(format!(
"{} variables specified together. Using {}",
remote_vars.join(" and "),
remote_vars[0],
));
}
ValidationMessages { errors, warnings }
}
#[derive(Debug, Clone)]
pub enum FileStoreProvider {
Local,
Filesystem {
remote_dir: Option<PathBuf>,
},
S3 {
region: String,
bucket_name: String,
sub_path: Option<String>,
},
GCS {
bucket_name: String,
sub_path: Option<String>,
},
MINIO {
bucket_name: String,
sub_path: Option<String>,
},
}
#[derive(Clone)]
pub struct Config {
config_obj: Arc<ConfigObjImpl>,
injector: Arc<Injector>,
}
#[automock]
pub trait ConfigObj: DIService {
fn partition_split_threshold(&self) -> u64;
fn partition_size_split_threshold_bytes(&self) -> u64;
fn max_partition_split_threshold(&self) -> u64;
fn compaction_chunks_total_size_threshold(&self) -> u64;
fn compaction_chunks_count_threshold(&self) -> u64;
fn compaction_chunks_in_memory_size_threshold(&self) -> u64;
fn compaction_chunks_max_lifetime_threshold(&self) -> u64;
fn compaction_in_memory_chunks_max_lifetime_threshold(&self) -> u64;
fn compaction_in_memory_chunks_size_limit(&self) -> u64;
fn compaction_in_memory_chunks_total_size_limit(&self) -> u64;
fn compaction_in_memory_chunks_count_threshold(&self) -> usize;
fn compaction_in_memory_chunks_ratio_threshold(&self) -> u64;
fn compaction_in_memory_chunks_ratio_check_threshold(&self) -> u64;
fn compaction_in_memory_chunks_schedule_period_secs(&self) -> u64;
fn wal_split_threshold(&self) -> u64;
fn select_worker_pool_size(&self) -> usize;
fn select_worker_idle_timeout(&self) -> u64;
fn job_runners_count(&self) -> usize;
fn long_term_job_runners_count(&self) -> usize;
fn bind_address(&self) -> &Option<String>;
fn status_bind_address(&self) -> &Option<String>;
fn http_bind_address(&self) -> &Option<String>;
fn query_timeout(&self) -> u64;
fn not_used_timeout(&self) -> u64;
fn in_memory_not_used_timeout(&self) -> u64;
fn import_job_timeout(&self) -> u64;
fn meta_store_snapshot_interval(&self) -> u64;
fn meta_store_log_upload_interval(&self) -> u64;
fn meta_store_log_upload_size_limit(&self) -> u64;
fn gc_loop_interval(&self) -> u64;
fn stale_stream_timeout(&self) -> u64;
fn select_workers(&self) -> &Vec<String>;
fn worker_bind_address(&self) -> &Option<String>;
fn metastore_bind_address(&self) -> &Option<String>;
fn metastore_rocksdb_config(&self) -> &RocksStoreConfig;
fn metastore_remote_address(&self) -> &Option<String>;
fn cachestore_log_upload_interval(&self) -> u64;
fn cachestore_log_enabled(&self) -> bool;
fn cachestore_rocksdb_config(&self) -> &RocksStoreConfig;
fn cachestore_gc_loop_interval(&self) -> u64;
fn cachestore_cache_eviction_loop_interval(&self) -> u64;
fn cachestore_cache_ttl_persist_loop_interval(&self) -> u64;
fn cachestore_cache_threshold_to_force_eviction(&self) -> u8;
fn cachestore_cache_max_size(&self) -> u64;
fn cachestore_cache_max_entry_size(&self) -> usize;
fn cachestore_cache_compaction_trigger_size(&self) -> u64;
fn cachestore_cache_max_keys(&self) -> u32;
fn cachestore_cache_eviction_policy(&self) -> CacheEvictionPolicy;
fn cachestore_cache_eviction_batch_size(&self) -> usize;
fn cachestore_cache_eviction_below_threshold(&self) -> u8;
fn cachestore_cache_persist_batch_size(&self) -> usize;
fn cachestore_cache_eviction_min_ttl_threshold(&self) -> u32;
fn cachestore_cache_ttl_notify_channel(&self) -> usize;
fn cachestore_cache_ttl_buffer_max_size(&self) -> usize;
fn cachestore_queue_results_expire(&self) -> u64;
fn cachestore_metrics_interval(&self) -> u64;
fn download_concurrency(&self) -> u64;
fn upload_concurrency(&self) -> u64;
fn data_dir(&self) -> &PathBuf;
fn connection_timeout(&self) -> u64;
fn server_name(&self) -> &String;
fn max_ingestion_data_frames(&self) -> usize;
fn upload_to_remote(&self) -> bool;
fn enable_topk(&self) -> bool;
fn enable_remove_orphaned_remote_files(&self) -> bool;
fn enable_startup_warmup(&self) -> bool;
fn malloc_trim_every_secs(&self) -> u64;
fn query_cache_max_capacity_bytes(&self) -> u64;
fn query_cache_time_to_idle_secs(&self) -> Option<u64>;
fn metadata_cache_max_capacity_bytes(&self) -> u64;
fn metadata_cache_time_to_idle_secs(&self) -> u64;
fn stream_replay_check_interval_secs(&self) -> u64;
fn check_ws_orphaned_messages_interval_secs(&self) -> u64;
fn drop_ws_processing_messages_after_secs(&self) -> u64;
fn drop_ws_complete_messages_after_secs(&self) -> u64;
fn skip_kafka_parsing_errors(&self) -> bool;
fn dump_dir(&self) -> &Option<PathBuf>;
fn minimum_metastore_snapshots_count(&self) -> u64;
fn metastore_snapshots_lifetime(&self) -> u64;
fn minimum_cachestore_snapshots_count(&self) -> u64;
fn cachestore_snapshots_lifetime(&self) -> u64;
fn max_disk_space(&self) -> u64;
fn max_disk_space_per_worker(&self) -> u64;
fn disk_space_cache_duration_secs(&self) -> u64;
fn transport_max_message_size(&self) -> usize;
fn transport_max_frame_size(&self) -> usize;
fn local_files_cleanup_interval_secs(&self) -> u64;
fn remote_files_cleanup_interval_secs(&self) -> u64;
fn local_files_cleanup_size_threshold(&self) -> u64;
fn local_files_cleanup_delay_secs(&self) -> u64;
fn remote_files_cleanup_delay_secs(&self) -> u64;
fn remote_files_cleanup_batch_size(&self) -> u64;
fn create_table_max_retries(&self) -> u64;
}
#[derive(Debug, Clone)]
pub struct ConfigObjImpl {
pub partition_split_threshold: u64,
pub partition_size_split_threshold_bytes: u64,
pub max_partition_split_threshold: u64,
pub compaction_chunks_total_size_threshold: u64,
pub compaction_chunks_count_threshold: u64,
pub compaction_chunks_in_memory_size_threshold: u64,
pub compaction_chunks_max_lifetime_threshold: u64,
pub compaction_in_memory_chunks_max_lifetime_threshold: u64,
pub compaction_in_memory_chunks_size_limit: u64,
pub compaction_in_memory_chunks_total_size_limit: u64,
pub compaction_in_memory_chunks_count_threshold: usize,
pub compaction_in_memory_chunks_ratio_threshold: u64,
pub compaction_in_memory_chunks_ratio_check_threshold: u64,
pub compaction_in_memory_chunks_schedule_period_secs: u64,
pub wal_split_threshold: u64,
pub data_dir: PathBuf,
pub dump_dir: Option<PathBuf>,
pub store_provider: FileStoreProvider,
pub select_worker_pool_size: usize,
pub select_worker_idle_timeout: u64,
pub job_runners_count: usize,
pub long_term_job_runners_count: usize,
pub bind_address: Option<String>,
pub status_bind_address: Option<String>,
pub http_bind_address: Option<String>,
pub query_timeout: u64,
/// Must be set to 2*query_timeout in prod, only for overrides in tests.
pub not_used_timeout: u64,
pub in_memory_not_used_timeout: u64,
pub import_job_timeout: u64,
pub meta_store_log_upload_interval: u64,
pub meta_store_log_upload_size_limit: u64,
pub meta_store_snapshot_interval: u64,
pub gc_loop_interval: u64,
pub stale_stream_timeout: u64,
pub select_workers: Vec<String>,
pub worker_bind_address: Option<String>,
pub metastore_bind_address: Option<String>,
pub metastore_remote_address: Option<String>,
pub metastore_rocks_store_config: RocksStoreConfig,
pub cachestore_log_upload_interval: u64,
pub cachestore_log_enabled: bool,
pub cachestore_rocks_store_config: RocksStoreConfig,
pub cachestore_gc_loop_interval: u64,
pub cachestore_cache_eviction_loop_interval: u64,
pub cachestore_cache_ttl_persist_loop_interval: u64,
pub cachestore_cache_max_size: u64,
pub cachestore_cache_max_entry_size: usize,
pub cachestore_cache_compaction_trigger_size: u64,
pub cachestore_cache_threshold_to_force_eviction: u8,
pub cachestore_queue_results_expire: u64,
pub cachestore_metrics_interval: u64,
pub cachestore_cache_max_keys: u32,
pub cachestore_cache_policy: CacheEvictionPolicy,
pub cachestore_cache_eviction_batch_size: usize,
pub cachestore_cache_eviction_below_threshold: u8,
pub cachestore_cache_persist_batch_size: usize,
pub cachestore_cache_eviction_min_ttl_threshold: u32,
pub cachestore_cache_ttl_notify_channel: usize,
pub cachestore_cache_ttl_buffer_max_size: usize,
pub upload_concurrency: u64,
pub download_concurrency: u64,
pub connection_timeout: u64,
pub server_name: String,
pub max_ingestion_data_frames: usize,
pub upload_to_remote: bool,
pub enable_topk: bool,
pub enable_remove_orphaned_remote_files: bool,
pub enable_startup_warmup: bool,
pub malloc_trim_every_secs: u64,
pub query_cache_max_capacity_bytes: u64,
pub query_cache_time_to_idle_secs: Option<u64>,
pub metadata_cache_max_capacity_bytes: u64,
pub metadata_cache_time_to_idle_secs: u64,
pub stream_replay_check_interval_secs: u64,
pub check_ws_orphaned_messages_interval_secs: u64,
pub drop_ws_processing_messages_after_secs: u64,
pub drop_ws_complete_messages_after_secs: u64,
pub skip_kafka_parsing_errors: bool,
pub minimum_metastore_snapshots_count: u64,
pub metastore_snapshots_lifetime: u64,
pub minimum_cachestore_snapshots_count: u64,
pub cachestore_snapshots_lifetime: u64,
pub max_disk_space: u64,
pub max_disk_space_per_worker: u64,
pub disk_space_cache_duration_secs: u64,
pub transport_max_message_size: usize,
pub transport_max_frame_size: usize,
pub local_files_cleanup_interval_secs: u64,
pub remote_files_cleanup_interval_secs: u64,
pub local_files_cleanup_size_threshold: u64,
pub local_files_cleanup_delay_secs: u64,
pub remote_files_cleanup_delay_secs: u64,
pub remote_files_cleanup_batch_size: u64,
pub create_table_max_retries: u64,
}
crate::di_service!(ConfigObjImpl, [ConfigObj]);
crate::di_service!(MockConfigObj, [ConfigObj]);
impl ConfigObj for ConfigObjImpl {
fn partition_split_threshold(&self) -> u64 {
self.partition_split_threshold
}
fn partition_size_split_threshold_bytes(&self) -> u64 {
self.partition_size_split_threshold_bytes
}
fn max_partition_split_threshold(&self) -> u64 {
self.max_partition_split_threshold
}
fn compaction_chunks_total_size_threshold(&self) -> u64 {
self.compaction_chunks_total_size_threshold
}
fn compaction_chunks_count_threshold(&self) -> u64 {
self.compaction_chunks_count_threshold
}
fn compaction_chunks_in_memory_size_threshold(&self) -> u64 {
self.compaction_chunks_in_memory_size_threshold
}
fn compaction_chunks_max_lifetime_threshold(&self) -> u64 {
self.compaction_chunks_max_lifetime_threshold
}
fn compaction_in_memory_chunks_max_lifetime_threshold(&self) -> u64 {
self.compaction_in_memory_chunks_max_lifetime_threshold
}
fn compaction_in_memory_chunks_size_limit(&self) -> u64 {
self.compaction_in_memory_chunks_size_limit
}
fn compaction_in_memory_chunks_total_size_limit(&self) -> u64 {
self.compaction_in_memory_chunks_total_size_limit
}
fn compaction_in_memory_chunks_count_threshold(&self) -> usize {
self.compaction_in_memory_chunks_count_threshold
}
fn compaction_in_memory_chunks_ratio_threshold(&self) -> u64 {
self.compaction_in_memory_chunks_ratio_threshold
}
fn compaction_in_memory_chunks_ratio_check_threshold(&self) -> u64 {
self.compaction_in_memory_chunks_ratio_check_threshold
}
fn compaction_in_memory_chunks_schedule_period_secs(&self) -> u64 {
self.compaction_in_memory_chunks_schedule_period_secs
}
fn wal_split_threshold(&self) -> u64 {
self.wal_split_threshold
}
fn select_worker_pool_size(&self) -> usize {
self.select_worker_pool_size
}
fn select_worker_idle_timeout(&self) -> u64 {
self.select_worker_idle_timeout
}
fn job_runners_count(&self) -> usize {
self.job_runners_count
}
fn long_term_job_runners_count(&self) -> usize {
self.long_term_job_runners_count
}
fn bind_address(&self) -> &Option<String> {
&self.bind_address
}
fn status_bind_address(&self) -> &Option<String> {
&self.status_bind_address
}
fn http_bind_address(&self) -> &Option<String> {
&self.http_bind_address
}
fn query_timeout(&self) -> u64 {
self.query_timeout
}
fn not_used_timeout(&self) -> u64 {
self.not_used_timeout
}
fn in_memory_not_used_timeout(&self) -> u64 {
self.in_memory_not_used_timeout
}
fn import_job_timeout(&self) -> u64 {
self.import_job_timeout
}
fn meta_store_snapshot_interval(&self) -> u64 {
self.meta_store_snapshot_interval
}
fn meta_store_log_upload_interval(&self) -> u64 {
self.meta_store_log_upload_interval
}
fn meta_store_log_upload_size_limit(&self) -> u64 {
self.meta_store_log_upload_size_limit
}
fn gc_loop_interval(&self) -> u64 {
self.gc_loop_interval
}
fn stale_stream_timeout(&self) -> u64 {
self.stale_stream_timeout
}
fn select_workers(&self) -> &Vec<String> {
&self.select_workers
}
fn worker_bind_address(&self) -> &Option<String> {
&self.worker_bind_address
}
fn metastore_bind_address(&self) -> &Option<String> {
&self.metastore_bind_address
}
fn metastore_rocksdb_config(&self) -> &RocksStoreConfig {
&self.metastore_rocks_store_config
}
fn metastore_remote_address(&self) -> &Option<String> {
&self.metastore_remote_address
}
fn cachestore_log_upload_interval(&self) -> u64 {
self.cachestore_log_upload_interval
}
fn cachestore_log_enabled(&self) -> bool {
self.cachestore_log_enabled
}
fn cachestore_rocksdb_config(&self) -> &RocksStoreConfig {
&self.cachestore_rocks_store_config
}
fn cachestore_gc_loop_interval(&self) -> u64 {
self.cachestore_gc_loop_interval
}
fn cachestore_cache_eviction_loop_interval(&self) -> u64 {
self.cachestore_cache_eviction_loop_interval
}
fn cachestore_cache_ttl_persist_loop_interval(&self) -> u64 {
self.cachestore_cache_ttl_persist_loop_interval
}
fn cachestore_cache_max_size(&self) -> u64 {
self.cachestore_cache_max_size
}
fn cachestore_cache_max_entry_size(&self) -> usize {
self.cachestore_cache_max_entry_size
}
fn cachestore_cache_compaction_trigger_size(&self) -> u64 {
self.cachestore_cache_compaction_trigger_size
}
fn cachestore_cache_threshold_to_force_eviction(&self) -> u8 {
self.cachestore_cache_threshold_to_force_eviction
}
fn cachestore_cache_max_keys(&self) -> u32 {
self.cachestore_cache_max_keys
}
fn cachestore_cache_eviction_policy(&self) -> CacheEvictionPolicy {
self.cachestore_cache_policy.clone()
}
fn cachestore_cache_eviction_batch_size(&self) -> usize {
self.cachestore_cache_eviction_batch_size
}
fn cachestore_cache_persist_batch_size(&self) -> usize {
self.cachestore_cache_persist_batch_size
}
fn cachestore_cache_eviction_min_ttl_threshold(&self) -> u32 {
self.cachestore_cache_eviction_min_ttl_threshold
}
fn cachestore_cache_ttl_notify_channel(&self) -> usize {
self.cachestore_cache_ttl_notify_channel
}
fn cachestore_cache_ttl_buffer_max_size(&self) -> usize {
self.cachestore_cache_ttl_buffer_max_size
}
fn cachestore_queue_results_expire(&self) -> u64 {
self.cachestore_queue_results_expire
}
fn cachestore_metrics_interval(&self) -> u64 {
self.cachestore_metrics_interval
}
fn download_concurrency(&self) -> u64 {
self.download_concurrency
}
fn upload_concurrency(&self) -> u64 {
self.upload_concurrency
}
fn data_dir(&self) -> &PathBuf {
&self.data_dir
}
fn connection_timeout(&self) -> u64 {
self.connection_timeout
}
fn server_name(&self) -> &String {
&self.server_name
}
fn max_ingestion_data_frames(&self) -> usize {
self.max_ingestion_data_frames
}
fn upload_to_remote(&self) -> bool {
self.upload_to_remote
}
fn enable_topk(&self) -> bool {
self.enable_topk
}
fn enable_remove_orphaned_remote_files(&self) -> bool {
self.enable_remove_orphaned_remote_files
}
fn enable_startup_warmup(&self) -> bool {
self.enable_startup_warmup
}
fn malloc_trim_every_secs(&self) -> u64 {
self.malloc_trim_every_secs
}
fn query_cache_max_capacity_bytes(&self) -> u64 {
self.query_cache_max_capacity_bytes
}
fn query_cache_time_to_idle_secs(&self) -> Option<u64> {
self.query_cache_time_to_idle_secs
}
fn metadata_cache_max_capacity_bytes(&self) -> u64 {
self.metadata_cache_max_capacity_bytes
}
fn metadata_cache_time_to_idle_secs(&self) -> u64 {
self.metadata_cache_time_to_idle_secs
}
fn stream_replay_check_interval_secs(&self) -> u64 {
self.stream_replay_check_interval_secs
}
fn check_ws_orphaned_messages_interval_secs(&self) -> u64 {
self.check_ws_orphaned_messages_interval_secs
}
fn drop_ws_processing_messages_after_secs(&self) -> u64 {
self.drop_ws_processing_messages_after_secs
}
fn drop_ws_complete_messages_after_secs(&self) -> u64 {
self.drop_ws_complete_messages_after_secs
}
fn skip_kafka_parsing_errors(&self) -> bool {
self.skip_kafka_parsing_errors
}
fn dump_dir(&self) -> &Option<PathBuf> {
&self.dump_dir
}
fn minimum_metastore_snapshots_count(&self) -> u64 {
self.minimum_metastore_snapshots_count
}
fn metastore_snapshots_lifetime(&self) -> u64 {
self.metastore_snapshots_lifetime
}
fn minimum_cachestore_snapshots_count(&self) -> u64 {
self.minimum_cachestore_snapshots_count
}
fn cachestore_snapshots_lifetime(&self) -> u64 {
self.cachestore_snapshots_lifetime
}
fn max_disk_space(&self) -> u64 {
self.max_disk_space
}
fn max_disk_space_per_worker(&self) -> u64 {
self.max_disk_space_per_worker
}
fn disk_space_cache_duration_secs(&self) -> u64 {
self.disk_space_cache_duration_secs
}
fn transport_max_message_size(&self) -> usize {
self.transport_max_message_size
}
fn transport_max_frame_size(&self) -> usize {
self.transport_max_frame_size
}
fn local_files_cleanup_interval_secs(&self) -> u64 {
self.local_files_cleanup_interval_secs
}
fn remote_files_cleanup_interval_secs(&self) -> u64 {
self.remote_files_cleanup_interval_secs
}
fn local_files_cleanup_size_threshold(&self) -> u64 {
self.local_files_cleanup_size_threshold
}
fn local_files_cleanup_delay_secs(&self) -> u64 {
self.local_files_cleanup_delay_secs
}
fn remote_files_cleanup_delay_secs(&self) -> u64 {
self.remote_files_cleanup_delay_secs