fn specialize(self) -> SpecializedConfig {
        let Self {
            logging_config,
            tracing_config,
            max_http_request_size,
            database_directory,
            dsn,
            postgres_schema_name,
            pause_ingest_size_bytes,
            persist_memory_threshold_bytes,
            persist_partition_size_threshold_bytes,
            persist_partition_age_threshold_seconds,
            persist_partition_cold_threshold_seconds,
            router_http_bind_address,
            router_grpc_bind_address,
            querier_grpc_bind_address,
            ingester_grpc_bind_address,
            compactor_grpc_bind_address,
            querier_ram_pool_bytes,
            querier_max_concurrent_queries,
        } = self;

        let object_store_config = ObjectStoreConfig::new(database_directory.clone());
        let write_buffer_config = WriteBufferConfig::new(QUERY_POOL_NAME, database_directory);
        let catalog_dsn = dsn
            .map(|postgres_url| CatalogDsnConfig::new_postgres(postgres_url, postgres_schema_name))
            .unwrap_or_else(CatalogDsnConfig::new_memory);

        let router_run_config = RunConfig::new(
            logging_config,
            tracing_config,
            router_http_bind_address,
            router_grpc_bind_address,
            max_http_request_size,
            object_store_config,
        );

        let querier_run_config = router_run_config
            .clone()
            .with_grpc_bind_address(querier_grpc_bind_address);

        let ingester_run_config = router_run_config
            .clone()
            .with_grpc_bind_address(ingester_grpc_bind_address);

        let compactor_run_config = router_run_config
            .clone()
            .with_grpc_bind_address(compactor_grpc_bind_address);

        // All-in-one mode only supports one write buffer partition.
        let write_buffer_partition_range_start = 0;
        let write_buffer_partition_range_end = 0;

        // Use whatever data is available in the write buffer rather than erroring if the sequence
        // number has not been retained in the write buffer.
        let skip_to_oldest_available = true;

        let ingester_config = IngesterConfig {
            write_buffer_partition_range_start,
            write_buffer_partition_range_end,
            pause_ingest_size_bytes,
            persist_memory_threshold_bytes,
            persist_partition_size_threshold_bytes,
            persist_partition_age_threshold_seconds,
            persist_partition_cold_threshold_seconds,
            skip_to_oldest_available,
            test_flight_do_get_panic: 0,
            concurrent_request_limit: 10,
        };

        // create a CompactorConfig for the all in one server based on
        // settings from other configs. Can't use `#clap(flatten)` as the
        // parameters are redundant with ingester's
        let compactor_config = CompactorConfig {
            topic: QUERY_POOL_NAME.to_string(),
            write_buffer_partition_range_start,
            write_buffer_partition_range_end,
            split_percentage: 90,
            max_concurrent_compaction_size_bytes: 100000,
            compaction_max_size_bytes: 100000,
            compaction_max_file_count: 10,
        };

        let querier_config = QuerierConfig {
            num_query_threads: None,    // will be ignored
            ingester_addresses: vec![], // will be ignored
            ram_pool_bytes: querier_ram_pool_bytes,
            max_concurrent_queries: querier_max_concurrent_queries,
        };

        SpecializedConfig {
            router_run_config,
            querier_run_config,

            ingester_run_config,
            compactor_run_config,

            catalog_dsn,
            write_buffer_config,
            ingester_config,
            compactor_config,
            querier_config,
        }
    }
/// Get a specialized run config to use for each service
Get a specialized run config to use for each service
Get a specialized run config to use for each service
fn specialize(self) -> SpecializedConfig {
        let Self {
            logging_config,
            tracing_config,
            max_http_request_size,
            database_directory,
            dsn,
            postgres_schema_name,
            pause_ingest_size_bytes,
            persist_memory_threshold_bytes,
            persist_partition_size_threshold_bytes,
            persist_partition_age_threshold_seconds,
            persist_partition_cold_threshold_seconds,
            router_http_bind_address,
            router_grpc_bind_address,
            querier_grpc_bind_address,
            ingester_grpc_bind_address,
            compactor_grpc_bind_address,
            querier_ram_pool_bytes,
            querier_max_concurrent_queries,
        } = self;
        let object_store_config = ObjectStoreConfig::new(database_directory.clone());
        let write_buffer_config = WriteBufferConfig::new(QUERY_POOL_NAME, database_directory);
        let catalog_dsn = dsn
            .map(|postgres_url| CatalogDsnConfig::new_postgres(postgres_url, postgres_schema_name))
            .unwrap_or_else(CatalogDsnConfig::new_memory);
        let router_run_config = RunConfig::new(
            logging_config,
            tracing_config,
            router_http_bind_address,
            router_grpc_bind_address,
            max_http_request_size,
            object_store_config,
        );
        let querier_run_config = router_run_config
            .clone()
            .with_grpc_bind_address(querier_grpc_bind_address);
        let ingester_run_config = router_run_config
            .clone()
            .with_grpc_bind_address(ingester_grpc_bind_address);
        let compactor_run_config = router_run_config
            .clone()
            .with_grpc_bind_address(compactor_grpc_bind_address);
        // All-in-one mode only supports one write buffer partition.
        let write_buffer_partition_range_start = 0;
        let write_buffer_partition_range_end = 0;
        // Use whatever data is available in the write buffer rather than erroring if the sequence
        // number has not been retained in the write buffer.
        let skip_to_oldest_available = true;
        let ingester_config = IngesterConfig {
            write_buffer_partition_range_start,
            write_buffer_partition_range_end,
            pause_ingest_size_bytes,
            persist_memory_threshold_bytes,
            persist_partition_size_threshold_bytes,
            persist_partition_age_threshold_seconds,
            persist_partition_cold_threshold_seconds,
            skip_to_oldest_available,
            test_flight_do_get_panic: 0,
            concurrent_request_limit: 10,
        };
        // create a CompactorConfig for the all in one server based on
        // settings from other configs. Can't use `#clap(flatten)` as the
        // parameters are redundant with ingester's
        let compactor_config = CompactorConfig {
            topic: QUERY_POOL_NAME.to_string(),
            write_buffer_partition_range_start,
            write_buffer_partition_range_end,
            split_percentage: 90,
            max_concurrent_compaction_size_bytes: 100000,
            compaction_max_size_bytes: 100000,
            compaction_max_file_count: 10,
        };
        let querier_config = QuerierConfig {
            num_query_threads: None,    // will be ignored
            ingester_addresses: vec![], // will be ignored
            ram_pool_bytes: querier_ram_pool_bytes,
            max_concurrent_queries: querier_max_concurrent_queries,
        };
        SpecializedConfig {
            router_run_config,
            querier_run_config,
            ingester_run_config,
            compactor_run_config,
            catalog_dsn,
            write_buffer_config,
            ingester_config,
            compactor_config,
            querier_config,
        }
    }
fn specialize ( self ) -> SpecializedConfig { let Self { logging_config , tracing_config , max_http_request_size , database_directory , dsn , postgres_schema_name , pause_ingest_size_bytes , persist_memory_threshold_bytes , persist_partition_size_threshold_bytes , persist_partition_age_threshold_seconds , persist_partition_cold_threshold_seconds , router_http_bind_address , router_grpc_bind_address , querier_grpc_bind_address , ingester_grpc_bind_address , compactor_grpc_bind_address , querier_ram_pool_bytes , querier_max_concurrent_queries , } = self ; let object_store_config = ObjectStoreConfig :: new ( database_directory . clone ( ) ) ; let write_buffer_config = WriteBufferConfig :: new ( QUERY_POOL_NAME , database_directory ) ; let catalog_dsn = dsn . map ( | postgres_url | CatalogDsnConfig :: new_postgres ( postgres_url , postgres_schema_name ) ) . unwrap_or_else ( CatalogDsnConfig :: new_memory ) ; let router_run_config = RunConfig :: new ( logging_config , tracing_config , router_http_bind_address , router_grpc_bind_address , max_http_request_size , object_store_config , ) ; let querier_run_config = router_run_config . clone ( ) . with_grpc_bind_address ( querier_grpc_bind_address ) ; let ingester_run_config = router_run_config . clone ( ) . with_grpc_bind_address ( ingester_grpc_bind_address ) ; let compactor_run_config = router_run_config . clone ( ) . with_grpc_bind_address ( compactor_grpc_bind_address ) ; // All-in-one mode only supports one write buffer partition. let write_buffer_partition_range_start = 0 ; let write_buffer_partition_range_end = 0 ; // Use whatever data is available in the write buffer rather than erroring if the sequence // number has not been retained in the write buffer. let skip_to_oldest_available = true ; let ingester_config = IngesterConfig { write_buffer_partition_range_start , write_buffer_partition_range_end , pause_ingest_size_bytes , persist_memory_threshold_bytes , persist_partition_size_threshold_bytes , persist_partition_age_threshold_seconds , persist_partition_cold_threshold_seconds , skip_to_oldest_available , test_flight_do_get_panic : 0 , concurrent_request_limit : 10 , } ; // create a CompactorConfig for the all in one server based on // settings from other configs. Can't use `#clap(flatten)` as the // parameters are redundant with ingester's let compactor_config = CompactorConfig { topic : QUERY_POOL_NAME . to_string ( ) , write_buffer_partition_range_start , write_buffer_partition_range_end , split_percentage : 90 , max_concurrent_compaction_size_bytes : 100000 , compaction_max_size_bytes : 100000 , compaction_max_file_count : 10 , } ; let querier_config = QuerierConfig { num_query_threads : None , // will be ignored ingester_addresses : vec ! [ ] , // will be ignored ram_pool_bytes : querier_ram_pool_bytes , max_concurrent_queries : querier_max_concurrent_queries , } ; SpecializedConfig { router_run_config , querier_run_config , ingester_run_config , compactor_run_config , catalog_dsn , write_buffer_config , ingester_config , compactor_config , querier_config , } }
Get a specialized run config to use for each service
Get a specialized run config to use for each service
self
self