diff --git a/src/batch/src/executor/generic_exchange.rs b/src/batch/src/executor/generic_exchange.rs index 4a50be2c2665a..28a3f04857555 100644 --- a/src/batch/src/executor/generic_exchange.rs +++ b/src/batch/src/executor/generic_exchange.rs @@ -36,7 +36,7 @@ use crate::monitor::BatchMetricsWithTaskLabels; pub struct GenericExchangeExecutor { proto_sources: Vec, - /// Mock-able CreateSource. + /// Mock-able `CreateSource`. source_creators: Vec, sequential: bool, context: C, diff --git a/src/batch/src/executor/join/hash_join.rs b/src/batch/src/executor/join/hash_join.rs index bbebc114ae628..ea8959849d017 100644 --- a/src/batch/src/executor/join/hash_join.rs +++ b/src/batch/src/executor/join/hash_join.rs @@ -56,7 +56,7 @@ pub struct HashJoinExecutor { original_schema: Schema, /// Output schema after applying `output_indices` schema: Schema, - /// output_indices are the indices of the columns that we needed. + /// `output_indices` are the indices of the columns that we needed. output_indices: Vec, /// Left child executor probe_side_source: BoxedExecutor, diff --git a/src/batch/src/executor/join/nested_loop_join.rs b/src/batch/src/executor/join/nested_loop_join.rs index 0cc875ceaad10..9ecd1fe1709e5 100644 --- a/src/batch/src/executor/join/nested_loop_join.rs +++ b/src/batch/src/executor/join/nested_loop_join.rs @@ -52,7 +52,7 @@ pub struct NestedLoopJoinExecutor { /// Actual output schema schema: Schema, /// We may only need certain columns. - /// output_indices are the indices of the columns that we needed. + /// `output_indices` are the indices of the columns that we needed. output_indices: Vec, /// Left child executor left_child: BoxedExecutor, diff --git a/src/batch/src/executor/merge_sort_exchange.rs b/src/batch/src/executor/merge_sort_exchange.rs index a1131ff09b8d9..493a58cf6bd3f 100644 --- a/src/batch/src/executor/merge_sort_exchange.rs +++ b/src/batch/src/executor/merge_sort_exchange.rs @@ -45,7 +45,7 @@ pub struct MergeSortExchangeExecutorImpl { min_heap: MemMonitoredHeap, proto_sources: Vec, sources: Vec, // impl - /// Mock-able CreateSource. + /// Mock-able `CreateSource`. source_creators: Vec, schema: Schema, task_id: TaskId, diff --git a/src/batch/src/task/task_execution.rs b/src/batch/src/task/task_execution.rs index 89f4846307ea3..f33911a5e4ca3 100644 --- a/src/batch/src/task/task_execution.rs +++ b/src/batch/src/task/task_execution.rs @@ -681,7 +681,7 @@ impl BatchTaskExecution { } let error = error.map(Arc::new); - *self.failure.lock() = error.clone(); + self.failure.lock().clone_from(&error); let err_str = error.as_ref().map(|e| e.to_report_string()); if let Err(e) = sender.close(error).await { match e { diff --git a/src/cmd_all/src/single_node.rs b/src/cmd_all/src/single_node.rs index 8b6470514bf63..0dda3b5b92519 100644 --- a/src/cmd_all/src/single_node.rs +++ b/src/cmd_all/src/single_node.rs @@ -84,14 +84,14 @@ pub struct NodeSpecificOpts { // ------- Meta Node Options ------- /// The HTTP REST-API address of the Prometheus instance associated to this cluster. - /// This address is used to serve PromQL queries to Prometheus. + /// This address is used to serve `PromQL` queries to Prometheus. /// It is also used by Grafana Dashboard Service to fetch metrics and visualize them. #[clap(long)] pub prometheus_endpoint: Option, /// The additional selector used when querying Prometheus. /// - /// The format is same as PromQL. Example: `instance="foo",namespace="bar"` + /// The format is same as `PromQL`. Example: `instance="foo",namespace="bar"` #[clap(long)] pub prometheus_selector: Option, @@ -111,15 +111,21 @@ pub fn map_single_node_opts_to_standalone_opts(opts: SingleNodeOpts) -> ParsedSt if let Some(prometheus_listener_addr) = &opts.prometheus_listener_addr { meta_opts.prometheus_listener_addr = Some(prometheus_listener_addr.clone()); - compute_opts.prometheus_listener_addr = prometheus_listener_addr.clone(); - frontend_opts.prometheus_listener_addr = prometheus_listener_addr.clone(); - compactor_opts.prometheus_listener_addr = prometheus_listener_addr.clone(); + compute_opts + .prometheus_listener_addr + .clone_from(prometheus_listener_addr); + frontend_opts + .prometheus_listener_addr + .clone_from(prometheus_listener_addr); + compactor_opts + .prometheus_listener_addr + .clone_from(prometheus_listener_addr); } if let Some(config_path) = &opts.config_path { - meta_opts.config_path = config_path.clone(); - compute_opts.config_path = config_path.clone(); - frontend_opts.config_path = config_path.clone(); - compactor_opts.config_path = config_path.clone(); + meta_opts.config_path.clone_from(config_path); + compute_opts.config_path.clone_from(config_path); + frontend_opts.config_path.clone_from(config_path); + compactor_opts.config_path.clone_from(config_path); } let store_directory = opts.store_directory.unwrap_or_else(|| { @@ -160,7 +166,7 @@ pub fn map_single_node_opts_to_standalone_opts(opts: SingleNodeOpts) -> ParsedSt compute_opts.listen_addr = "0.0.0.0:5688".to_string(); compactor_opts.listen_addr = "0.0.0.0:6660".to_string(); if let Some(frontend_addr) = &opts.node_opts.listen_addr { - frontend_opts.listen_addr = frontend_addr.clone(); + frontend_opts.listen_addr.clone_from(frontend_addr); } // Set Meta addresses for all nodes (force to override) diff --git a/src/cmd_all/src/standalone.rs b/src/cmd_all/src/standalone.rs index e6816a208d8d0..8c4f19f857122 100644 --- a/src/cmd_all/src/standalone.rs +++ b/src/cmd_all/src/standalone.rs @@ -123,27 +123,33 @@ pub fn parse_standalone_opt_args(opts: &StandaloneOpts) -> ParsedStandaloneOpts if let Some(config_path) = opts.config_path.as_ref() { if let Some(meta_opts) = meta_opts.as_mut() { - meta_opts.config_path = config_path.clone(); + meta_opts.config_path.clone_from(config_path); } if let Some(compute_opts) = compute_opts.as_mut() { - compute_opts.config_path = config_path.clone(); + compute_opts.config_path.clone_from(config_path); } if let Some(frontend_opts) = frontend_opts.as_mut() { - frontend_opts.config_path = config_path.clone(); + frontend_opts.config_path.clone_from(config_path); } if let Some(compactor_opts) = compactor_opts.as_mut() { - compactor_opts.config_path = config_path.clone(); + compactor_opts.config_path.clone_from(config_path); } } if let Some(prometheus_listener_addr) = opts.prometheus_listener_addr.as_ref() { if let Some(compute_opts) = compute_opts.as_mut() { - compute_opts.prometheus_listener_addr = prometheus_listener_addr.clone(); + compute_opts + .prometheus_listener_addr + .clone_from(prometheus_listener_addr); } if let Some(frontend_opts) = frontend_opts.as_mut() { - frontend_opts.prometheus_listener_addr = prometheus_listener_addr.clone(); + frontend_opts + .prometheus_listener_addr + .clone_from(prometheus_listener_addr); } if let Some(compactor_opts) = compactor_opts.as_mut() { - compactor_opts.prometheus_listener_addr = prometheus_listener_addr.clone(); + compactor_opts + .prometheus_listener_addr + .clone_from(prometheus_listener_addr); } if let Some(meta_opts) = meta_opts.as_mut() { meta_opts.prometheus_listener_addr = Some(prometheus_listener_addr.clone()); diff --git a/src/common/src/catalog/external_table.rs b/src/common/src/catalog/external_table.rs index 78dccf892536d..3de38a29a499c 100644 --- a/src/common/src/catalog/external_table.rs +++ b/src/common/src/catalog/external_table.rs @@ -42,7 +42,7 @@ pub struct CdcTableDesc { pub value_indices: Vec, - /// properties will be passed into the StreamScanNode + /// properties will be passed into the `StreamScanNode` pub connect_properties: BTreeMap, } diff --git a/src/common/src/config.rs b/src/common/src/config.rs index 59094c949b62c..1f1b7f54d483c 100644 --- a/src/common/src/config.rs +++ b/src/common/src/config.rs @@ -212,9 +212,9 @@ pub struct MetaConfig { #[serde(default = "default::meta::hummock_version_checkpoint_interval_sec")] pub hummock_version_checkpoint_interval_sec: u64, - /// If enabled, SSTable object file and version delta will be retained. + /// If enabled, `SSTable` object file and version delta will be retained. /// - /// SSTable object file need to be deleted via full GC. + /// `SSTable` object file need to be deleted via full GC. /// /// version delta need to be manually deleted. #[serde(default = "default::meta::enable_hummock_data_archive")] @@ -279,11 +279,11 @@ pub struct MetaConfig { #[serde(default = "default::meta::backend")] pub backend: MetaBackend, - /// Schedule space_reclaim compaction for all compaction groups with this interval. + /// Schedule `space_reclaim` compaction for all compaction groups with this interval. #[serde(default = "default::meta::periodic_space_reclaim_compaction_interval_sec")] pub periodic_space_reclaim_compaction_interval_sec: u64, - /// Schedule ttl_reclaim compaction for all compaction groups with this interval. + /// Schedule `ttl_reclaim` compaction for all compaction groups with this interval. #[serde(default = "default::meta::periodic_ttl_reclaim_compaction_interval_sec")] pub periodic_ttl_reclaim_compaction_interval_sec: u64, @@ -642,13 +642,13 @@ pub struct StorageConfig { pub compactor_memory_limit_mb: Option, /// Compactor calculates the maximum number of tasks that can be executed on the node based on - /// worker_num and compactor_max_task_multiplier. - /// max_pull_task_count = worker_num * compactor_max_task_multiplier + /// `worker_num` and `compactor_max_task_multiplier`. + /// `max_pull_task_count` = `worker_num` * `compactor_max_task_multiplier` #[serde(default = "default::storage::compactor_max_task_multiplier")] pub compactor_max_task_multiplier: f32, /// The percentage of memory available when compactor is deployed separately. - /// non_reserved_memory_bytes = system_memory_available_bytes * compactor_memory_available_proportion + /// `non_reserved_memory_bytes` = `system_memory_available_bytes` * `compactor_memory_available_proportion` #[serde(default = "default::storage::compactor_memory_available_proportion")] pub compactor_memory_available_proportion: f64, @@ -715,7 +715,7 @@ pub struct StorageConfig { #[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)] pub struct CacheRefillConfig { - /// SSTable levels to refill. + /// `SSTable` levels to refill. #[serde(default = "default::cache_refill::data_refill_levels")] pub data_refill_levels: Vec, diff --git a/src/common/src/session_config/mod.rs b/src/common/src/session_config/mod.rs index 693d14ab38d06..066076681ffa6 100644 --- a/src/common/src/session_config/mod.rs +++ b/src/common/src/session_config/mod.rs @@ -206,7 +206,7 @@ pub struct ConfigMap { synchronize_seqscans: bool, /// Abort query statement that takes more than the specified amount of time in sec. If - /// log_min_error_statement is set to ERROR or lower, the statement that timed out will also be + /// `log_min_error_statement` is set to ERROR or lower, the statement that timed out will also be /// logged. If this value is specified without units, it is taken as milliseconds. A value of /// zero (the default) disables the timeout. #[parameter(default = 0u32)] @@ -235,7 +235,7 @@ pub struct ConfigMap { streaming_rate_limit: ConfigNonZeroU64, /// Cache policy for partition cache in streaming over window. - /// Can be "full", "recent", "recent_first_n" or "recent_last_n". + /// Can be "full", "recent", "`recent_first_n`" or "`recent_last_n`". #[parameter(default = OverWindowCachePolicy::default(), rename = "rw_streaming_over_window_cache_policy")] streaming_over_window_cache_policy: OverWindowCachePolicy, diff --git a/src/common/src/telemetry/mod.rs b/src/common/src/telemetry/mod.rs index 29a34b9a86422..54a88789a171f 100644 --- a/src/common/src/telemetry/mod.rs +++ b/src/common/src/telemetry/mod.rs @@ -52,19 +52,19 @@ pub enum TelemetryNodeType { #[derive(Debug, Serialize, Deserialize)] pub struct TelemetryReportBase { - /// tracking_id is persistent in etcd + /// `tracking_id` is persistent in etcd pub tracking_id: String, - /// session_id is reset every time node restarts + /// `session_id` is reset every time node restarts pub session_id: String, - /// system_data is hardware and os info + /// `system_data` is hardware and os info pub system_data: SystemData, - /// up_time is how long the node has been running + /// `up_time` is how long the node has been running pub up_time: u64, - /// time_stamp is when the report is created + /// `time_stamp` is when the report is created pub time_stamp: u64, - /// node_type is the node that creates the report + /// `node_type` is the node that creates the report pub node_type: TelemetryNodeType, - /// is_test is whether the report is from a test environment, default to be false + /// `is_test` is whether the report is from a test environment, default to be false /// needed in CI for compatible tests with telemetry backend pub is_test: bool, } diff --git a/src/common/src/util/sort_util.rs b/src/common/src/util/sort_util.rs index 42d548354581f..6758c36b82238 100644 --- a/src/common/src/util/sort_util.rs +++ b/src/common/src/util/sort_util.rs @@ -312,7 +312,7 @@ pub struct HeapElem { chunk: DataChunk, chunk_idx: usize, elem_idx: usize, - /// DataChunk can be encoded to accelerate the comparison. + /// `DataChunk` can be encoded to accelerate the comparison. /// Use `risingwave_common::util::encoding_for_comparison::encode_chunk` /// to perform encoding, otherwise the comparison will be performed /// column by column. diff --git a/src/compute/src/lib.rs b/src/compute/src/lib.rs index 19c329e112787..870f91b33e2a2 100644 --- a/src/compute/src/lib.rs +++ b/src/compute/src/lib.rs @@ -60,7 +60,7 @@ pub struct ComputeNodeOpts { /// The address for contacting this instance of the service. /// This would be synonymous with the service's "public address" /// or "identifying address". - /// Optional, we will use listen_addr if not specified. + /// Optional, we will use `listen_addr` if not specified. #[clap(long, env = "RW_ADVERTISE_ADDR")] pub advertise_addr: Option, diff --git a/src/config/docs.md b/src/config/docs.md index f673ea0c186b4..f07ea4375d2bc 100644 --- a/src/config/docs.md +++ b/src/config/docs.md @@ -30,7 +30,7 @@ This page is automatically generated by `./risedev generate-example-config` | enable_committed_sst_sanity_check | Enable sanity check when SSTs are committed. | false | | enable_compaction_deterministic | Whether to enable deterministic compaction scheduling, which will disable all auto scheduling of compaction tasks. Should only be used in e2e tests. | false | | enable_dropped_column_reclaim | Whether compactor should rewrite row to remove dropped column. | false | -| enable_hummock_data_archive | If enabled, SSTable object file and version delta will be retained. SSTable object file need to be deleted via full GC. version delta need to be manually deleted. | false | +| enable_hummock_data_archive | If enabled, `SSTable` object file and version delta will be retained. `SSTable` object file need to be deleted via full GC. version delta need to be manually deleted. | false | | event_log_channel_max_size | Keeps the latest N events per channel. | 10 | | event_log_enabled | | true | | full_gc_interval_sec | Interval of automatic hummock full GC. | 86400 | @@ -48,10 +48,10 @@ This page is automatically generated by `./risedev generate-example-config` | parallelism_control_trigger_period_sec | The period of parallelism control trigger. | 10 | | partition_vnode_count | | 16 | | periodic_compaction_interval_sec | Schedule compaction for all compaction groups with this interval. | 60 | -| periodic_space_reclaim_compaction_interval_sec | Schedule space_reclaim compaction for all compaction groups with this interval. | 3600 | +| periodic_space_reclaim_compaction_interval_sec | Schedule `space_reclaim` compaction for all compaction groups with this interval. | 3600 | | periodic_split_compact_group_interval_sec | | 10 | | periodic_tombstone_reclaim_compaction_interval_sec | | 600 | -| periodic_ttl_reclaim_compaction_interval_sec | Schedule ttl_reclaim compaction for all compaction groups with this interval. | 1800 | +| periodic_ttl_reclaim_compaction_interval_sec | Schedule `ttl_reclaim` compaction for all compaction groups with this interval. | 1800 | | split_group_size_limit | | 68719476736 | | table_write_throughput_threshold | | 16777216 | | unrecognized | | | @@ -102,8 +102,8 @@ This page is automatically generated by `./risedev generate-example-config` | compactor_fast_max_compact_task_size | | 2147483648 | | compactor_max_sst_key_count | | 2097152 | | compactor_max_sst_size | | 536870912 | -| compactor_max_task_multiplier | Compactor calculates the maximum number of tasks that can be executed on the node based on worker_num and compactor_max_task_multiplier. max_pull_task_count = worker_num * compactor_max_task_multiplier | 2.5 | -| compactor_memory_available_proportion | The percentage of memory available when compactor is deployed separately. non_reserved_memory_bytes = system_memory_available_bytes * compactor_memory_available_proportion | 0.8 | +| compactor_max_task_multiplier | Compactor calculates the maximum number of tasks that can be executed on the node based on `worker_num` and `compactor_max_task_multiplier`. `max_pull_task_count` = `worker_num` * `compactor_max_task_multiplier` | 2.5 | +| compactor_memory_available_proportion | The percentage of memory available when compactor is deployed separately. `non_reserved_memory_bytes` = `system_memory_available_bytes` * `compactor_memory_available_proportion` | 0.8 | | compactor_memory_limit_mb | | | | data_file_cache | | | | disable_remote_compactor | | false | diff --git a/src/connector/src/parser/mod.rs b/src/connector/src/parser/mod.rs index 4097c86a2821b..c596d636f2da6 100644 --- a/src/connector/src/parser/mod.rs +++ b/src/connector/src/parser/mod.rs @@ -1055,7 +1055,7 @@ impl SpecificParserConfig { config.enable_upsert = true; } if info.use_schema_registry { - config.topic = get_kafka_topic(with_properties)?.clone(); + config.topic.clone_from(get_kafka_topic(with_properties)?); config.client_config = SchemaRegistryAuth::from(&info.format_encode_options); } else { config.aws_auth_props = Some( @@ -1085,7 +1085,7 @@ impl SpecificParserConfig { config.enable_upsert = true; } if info.use_schema_registry { - config.topic = get_kafka_topic(with_properties)?.clone(); + config.topic.clone_from(get_kafka_topic(with_properties)?); config.client_config = SchemaRegistryAuth::from(&info.format_encode_options); } else { config.aws_auth_props = Some( diff --git a/src/connector/src/parser/unified/avro.rs b/src/connector/src/parser/unified/avro.rs index f0825d9af4bbe..4e7d134f42554 100644 --- a/src/connector/src/parser/unified/avro.rs +++ b/src/connector/src/parser/unified/avro.rs @@ -36,7 +36,7 @@ use crate::error::ConnectorResult; pub struct AvroParseOptions<'a> { pub schema: Option<&'a Schema>, /// Strict Mode - /// If strict mode is disabled, an int64 can be parsed from an AvroInt (int32) value. + /// If strict mode is disabled, an int64 can be parsed from an `AvroInt` (int32) value. pub relax_numeric: bool, } diff --git a/src/connector/src/sink/starrocks.rs b/src/connector/src/sink/starrocks.rs index 2397c942746d7..192bf38fd839f 100644 --- a/src/connector/src/sink/starrocks.rs +++ b/src/connector/src/sink/starrocks.rs @@ -48,25 +48,25 @@ const STARROCK_MYSQL_WAIT_TIMEOUT: usize = 28800; #[derive(Deserialize, Debug, Clone, WithOptions)] pub struct StarrocksCommon { - /// The StarRocks host address. + /// The `StarRocks` host address. #[serde(rename = "starrocks.host")] pub host: String, - /// The port to the MySQL server of StarRocks FE. + /// The port to the MySQL server of `StarRocks` FE. #[serde(rename = "starrocks.mysqlport", alias = "starrocks.query_port")] pub mysql_port: String, - /// The port to the HTTP server of StarRocks FE. + /// The port to the HTTP server of `StarRocks` FE. #[serde(rename = "starrocks.httpport", alias = "starrocks.http_port")] pub http_port: String, - /// The user name used to access the StarRocks database. + /// The user name used to access the `StarRocks` database. #[serde(rename = "starrocks.user")] pub user: String, /// The password associated with the user. #[serde(rename = "starrocks.password")] pub password: String, - /// The StarRocks database where the target table is located + /// The `StarRocks` database where the target table is located #[serde(rename = "starrocks.database")] pub database: String, - /// The StarRocks table you want to sink data to. + /// The `StarRocks` table you want to sink data to. #[serde(rename = "starrocks.table")] pub table: String, #[serde(rename = "starrocks.partial_update")] diff --git a/src/connector/src/source/cdc/enumerator/mod.rs b/src/connector/src/source/cdc/enumerator/mod.rs index db1df10606576..98018b6b6a113 100644 --- a/src/connector/src/source/cdc/enumerator/mod.rs +++ b/src/connector/src/source/cdc/enumerator/mod.rs @@ -35,7 +35,7 @@ pub const DATABASE_SERVERS_KEY: &str = "database.servers"; #[derive(Debug)] pub struct DebeziumSplitEnumerator { - /// The source_id in the catalog + /// The `source_id` in the catalog source_id: u32, worker_node_addrs: Vec, _phantom: PhantomData, diff --git a/src/connector/src/source/filesystem/opendal_source/mod.rs b/src/connector/src/source/filesystem/opendal_source/mod.rs index 15371a0da90a6..a9689a921d7f0 100644 --- a/src/connector/src/source/filesystem/opendal_source/mod.rs +++ b/src/connector/src/source/filesystem/opendal_source/mod.rs @@ -113,7 +113,7 @@ pub struct OpendalS3Properties { #[serde(flatten)] pub s3_properties: S3PropertiesCommon, - /// The following are only supported by s3_v2 (opendal) source. + /// The following are only supported by `s3_v2` (opendal) source. #[serde(rename = "s3.assume_role", default)] pub assume_role: Option, diff --git a/src/connector/src/source/filesystem/s3_v2/lister.rs b/src/connector/src/source/filesystem/s3_v2/lister.rs index 03a6c0878de43..a4e152ab6c158 100644 --- a/src/connector/src/source/filesystem/s3_v2/lister.rs +++ b/src/connector/src/source/filesystem/s3_v2/lister.rs @@ -40,7 +40,8 @@ impl FsListInner for S3SplitEnumerator { .await .with_context(|| format!("failed to list objects in bucket `{}`", self.bucket_name))?; if res.is_truncated().unwrap_or_default() { - self.next_continuation_token = res.next_continuation_token.clone(); + self.next_continuation_token + .clone_from(&res.next_continuation_token); } else { has_finished = true; self.next_continuation_token = None; diff --git a/src/connector/src/source/google_pubsub/split.rs b/src/connector/src/source/google_pubsub/split.rs index f150f7f08038b..91253afd825f6 100644 --- a/src/connector/src/source/google_pubsub/split.rs +++ b/src/connector/src/source/google_pubsub/split.rs @@ -24,14 +24,14 @@ pub struct PubsubSplit { pub(crate) subscription: String, /// `start_offset` is a numeric timestamp. - /// When not `None`, the PubsubReader seeks to the timestamp described by the start_offset. - /// These offsets are taken from the `offset` property of the SourceMessage yielded by the + /// When not `None`, the `PubsubReader` seeks to the timestamp described by the `start_offset`. + /// These offsets are taken from the `offset` property of the `SourceMessage` yielded by the /// pubsub reader. pub(crate) start_offset: Option, /// `stop_offset` is a numeric timestamp. - /// When not `None`, the PubsubReader stops reading messages when the `offset` property of - /// the SourceMessage is greater than or equal to the stop_offset. + /// When not `None`, the `PubsubReader` stops reading messages when the `offset` property of + /// the `SourceMessage` is greater than or equal to the `stop_offset`. pub(crate) stop_offset: Option, } diff --git a/src/connector/src/source/kafka/mod.rs b/src/connector/src/source/kafka/mod.rs index 52d410a8ee717..0be7a6b122bd2 100644 --- a/src/connector/src/source/kafka/mod.rs +++ b/src/connector/src/source/kafka/mod.rs @@ -117,7 +117,7 @@ pub struct KafkaProperties { )] pub time_offset: Option, - /// This parameter is used to tell KafkaSplitReader to produce `UpsertMessage`s, which + /// This parameter is used to tell `KafkaSplitReader` to produce `UpsertMessage`s, which /// combine both key and value fields of the Kafka message. /// TODO: Currently, `Option` can not be parsed here. #[serde(rename = "upsert")] diff --git a/src/connector/with_options_sink.yaml b/src/connector/with_options_sink.yaml index f9d459fddfd9c..4d776cc1689f8 100644 --- a/src/connector/with_options_sink.yaml +++ b/src/connector/with_options_sink.yaml @@ -522,21 +522,21 @@ StarrocksConfig: fields: - name: starrocks.host field_type: String - comments: The StarRocks host address. + comments: The `StarRocks` host address. required: true - name: starrocks.mysqlport field_type: String - comments: The port to the MySQL server of StarRocks FE. + comments: The port to the MySQL server of `StarRocks` FE. required: true alias: starrocks.query_port - name: starrocks.httpport field_type: String - comments: The port to the HTTP server of StarRocks FE. + comments: The port to the HTTP server of `StarRocks` FE. required: true alias: starrocks.http_port - name: starrocks.user field_type: String - comments: The user name used to access the StarRocks database. + comments: The user name used to access the `StarRocks` database. required: true - name: starrocks.password field_type: String @@ -544,11 +544,11 @@ StarrocksConfig: required: true - name: starrocks.database field_type: String - comments: The StarRocks database where the target table is located + comments: The `StarRocks` database where the target table is located required: true - name: starrocks.table field_type: String - comments: The StarRocks table you want to sink data to. + comments: The `StarRocks` table you want to sink data to. required: true - name: starrocks.partial_update field_type: String diff --git a/src/connector/with_options_source.yaml b/src/connector/with_options_source.yaml index a02f3b2168650..bf873f1ffc3d9 100644 --- a/src/connector/with_options_source.yaml +++ b/src/connector/with_options_source.yaml @@ -96,7 +96,7 @@ KafkaProperties: alias: scan.startup.timestamp_millis - name: upsert field_type: String - comments: 'This parameter is used to tell KafkaSplitReader to produce `UpsertMessage`s, which combine both key and value fields of the Kafka message. TODO: Currently, `Option` can not be parsed here.' + comments: 'This parameter is used to tell `KafkaSplitReader` to produce `UpsertMessage`s, which combine both key and value fields of the Kafka message. TODO: Currently, `Option` can not be parsed here.' required: false - name: properties.bootstrap.server field_type: String @@ -551,7 +551,7 @@ OpendalS3Properties: required: false - name: s3.assume_role field_type: String - comments: The following are only supported by s3_v2 (opendal) source. + comments: The following are only supported by `s3_v2` (opendal) source. required: false default: Default::default PosixFsProperties: diff --git a/src/ctl/src/common/hummock_service.rs b/src/ctl/src/common/hummock_service.rs index a3284ad4122d7..b176c45c31906 100644 --- a/src/ctl/src/common/hummock_service.rs +++ b/src/ctl/src/common/hummock_service.rs @@ -94,7 +94,7 @@ impl HummockServiceOpts { }; if let Some(dir) = &self.data_dir { - opts.data_directory = dir.clone(); + opts.data_directory.clone_from(dir); } opts diff --git a/src/ctl/src/lib.rs b/src/ctl/src/lib.rs index 9cdc99c0d3156..87e0819c1b73e 100644 --- a/src/ctl/src/lib.rs +++ b/src/ctl/src/lib.rs @@ -180,7 +180,7 @@ enum HummockCommands { data_dir: Option, }, SstDump(SstDumpArgs), - /// trigger a targeted compaction through compaction_group_id + /// trigger a targeted compaction through `compaction_group_id` TriggerManualCompaction { #[clap(short, long = "compaction-group-id", default_value_t = 2)] compaction_group_id: u64, @@ -195,7 +195,7 @@ enum HummockCommands { sst_ids: Vec, }, /// trigger a full GC for SSTs that is not in version and with timestamp <= now - - /// sst_retention_time_sec. + /// `sst_retention_time_sec`. TriggerFullGc { #[clap(short, long = "sst_retention_time_sec", default_value_t = 259200)] sst_retention_time_sec: u64, @@ -263,7 +263,7 @@ enum HummockCommands { #[clap(long)] compaction_group_id: u64, }, - /// Validate the current HummockVersion. + /// Validate the current `HummockVersion`. ValidateVersion, /// Rebuild table stats RebuildTableStats, @@ -275,7 +275,7 @@ enum HummockCommands { /// The ident of the archive file in object store. It's also the first Hummock version id of this archive. #[clap(long, value_delimiter = ',')] archive_ids: Vec, - /// The data directory of Hummock storage, where SSTable objects can be found. + /// The data directory of Hummock storage, where `SSTable` objects can be found. #[clap(long)] data_dir: String, /// KVs that are matched with the user key are printed. @@ -286,7 +286,7 @@ enum HummockCommands { /// The ident of the archive file in object store. It's also the first Hummock version id of this archive. #[clap(long, value_delimiter = ',')] archive_ids: Vec, - /// The data directory of Hummock storage, where SSTable objects can be found. + /// The data directory of Hummock storage, where `SSTable` objects can be found. #[clap(long)] data_dir: String, /// Version deltas that are related to the SST id are printed. @@ -317,7 +317,7 @@ enum TableCommands { #[derive(clap::Args, Debug, Clone)] pub struct ScaleHorizonCommands { - /// The worker that needs to be excluded during scheduling, worker_id and worker_host:worker_port are both + /// The worker that needs to be excluded during scheduling, `worker_id` and `worker_host:worker_port` are both /// supported #[clap( long, @@ -326,7 +326,7 @@ pub struct ScaleHorizonCommands { )] exclude_workers: Option>, - /// The worker that needs to be included during scheduling, worker_id and worker_host:worker_port are both + /// The worker that needs to be included during scheduling, `worker_id` and `worker_host:worker_port` are both /// supported #[clap( long, @@ -337,7 +337,7 @@ pub struct ScaleHorizonCommands { /// The target parallelism, currently, it is used to limit the target parallelism and only /// takes effect when the actual parallelism exceeds this value. Can be used in conjunction - /// with exclude/include_workers. + /// with `exclude/include_workers`. #[clap(long)] target_parallelism: Option, @@ -371,7 +371,7 @@ pub struct ScaleVerticalCommands { #[command(flatten)] common: ScaleCommon, - /// The worker that needs to be scheduled, worker_id and worker_host:worker_port are both + /// The worker that needs to be scheduled, `worker_id` and `worker_host:worker_port` are both /// supported #[clap( long, @@ -467,7 +467,7 @@ enum MetaCommands { /// Show the plan only, no actual operation #[clap(long, default_value = "false")] dry_run: bool, - /// Resolve NO_SHUFFLE upstream + /// Resolve `NO_SHUFFLE` upstream #[clap(long, default_value = "false")] resolve_no_shuffle: bool, }, @@ -492,7 +492,7 @@ enum MetaCommands { /// Unregister workers from the cluster UnregisterWorkers { - /// The workers that needs to be unregistered, worker_id and worker_host:worker_port are both supported + /// The workers that needs to be unregistered, `worker_id` and `worker_host:worker_port` are both supported #[clap( long, required = true, diff --git a/src/expr/core/src/expr/expr_udf.rs b/src/expr/core/src/expr/expr_udf.rs index 0c67dc3c58df1..4e63dc5950bbe 100644 --- a/src/expr/core/src/expr/expr_udf.rs +++ b/src/expr/core/src/expr/expr_udf.rs @@ -53,7 +53,7 @@ pub struct UserDefinedFunction { /// Number of remaining successful calls until retry is enabled. /// This parameter is designed to prevent continuous retry on every call, which would increase delay. /// Logic: - /// It resets to INITIAL_RETRY_COUNT after a single failure and then decrements with each call, enabling retry when it reaches zero. + /// It resets to `INITIAL_RETRY_COUNT` after a single failure and then decrements with each call, enabling retry when it reaches zero. /// If non-zero, we will not retry on connection errors to prevent blocking the stream. /// On each connection error, the count will be reset to `INITIAL_RETRY_COUNT`. /// On each successful call, the count will be decreased by 1. diff --git a/src/expr/impl/src/aggregate/mode.rs b/src/expr/impl/src/aggregate/mode.rs index 7c344951f4c1e..b685255f15f0b 100644 --- a/src/expr/impl/src/aggregate/mode.rs +++ b/src/expr/impl/src/aggregate/mode.rs @@ -89,7 +89,7 @@ impl State { self.cur_item_freq = 1; } if self.cur_item_freq > self.cur_mode_freq { - self.cur_mode = self.cur_item.clone(); + self.cur_mode.clone_from(&self.cur_item); self.cur_mode_freq = self.cur_item_freq; } } diff --git a/src/expr/udf/src/external.rs b/src/expr/udf/src/external.rs index c123f066e7874..7560638b03985 100644 --- a/src/expr/udf/src/external.rs +++ b/src/expr/udf/src/external.rs @@ -187,7 +187,7 @@ impl ArrowFlightUdfClient { ) -> Result { let mut backoff = Duration::from_millis(100); let metrics = &*GLOBAL_METRICS; - let labels: &[&str; 4] = &[&self.addr, "external", &id, &fragment_id]; + let labels: &[&str; 4] = &[&self.addr, "external", id, fragment_id]; loop { match self.call(id, input.clone()).await { Err(err) if err.is_tonic_error() => { diff --git a/src/frontend/planner_test/src/lib.rs b/src/frontend/planner_test/src/lib.rs index a30e0cab3810f..eb4cb3002ec75 100644 --- a/src/frontend/planner_test/src/lib.rs +++ b/src/frontend/planner_test/src/lib.rs @@ -300,9 +300,11 @@ impl TestCase { let mut result = result.unwrap_or_default(); result.input = self.input.clone(); - result.create_source = self.create_source().clone(); - result.create_table_with_connector = self.create_table_with_connector().clone(); - result.with_config_map = self.with_config_map().clone(); + result.create_source.clone_from(self.create_source()); + result + .create_table_with_connector + .clone_from(self.create_table_with_connector()); + result.with_config_map.clone_from(self.with_config_map()); Ok(result) } diff --git a/src/frontend/src/binder/bind_context.rs b/src/frontend/src/binder/bind_context.rs index 69ab1e07abe6b..386ed55c05aa7 100644 --- a/src/frontend/src/binder/bind_context.rs +++ b/src/frontend/src/binder/bind_context.rs @@ -79,7 +79,7 @@ pub struct BindContext { pub clause: Option, // The `BindContext`'s data on its column groups pub column_group_context: ColumnGroupContext, - /// Map the cte's name to its Relation::Subquery. + /// Map the cte's name to its `Relation::Subquery`. /// The `ShareId` of the value is used to help the planner identify the share plan. pub cte_to_relation: HashMap>, /// Current lambda functions's arguments diff --git a/src/frontend/src/binder/bind_param.rs b/src/frontend/src/binder/bind_param.rs index df22fada66559..6c3be04d4ee90 100644 --- a/src/frontend/src/binder/bind_param.rs +++ b/src/frontend/src/binder/bind_param.rs @@ -104,7 +104,7 @@ impl ExprRewriter for ParamRewriter { None }; - self.parsed_params[parameter_index] = datum.clone(); + self.parsed_params[parameter_index].clone_from(&datum); Literal::new(datum, data_type).into() } } diff --git a/src/frontend/src/binder/mod.rs b/src/frontend/src/binder/mod.rs index 2505ca886f19c..aa62e8f772e03 100644 --- a/src/frontend/src/binder/mod.rs +++ b/src/frontend/src/binder/mod.rs @@ -422,7 +422,9 @@ impl Binder { fn push_context(&mut self) { let new_context = std::mem::take(&mut self.context); - self.context.cte_to_relation = new_context.cte_to_relation.clone(); + self.context + .cte_to_relation + .clone_from(&new_context.cte_to_relation); let new_lateral_contexts = std::mem::take(&mut self.lateral_contexts); self.upper_subquery_contexts .push((new_context, new_lateral_contexts)); @@ -440,7 +442,9 @@ impl Binder { fn push_lateral_context(&mut self) { let new_context = std::mem::take(&mut self.context); - self.context.cte_to_relation = new_context.cte_to_relation.clone(); + self.context + .cte_to_relation + .clone_from(&new_context.cte_to_relation); self.lateral_contexts.push(LateralBindContext { is_visible: false, context: new_context, diff --git a/src/frontend/src/binder/relation/mod.rs b/src/frontend/src/binder/relation/mod.rs index 69eb6787d47a0..204de801ae693 100644 --- a/src/frontend/src/binder/relation/mod.rs +++ b/src/frontend/src/binder/relation/mod.rs @@ -284,7 +284,7 @@ impl Binder { .map(|t| t.real_value()) .unwrap_or_else(|| field.name.to_string()), }; - field.name = name.clone(); + field.name.clone_from(&name); self.context.columns.push(ColumnBinding::new( table_name.clone(), begin + index, diff --git a/src/frontend/src/binder/set_expr.rs b/src/frontend/src/binder/set_expr.rs index 99ec66ac0b725..e1905c2b9df9d 100644 --- a/src/frontend/src/binder/set_expr.rs +++ b/src/frontend/src/binder/set_expr.rs @@ -138,7 +138,9 @@ impl Binder { let mut left = self.bind_set_expr(*left)?; // Reset context for right side, but keep `cte_to_relation`. let new_context = std::mem::take(&mut self.context); - self.context.cte_to_relation = new_context.cte_to_relation.clone(); + self.context + .cte_to_relation + .clone_from(&new_context.cte_to_relation); let mut right = self.bind_set_expr(*right)?; if left.schema().fields.len() != right.schema().fields.len() { diff --git a/src/frontend/src/catalog/database_catalog.rs b/src/frontend/src/catalog/database_catalog.rs index 6a59a55a73338..ec040e309eba8 100644 --- a/src/frontend/src/catalog/database_catalog.rs +++ b/src/frontend/src/catalog/database_catalog.rs @@ -106,14 +106,14 @@ impl DatabaseCatalog { let old_schema_name = self.schema_name_by_id.get(&id).unwrap().to_owned(); if old_schema_name != name { let mut schema = self.schema_by_name.remove(&old_schema_name).unwrap(); - schema.name = name.clone(); + schema.name.clone_from(&name); schema.database_id = prost.database_id; schema.owner = prost.owner; self.schema_by_name.insert(name.clone(), schema); self.schema_name_by_id.insert(id, name); } else { let schema = self.get_schema_mut(id).unwrap(); - schema.name = name.clone(); + schema.name.clone_from(&name); schema.database_id = prost.database_id; schema.owner = prost.owner; }; diff --git a/src/frontend/src/catalog/index_catalog.rs b/src/frontend/src/catalog/index_catalog.rs index 1eb74dd348959..7e13c365407e1 100644 --- a/src/frontend/src/catalog/index_catalog.rs +++ b/src/frontend/src/catalog/index_catalog.rs @@ -36,7 +36,7 @@ pub struct IndexCatalog { /// Only `InputRef` and `FuncCall` type index is supported Now. /// The index of `InputRef` is the column index of the primary table. - /// The index_item size is equal to the index table columns size + /// The `index_item` size is equal to the index table columns size /// The input args of `FuncCall` is also the column index of the primary table. pub index_item: Vec, diff --git a/src/frontend/src/catalog/root_catalog.rs b/src/frontend/src/catalog/root_catalog.rs index fd3fd3020b3c7..ed9974adb8ba2 100644 --- a/src/frontend/src/catalog/root_catalog.rs +++ b/src/frontend/src/catalog/root_catalog.rs @@ -42,7 +42,7 @@ use crate::expr::{Expr, ExprImpl}; #[derive(Copy, Clone)] pub enum SchemaPath<'a> { Name(&'a str), - /// (search_path, user_name). + /// (`search_path`, `user_name`). Path(&'a SearchPath, &'a str), } @@ -297,7 +297,7 @@ impl Catalog { let old_database_name = self.db_name_by_id.get(&id).unwrap().to_owned(); if old_database_name != name { let mut database = self.database_by_name.remove(&old_database_name).unwrap(); - database.name = name.clone(); + database.name.clone_from(&name); database.owner = proto.owner; self.database_by_name.insert(name.clone(), database); self.db_name_by_id.insert(id, name); diff --git a/src/frontend/src/catalog/system_catalog/pg_catalog/pg_stat_activity.rs b/src/frontend/src/catalog/system_catalog/pg_catalog/pg_stat_activity.rs index 9b72190386292..7990d4afcc99e 100644 --- a/src/frontend/src/catalog/system_catalog/pg_catalog/pg_stat_activity.rs +++ b/src/frontend/src/catalog/system_catalog/pg_catalog/pg_stat_activity.rs @@ -38,7 +38,7 @@ struct PgStatActivity { application_name: String, /// IP address of the client connected to this backend. client_addr: String, - /// Host name of the connected client, as reported by a reverse DNS lookup of client_addr. + /// Host name of the connected client, as reported by a reverse DNS lookup of `client_addr`. client_hostname: String, /// TCP port number that the client is using for communication with this backend, or -1 if a Unix socket is used. client_port: i16, diff --git a/src/frontend/src/catalog/table_catalog.rs b/src/frontend/src/catalog/table_catalog.rs index edb458997e33f..59bc3f8b4b343 100644 --- a/src/frontend/src/catalog/table_catalog.rs +++ b/src/frontend/src/catalog/table_catalog.rs @@ -79,10 +79,10 @@ pub struct TableCatalog { /// All columns in this table. pub columns: Vec, - /// Key used as materialize's storage key prefix, including MV order columns and stream_key. + /// Key used as materialize's storage key prefix, including MV order columns and `stream_key`. pub pk: Vec, - /// pk_indices of the corresponding materialize operator's output. + /// `pk_indices` of the corresponding materialize operator's output. pub stream_key: Vec, /// Type of the table. Used to distinguish user-created tables, materialized views, index diff --git a/src/frontend/src/expr/mod.rs b/src/frontend/src/expr/mod.rs index 78ae2db726a39..ef6405d62b7ae 100644 --- a/src/frontend/src/expr/mod.rs +++ b/src/frontend/src/expr/mod.rs @@ -403,7 +403,7 @@ pub struct InequalityInputPair { pub(crate) key_required_larger: usize, /// Input index of less side of inequality. pub(crate) key_required_smaller: usize, - /// greater >= less + delta_expression + /// greater >= less + `delta_expression` pub(crate) delta_expression: Option<(ExprType, ExprImpl)>, } diff --git a/src/frontend/src/handler/create_sink.rs b/src/frontend/src/handler/create_sink.rs index 9e751fa49869e..d28338c7a2e0e 100644 --- a/src/frontend/src/handler/create_sink.rs +++ b/src/frontend/src/handler/create_sink.rs @@ -443,7 +443,9 @@ pub async fn handle_create_sink( let (mut graph, mut table, source) = reparse_table_for_sink(&session, &table_catalog).await?; - table.incoming_sinks = table_catalog.incoming_sinks.clone(); + table + .incoming_sinks + .clone_from(&table_catalog.incoming_sinks); for _ in 0..(table_catalog.incoming_sinks.len() + 1) { for fragment in graph.fragments.values_mut() { diff --git a/src/frontend/src/handler/create_source.rs b/src/frontend/src/handler/create_source.rs index 46fbbc4a6994a..14feba0248172 100644 --- a/src/frontend/src/handler/create_source.rs +++ b/src/frontend/src/handler/create_source.rs @@ -352,8 +352,12 @@ pub(crate) async fn bind_columns_from_source( )?; stream_source_info.use_schema_registry = protobuf_schema.use_schema_registry; - stream_source_info.row_schema_location = protobuf_schema.row_schema_location.0.clone(); - stream_source_info.proto_message_name = protobuf_schema.message_name.0.clone(); + stream_source_info + .row_schema_location + .clone_from(&protobuf_schema.row_schema_location.0); + stream_source_info + .proto_message_name + .clone_from(&protobuf_schema.message_name.0); stream_source_info.key_message_name = get_key_message_name(&mut format_encode_options_to_consume); stream_source_info.name_strategy = @@ -388,7 +392,9 @@ pub(crate) async fn bind_columns_from_source( )?; stream_source_info.use_schema_registry = use_schema_registry; - stream_source_info.row_schema_location = row_schema_location.0.clone(); + stream_source_info + .row_schema_location + .clone_from(&row_schema_location.0); stream_source_info.proto_message_name = message_name.unwrap_or(AstString("".into())).0; stream_source_info.key_message_name = get_key_message_name(&mut format_encode_options_to_consume); diff --git a/src/frontend/src/handler/drop_sink.rs b/src/frontend/src/handler/drop_sink.rs index 1dcc9d5ec3abf..a42605ad1c856 100644 --- a/src/frontend/src/handler/drop_sink.rs +++ b/src/frontend/src/handler/drop_sink.rs @@ -72,7 +72,9 @@ pub async fn handle_drop_sink( assert!(!table_catalog.incoming_sinks.is_empty()); - table.incoming_sinks = table_catalog.incoming_sinks.clone(); + table + .incoming_sinks + .clone_from(&table_catalog.incoming_sinks); for _ in 0..(table_catalog.incoming_sinks.len() - 1) { for fragment in graph.fragments.values_mut() { diff --git a/src/frontend/src/lib.rs b/src/frontend/src/lib.rs index 171ad1918af8f..99789bcae21f2 100644 --- a/src/frontend/src/lib.rs +++ b/src/frontend/src/lib.rs @@ -95,7 +95,7 @@ pub struct FrontendOpts { /// The address for contacting this instance of the service. /// This would be synonymous with the service's "public address" /// or "identifying address". - /// Optional, we will use listen_addr if not specified. + /// Optional, we will use `listen_addr` if not specified. #[clap(long, env = "RW_ADVERTISE_ADDR")] pub advertise_addr: Option, diff --git a/src/frontend/src/optimizer/plan_node/generic/hop_window.rs b/src/frontend/src/optimizer/plan_node/generic/hop_window.rs index 6fb3e8609f6c8..df172284f33e6 100644 --- a/src/frontend/src/optimizer/plan_node/generic/hop_window.rs +++ b/src/frontend/src/optimizer/plan_node/generic/hop_window.rs @@ -38,13 +38,13 @@ pub struct HopWindow { pub window_slide: Interval, pub window_size: Interval, pub window_offset: Interval, - /// Provides mapping from input schema, window_start, window_end to output schema. + /// Provides mapping from input schema, `window_start`, `window_end` to output schema. /// For example, if we had: - /// input schema: | 0: trip_time | 1: trip_name | - /// window_start: 2 - /// window_end: 3 - /// output schema: | trip_name | window_start | - /// Then, output_indices: [1, 2] + /// input schema: | 0: `trip_time` | 1: `trip_name` | + /// `window_start`: 2 + /// `window_end`: 3 + /// output schema: | `trip_name` | `window_start` | + /// Then, `output_indices`: [1, 2] pub output_indices: Vec, } diff --git a/src/frontend/src/optimizer/plan_node/generic/sys_scan.rs b/src/frontend/src/optimizer/plan_node/generic/sys_scan.rs index 2b03399cdfd31..1fcef0d82f8e4 100644 --- a/src/frontend/src/optimizer/plan_node/generic/sys_scan.rs +++ b/src/frontend/src/optimizer/plan_node/generic/sys_scan.rs @@ -40,7 +40,7 @@ pub struct SysScan { pub table_desc: Rc, /// The pushed down predicates. It refers to column indexes of the table. pub predicate: Condition, - /// Help RowSeqSysScan executor use a better chunk size + /// Help `RowSeqSysScan` executor use a better chunk size pub chunk_size: Option, /// The cardinality of the table **without** applying the predicate. pub table_cardinality: Cardinality, diff --git a/src/frontend/src/optimizer/plan_node/logical_apply.rs b/src/frontend/src/optimizer/plan_node/logical_apply.rs index dd30dac956383..b7a564ee32982 100644 --- a/src/frontend/src/optimizer/plan_node/logical_apply.rs +++ b/src/frontend/src/optimizer/plan_node/logical_apply.rs @@ -46,7 +46,7 @@ pub struct LogicalApply { join_type: JoinType, /// Id of the Apply operator. - /// So correlated_input_ref can refer the Apply operator exactly by correlated_id. + /// So `correlated_input_ref` can refer the Apply operator exactly by `correlated_id`. correlated_id: CorrelatedId, /// The indices of `CorrelatedInputRef`s in `right`. correlated_indices: Vec, diff --git a/src/frontend/src/optimizer/plan_node/logical_multi_join.rs b/src/frontend/src/optimizer/plan_node/logical_multi_join.rs index fd56d3b1afcde..a47c75d31bd27 100644 --- a/src/frontend/src/optimizer/plan_node/logical_multi_join.rs +++ b/src/frontend/src/optimizer/plan_node/logical_multi_join.rs @@ -54,8 +54,8 @@ pub struct LogicalMultiJoin { inner2output: ColIndexMapping, // NOTE(st1page): these fields will be used in prune_col and // pk_derive soon. - /// the mapping output_col_idx -> (input_idx, input_col_idx), **"output_col_idx" is internal, - /// not consider output_indices** + /// the mapping `output_col_idx` -> (`input_idx`, `input_col_idx`), **"`output_col_idx`" is internal, + /// not consider `output_indices`** inner_o2i_mapping: Vec<(usize, usize)>, inner_i2o_mappings: Vec, } diff --git a/src/frontend/src/optimizer/plan_node/logical_source.rs b/src/frontend/src/optimizer/plan_node/logical_source.rs index c155440ed32d0..13cd420b61523 100644 --- a/src/frontend/src/optimizer/plan_node/logical_source.rs +++ b/src/frontend/src/optimizer/plan_node/logical_source.rs @@ -59,7 +59,7 @@ pub struct LogicalSource { /// Expressions to output. This field presents and will be turned to a `Project` when /// converting to a physical plan, only if there are generated columns. output_exprs: Option>, - /// When there are generated columns, the `StreamRowIdGen`'s row_id_index is different from + /// When there are generated columns, the `StreamRowIdGen`'s `row_id_index` is different from /// the one in `core`. So we store the one in `output_exprs` here. output_row_id_index: Option, } diff --git a/src/frontend/src/optimizer/plan_node/plan_base.rs b/src/frontend/src/optimizer/plan_node/plan_base.rs index adc5cf745240c..3e9783894d40f 100644 --- a/src/frontend/src/optimizer/plan_node/plan_base.rs +++ b/src/frontend/src/optimizer/plan_node/plan_base.rs @@ -33,7 +33,7 @@ mod physical_common { /// Common extra fields for physical plan nodes. #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct PhysicalCommonExtra { - /// The distribution property of the PlanNode's output, store an `Distribution::any()` here + /// The distribution property of the `PlanNode`'s output, store an `Distribution::any()` here /// will not affect correctness, but insert unnecessary exchange in plan pub dist: Distribution, } @@ -54,12 +54,12 @@ pub struct StreamExtra { /// Common fields for physical plan nodes. physical: PhysicalCommonExtra, - /// The append-only property of the PlanNode's output is a stream-only property. Append-only + /// The append-only property of the `PlanNode`'s output is a stream-only property. Append-only /// means the stream contains only insert operation. append_only: bool, /// Whether the output is emitted on window close. emit_on_window_close: bool, - /// The watermark column indices of the PlanNode's output. There could be watermark output from + /// The watermark column indices of the `PlanNode`'s output. There could be watermark output from /// this stream operator. watermark_columns: FixedBitSet, } @@ -80,7 +80,7 @@ pub struct BatchExtra { /// Common fields for physical plan nodes. physical: PhysicalCommonExtra, - /// The order property of the PlanNode's output, store an `&Order::any()` here will not affect + /// The order property of the `PlanNode`'s output, store an `&Order::any()` here will not affect /// correctness, but insert unnecessary sort in plan order: Order, } @@ -117,7 +117,7 @@ pub struct PlanBase { ctx: OptimizerContextRef, schema: Schema, - /// the pk indices of the PlanNode's output, a empty stream key vec means there is no stream key + /// the pk indices of the `PlanNode`'s output, a empty stream key vec means there is no stream key // TODO: this is actually a logical and stream only property. // - For logical nodes, this is `None` in most time expect for the phase after `logical_rewrite_for_stream`. // - For stream nodes, this is always `Some`. diff --git a/src/frontend/src/optimizer/plan_node/stream_project.rs b/src/frontend/src/optimizer/plan_node/stream_project.rs index a373283eb1e27..1b97835e9896f 100644 --- a/src/frontend/src/optimizer/plan_node/stream_project.rs +++ b/src/frontend/src/optimizer/plan_node/stream_project.rs @@ -35,7 +35,7 @@ use crate::utils::ColIndexMappingRewriteExt; pub struct StreamProject { pub base: PlanBase, core: generic::Project, - /// All the watermark derivations, (input_column_index, output_column_index). And the + /// All the watermark derivations, (`input_column_index`, `output_column_index`). And the /// derivation expression is the project's expression itself. watermark_derivations: Vec<(usize, usize)>, /// Nondecreasing expression indices. `Project` can produce watermarks for these expressions. diff --git a/src/frontend/src/optimizer/plan_node/stream_project_set.rs b/src/frontend/src/optimizer/plan_node/stream_project_set.rs index cadab0bb19f34..2af5d54234363 100644 --- a/src/frontend/src/optimizer/plan_node/stream_project_set.rs +++ b/src/frontend/src/optimizer/plan_node/stream_project_set.rs @@ -29,8 +29,8 @@ use crate::utils::ColIndexMappingRewriteExt; pub struct StreamProjectSet { pub base: PlanBase, core: generic::ProjectSet, - /// All the watermark derivations, (input_column_idx, expr_idx). And the - /// derivation expression is the project_set's expression itself. + /// All the watermark derivations, (`input_column_idx`, `expr_idx`). And the + /// derivation expression is the `project_set`'s expression itself. watermark_derivations: Vec<(usize, usize)>, /// Nondecreasing expression indices. `ProjectSet` can produce watermarks for these /// expressions. diff --git a/src/frontend/src/optimizer/property/distribution.rs b/src/frontend/src/optimizer/property/distribution.rs index f0667e5eeb8e3..1b009e3bb9698 100644 --- a/src/frontend/src/optimizer/property/distribution.rs +++ b/src/frontend/src/optimizer/property/distribution.rs @@ -86,8 +86,8 @@ pub enum Distribution { /// `UpstreamHashShard` contains distribution keys, which might be useful in some cases, e.g., /// two-phase Agg. It also satisfies [`RequiredDist::ShardByKey`]. /// - /// TableId is used to represent the data distribution(`vnode_mapping`) of this - /// UpstreamHashShard. The scheduler can fetch TableId's corresponding `vnode_mapping` to do + /// `TableId` is used to represent the data distribution(`vnode_mapping`) of this + /// `UpstreamHashShard`. The scheduler can fetch `TableId`'s corresponding `vnode_mapping` to do /// shuffle. UpstreamHashShard(Vec, TableId), /// Records are available on all downstream shards. diff --git a/src/frontend/src/scheduler/distributed/query.rs b/src/frontend/src/scheduler/distributed/query.rs index 153ae44d33850..2c1044a2039e1 100644 --- a/src/frontend/src/scheduler/distributed/query.rs +++ b/src/frontend/src/scheduler/distributed/query.rs @@ -71,7 +71,7 @@ pub struct QueryExecution { query: Arc, state: RwLock, shutdown_tx: Sender, - /// Identified by process_id, secret_key. Query in the same session should have same key. + /// Identified by `process_id`, `secret_key`. Query in the same session should have same key. pub session_id: SessionId, /// Permit to execute the query. Once query finishes execution, this is dropped. pub permit: Option, diff --git a/src/frontend/src/scheduler/streaming_manager.rs b/src/frontend/src/scheduler/streaming_manager.rs index e6a7ebbf53221..dfe04acaa24dd 100644 --- a/src/frontend/src/scheduler/streaming_manager.rs +++ b/src/frontend/src/scheduler/streaming_manager.rs @@ -64,7 +64,7 @@ impl StreamingJobTracker { #[derive(Clone, Default)] pub struct CreatingStreamingJobInfo { - /// Identified by process_id, secret_key. + /// Identified by `process_id`, `secret_key`. session_id: SessionId, info: CreatingJobInfo, } diff --git a/src/frontend/src/session.rs b/src/frontend/src/session.rs index 9c9b6a7fd84c3..47a8ede81884a 100644 --- a/src/frontend/src/session.rs +++ b/src/frontend/src/session.rs @@ -130,8 +130,8 @@ pub struct FrontendEnv { server_addr: HostAddr, client_pool: ComputeClientPoolRef, - /// Each session is identified by (process_id, - /// secret_key). When Cancel Request received, find corresponding session and cancel all + /// Each session is identified by (`process_id`, + /// `secret_key`). When Cancel Request received, find corresponding session and cancel all /// running queries. sessions_map: SessionMapRef, @@ -558,7 +558,7 @@ pub struct SessionImpl { /// buffer the Notices to users, notices: RwLock>, - /// Identified by process_id, secret_key. Corresponds to SessionManager. + /// Identified by `process_id`, `secret_key`. Corresponds to `SessionManager`. id: (i32, i32), /// Client address diff --git a/src/frontend/src/test_utils.rs b/src/frontend/src/test_utils.rs index 2b59b6e771e2e..239e416e21969 100644 --- a/src/frontend/src/test_utils.rs +++ b/src/frontend/src/test_utils.rs @@ -763,8 +763,8 @@ impl UserInfoWriter for MockUserInfoWriter { UpdateField::Login => user_info.can_login = update_user.can_login, UpdateField::CreateDb => user_info.can_create_db = update_user.can_create_db, UpdateField::CreateUser => user_info.can_create_user = update_user.can_create_user, - UpdateField::AuthInfo => user_info.auth_info = update_user.auth_info.clone(), - UpdateField::Rename => user_info.name = update_user.name.clone(), + UpdateField::AuthInfo => user_info.auth_info.clone_from(&update_user.auth_info), + UpdateField::Rename => user_info.name.clone_from(&update_user.name), UpdateField::Unspecified => unreachable!(), }); lock.update_user(update_user); diff --git a/src/frontend/src/utils/stream_graph_formatter.rs b/src/frontend/src/utils/stream_graph_formatter.rs index e96d20e2bde8e..effe7e69a3c05 100644 --- a/src/frontend/src/utils/stream_graph_formatter.rs +++ b/src/frontend/src/utils/stream_graph_formatter.rs @@ -39,7 +39,7 @@ pub fn explain_stream_graph(graph: &StreamFragmentGraph, is_verbose: bool) -> St /// A formatter to display the final stream plan graph, used for `explain (distsql) create /// materialized view ...` struct StreamGraphFormatter { - /// exchange's operator_id -> edge + /// exchange's `operator_id` -> edge edges: HashMap, verbose: bool, tables: BTreeMap, diff --git a/src/meta/node/src/lib.rs b/src/meta/node/src/lib.rs index 1c296f8daad49..5dcb330f11541 100644 --- a/src/meta/node/src/lib.rs +++ b/src/meta/node/src/lib.rs @@ -78,14 +78,14 @@ pub struct MetaNodeOpts { pub sql_endpoint: Option, /// The HTTP REST-API address of the Prometheus instance associated to this cluster. - /// This address is used to serve PromQL queries to Prometheus. + /// This address is used to serve `PromQL` queries to Prometheus. /// It is also used by Grafana Dashboard Service to fetch metrics and visualize them. #[clap(long, env = "RW_PROMETHEUS_ENDPOINT")] pub prometheus_endpoint: Option, /// The additional selector used when querying Prometheus. /// - /// The format is same as PromQL. Example: `instance="foo",namespace="bar"` + /// The format is same as `PromQL`. Example: `instance="foo",namespace="bar"` #[clap(long, env = "RW_PROMETHEUS_SELECTOR")] pub prometheus_selector: Option, diff --git a/src/meta/src/backup_restore/restore.rs b/src/meta/src/backup_restore/restore.rs index 1afe17b15bebc..84cc623cd3196 100644 --- a/src/meta/src/backup_restore/restore.rs +++ b/src/meta/src/backup_restore/restore.rs @@ -35,7 +35,7 @@ use crate::backup_restore::utils::{get_backup_store, get_meta_store, MetaStoreBa #[derive(clap::Args, Debug, Clone)] pub struct RestoreOpts { /// Id of snapshot used to restore. Available snapshots can be found in - /// /manifest.json. + /// <`storage_directory>/manifest.json`. #[clap(long)] pub meta_snapshot_id: u64, /// Type of meta store to restore. diff --git a/src/meta/src/barrier/command.rs b/src/meta/src/barrier/command.rs index 22311a2b43911..545faaa5847a4 100644 --- a/src/meta/src/barrier/command.rs +++ b/src/meta/src/barrier/command.rs @@ -192,7 +192,7 @@ pub enum Command { SourceSplitAssignment(SplitAssignment), /// `Throttle` command generates a `Throttle` barrier with the given throttle config to change - /// the `rate_limit` of FlowControl Executor after StreamScan or Source. + /// the `rate_limit` of `FlowControl` Executor after `StreamScan` or Source. Throttle(ThrottleConfig), } diff --git a/src/meta/src/barrier/info.rs b/src/meta/src/barrier/info.rs index 7e845be71d987..742dcaeac213c 100644 --- a/src/meta/src/barrier/info.rs +++ b/src/meta/src/barrier/info.rs @@ -37,16 +37,16 @@ pub struct CommandActorChanges { /// [`crate::barrier::GlobalBarrierManager`]. #[derive(Default, Clone)] pub struct InflightActorInfo { - /// node_id => node + /// `node_id` => node pub node_map: HashMap, - /// node_id => actors + /// `node_id` => actors pub actor_map: HashMap>, - /// node_id => barrier inject actors + /// `node_id` => barrier inject actors pub actor_map_to_send: HashMap>, - /// actor_id => WorkerId + /// `actor_id` => `WorkerId` pub actor_location_map: HashMap, } diff --git a/src/meta/src/barrier/mod.rs b/src/meta/src/barrier/mod.rs index 652a4b51d9264..074565f54620e 100644 --- a/src/meta/src/barrier/mod.rs +++ b/src/meta/src/barrier/mod.rs @@ -199,7 +199,7 @@ pub struct GlobalBarrierManager { /// Controls the concurrent execution of commands. struct CheckpointControl { /// Save the state and message of barrier in order. - /// Key is the prev_epoch. + /// Key is the `prev_epoch`. command_ctx_queue: BTreeMap, /// Command that has been collected but is still completing. diff --git a/src/meta/src/barrier/progress.rs b/src/meta/src/barrier/progress.rs index 1fcdace3f28b2..8483856168b52 100644 --- a/src/meta/src/barrier/progress.rs +++ b/src/meta/src/barrier/progress.rs @@ -262,7 +262,7 @@ pub(super) struct TrackingCommand { /// 3. With `progress_map` we can use the ID of the `StreamJob` to view its progress. /// 4. With `actor_map` we can use an actor's `ActorId` to find the ID of the `StreamJob`. pub(super) struct CreateMviewProgressTracker { - /// Progress of the create-mview DDL indicated by the TableId. + /// Progress of the create-mview DDL indicated by the `TableId`. progress_map: HashMap, /// Find the epoch of the create-mview DDL by the actor containing the backfill executors. diff --git a/src/meta/src/controller/streaming_job.rs b/src/meta/src/controller/streaming_job.rs index d929f76bb8f83..a44f7273694b7 100644 --- a/src/meta/src/controller/streaming_job.rs +++ b/src/meta/src/controller/streaming_job.rs @@ -701,7 +701,7 @@ impl CatalogController { fragment_replace_map.get(&m.upstream_fragment_id) { m.upstream_fragment_id = *new_fragment_id; - m.upstream_actor_id = new_actor_ids.clone(); + m.upstream_actor_id.clone_from(new_actor_ids); } }); for fragment_id in &mut upstream_fragment_id.0 { diff --git a/src/meta/src/hummock/compactor_manager.rs b/src/meta/src/hummock/compactor_manager.rs index 8a548d2522e89..805e38f2f34c7 100644 --- a/src/meta/src/hummock/compactor_manager.rs +++ b/src/meta/src/hummock/compactor_manager.rs @@ -122,7 +122,7 @@ pub struct CompactorManagerInner { pub heartbeat_expired_seconds: u64, task_heartbeats: HashMap, - /// The outer lock is a RwLock, so we should still be able to modify each compactor + /// The outer lock is a `RwLock`, so we should still be able to modify each compactor pub compactor_map: HashMap>, } diff --git a/src/meta/src/hummock/manager/mod.rs b/src/meta/src/hummock/manager/mod.rs index 1e466c7d53478..bbba9aeed1fb7 100644 --- a/src/meta/src/hummock/manager/mod.rs +++ b/src/meta/src/hummock/manager/mod.rs @@ -129,8 +129,8 @@ pub struct HummockManager { pub env: MetaSrvEnv, metadata_manager: MetadataManager, - /// Lock order: compaction, versioning, compaction_group_manager. - /// - Lock compaction first, then versioning, and finally compaction_group_manager. + /// Lock order: compaction, versioning, `compaction_group_manager`. + /// - Lock compaction first, then versioning, and finally `compaction_group_manager`. /// - This order should be strictly followed to prevent deadlock. compaction: MonitoredRwLock, versioning: MonitoredRwLock, @@ -1037,7 +1037,9 @@ impl HummockManager { } else if is_trivial_move && can_trivial_move { // this task has been finished and `trivial_move_task` does not need to be schedule. compact_task.set_task_status(TaskStatus::Success); - compact_task.sorted_output_ssts = compact_task.input_ssts[0].table_infos.clone(); + compact_task + .sorted_output_ssts + .clone_from(&compact_task.input_ssts[0].table_infos); self.report_compact_task_impl( task_id, Some(compact_task.clone()), diff --git a/src/meta/src/hummock/vacuum.rs b/src/meta/src/hummock/vacuum.rs index 10f748b671659..0ff1d29aaa2aa 100644 --- a/src/meta/src/hummock/vacuum.rs +++ b/src/meta/src/hummock/vacuum.rs @@ -34,7 +34,7 @@ pub struct VacuumManager { env: MetaSrvEnv, hummock_manager: HummockManagerRef, backup_manager: BackupManagerRef, - /// Use the CompactorManager to dispatch VacuumTask. + /// Use the `CompactorManager` to dispatch `VacuumTask`. compactor_manager: CompactorManagerRef, /// SST object ids which have been dispatched to vacuum nodes but are not replied yet. pending_object_ids: parking_lot::RwLock>, diff --git a/src/meta/src/manager/catalog/fragment.rs b/src/meta/src/manager/catalog/fragment.rs index 4cc95a2352a70..cc606f8bf8fdc 100644 --- a/src/meta/src/manager/catalog/fragment.rs +++ b/src/meta/src/manager/catalog/fragment.rs @@ -113,7 +113,7 @@ pub struct FragmentManager { } pub struct ActorInfos { - /// node_id => actor_ids + /// `node_id` => `actor_ids` pub actor_maps: HashMap>, /// all reachable barrier inject actors @@ -439,8 +439,8 @@ impl FragmentManager { if m.upstream_fragment_id == merge_update.upstream_fragment_id { m.upstream_fragment_id = merge_update.new_upstream_fragment_id.unwrap(); - m.upstream_actor_id = - merge_update.added_upstream_actor_id.clone(); + m.upstream_actor_id + .clone_from(&merge_update.added_upstream_actor_id); } upstream_actor_ids.extend(m.upstream_actor_id.clone()); } diff --git a/src/meta/src/manager/catalog/mod.rs b/src/meta/src/manager/catalog/mod.rs index b6d0c856a1010..3dd49ff07aa4e 100644 --- a/src/meta/src/manager/catalog/mod.rs +++ b/src/meta/src/manager/catalog/mod.rs @@ -3915,9 +3915,9 @@ impl CatalogManager { UpdateField::Login => user.can_login = update_user.can_login, UpdateField::CreateDb => user.can_create_db = update_user.can_create_db, UpdateField::CreateUser => user.can_create_user = update_user.can_create_user, - UpdateField::AuthInfo => user.auth_info = update_user.auth_info.clone(), + UpdateField::AuthInfo => user.auth_info.clone_from(&update_user.auth_info), UpdateField::Rename => { - user.name = update_user.name.clone(); + user.name.clone_from(&update_user.name); } }); diff --git a/src/meta/src/manager/env.rs b/src/meta/src/manager/env.rs index bcfc0bc0d3e31..1eb2188d6bf60 100644 --- a/src/meta/src/manager/env.rs +++ b/src/meta/src/manager/env.rs @@ -158,18 +158,18 @@ pub struct MetaOpts { /// connection`. pub privatelink_endpoint_default_tags: Option>, - /// Schedule space_reclaim_compaction for all compaction groups with this interval. + /// Schedule `space_reclaim_compaction` for all compaction groups with this interval. pub periodic_space_reclaim_compaction_interval_sec: u64, /// telemetry enabled in config file or not pub telemetry_enabled: bool, - /// Schedule ttl_reclaim_compaction for all compaction groups with this interval. + /// Schedule `ttl_reclaim_compaction` for all compaction groups with this interval. pub periodic_ttl_reclaim_compaction_interval_sec: u64, - /// Schedule tombstone_reclaim_compaction for all compaction groups with this interval. + /// Schedule `tombstone_reclaim_compaction` for all compaction groups with this interval. pub periodic_tombstone_reclaim_compaction_interval_sec: u64, - /// Schedule split_compaction_group for all compaction groups with this interval. + /// Schedule `split_compaction_group` for all compaction groups with this interval. pub periodic_split_compact_group_interval_sec: u64, /// The size limit to split a large compaction group. @@ -196,11 +196,11 @@ pub struct MetaOpts { /// hybird compaction group config /// - /// hybird_partition_vnode_count determines the granularity of vnodes in the hybrid compaction group for SST alignment. - /// When hybird_partition_vnode_count > 0, in hybrid compaction group + /// `hybird_partition_vnode_count` determines the granularity of vnodes in the hybrid compaction group for SST alignment. + /// When `hybird_partition_vnode_count` > 0, in hybrid compaction group /// - Tables with high write throughput will be split at vnode granularity /// - Tables with high size tables will be split by table granularity - /// When hybird_partition_vnode_count = 0,no longer be special alignment operations for the hybird compaction group + /// When `hybird_partition_vnode_count` = 0,no longer be special alignment operations for the hybird compaction group pub hybird_partition_vnode_count: u32, pub event_log_enabled: bool, diff --git a/src/meta/src/manager/streaming_job.rs b/src/meta/src/manager/streaming_job.rs index 2f7a68ed081f3..e042a222823f0 100644 --- a/src/meta/src/manager/streaming_job.rs +++ b/src/meta/src/manager/streaming_job.rs @@ -78,7 +78,9 @@ impl StreamingJob { StreamingJob::Sink(table, _) => table.created_at_epoch = created_at_epoch, StreamingJob::Table(source, table, ..) => { table.created_at_epoch = created_at_epoch; - table.created_at_cluster_version = created_at_cluster_version.clone(); + table + .created_at_cluster_version + .clone_from(&created_at_cluster_version); if let Some(source) = source { source.created_at_epoch = created_at_epoch; source.created_at_cluster_version = created_at_cluster_version; @@ -113,7 +115,9 @@ impl StreamingJob { } StreamingJob::Table(source, table, ..) => { table.initialized_at_epoch = initialized_at_epoch; - table.initialized_at_cluster_version = initialized_at_cluster_version.clone(); + table + .initialized_at_cluster_version + .clone_from(&initialized_at_cluster_version); if let Some(source) = source { source.initialized_at_epoch = initialized_at_epoch; diff --git a/src/meta/src/rpc/metrics.rs b/src/meta/src/rpc/metrics.rs index d2dca20f98edf..e60678914c9fd 100644 --- a/src/meta/src/rpc/metrics.rs +++ b/src/meta/src/rpc/metrics.rs @@ -78,7 +78,7 @@ pub struct MetaMetrics { /// ********************************** Hummock ************************************ /// Max committed epoch pub max_committed_epoch: IntGauge, - /// The smallest epoch that has not been GCed. + /// The smallest epoch that has not been `GCed`. pub safe_epoch: IntGauge, /// The smallest epoch that is being pinned. pub min_pinned_epoch: IntGauge, diff --git a/src/meta/src/stream/scale.rs b/src/meta/src/stream/scale.rs index 99ae32d26bb92..b3f62fe609990 100644 --- a/src/meta/src/stream/scale.rs +++ b/src/meta/src/stream/scale.rs @@ -196,9 +196,9 @@ pub struct RescheduleContext { upstream_dispatchers: HashMap>, /// Fragments with stream source stream_source_fragment_ids: HashSet, - /// Target fragments in NoShuffle relation + /// Target fragments in `NoShuffle` relation no_shuffle_target_fragment_ids: HashSet, - /// Source fragments in NoShuffle relation + /// Source fragments in `NoShuffle` relation no_shuffle_source_fragment_ids: HashSet, // index for dispatcher type from upstream fragment to downstream fragment fragment_dispatcher_map: HashMap>, @@ -437,7 +437,7 @@ pub fn rebalance_actor_vnode( #[derive(Debug, Clone, Copy)] pub struct RescheduleOptions { - /// Whether to resolve the upstream of NoShuffle when scaling. It will check whether all the reschedules in the no shuffle dependency tree are corresponding, and rewrite them to the root of the no shuffle dependency tree. + /// Whether to resolve the upstream of `NoShuffle` when scaling. It will check whether all the reschedules in the no shuffle dependency tree are corresponding, and rewrite them to the root of the no shuffle dependency tree. pub resolve_no_shuffle_upstream: bool, /// Whether to skip creating new actors. If it is true, the scaling-out actors will not be created. diff --git a/src/meta/src/stream/source_manager.rs b/src/meta/src/stream/source_manager.rs index e48d1ae8bcb17..b00b9dacda3cd 100644 --- a/src/meta/src/stream/source_manager.rs +++ b/src/meta/src/stream/source_manager.rs @@ -230,7 +230,7 @@ pub struct SourceManagerCore { managed_sources: HashMap, /// Fragments associated with each source source_fragments: HashMap>, - /// Revert index for source_fragments + /// Revert index for `source_fragments` fragment_sources: HashMap, /// Splits assigned per actor diff --git a/src/risedevtool/src/task.rs b/src/risedevtool/src/task.rs index c75363403b3de..b7a348a028a8f 100644 --- a/src/risedevtool/src/task.rs +++ b/src/risedevtool/src/task.rs @@ -95,7 +95,7 @@ where /// The directory for checking status. /// - /// RiseDev will instruct every task to output their status to a file in temporary folder. By + /// `RiseDev` will instruct every task to output their status to a file in temporary folder. By /// checking this file, we can know whether a task has early exited. pub status_dir: Arc, diff --git a/src/storage/backup/src/meta_snapshot_v1.rs b/src/storage/backup/src/meta_snapshot_v1.rs index f6c457572aaa8..f94e3e1446eb1 100644 --- a/src/storage/backup/src/meta_snapshot_v1.rs +++ b/src/storage/backup/src/meta_snapshot_v1.rs @@ -101,7 +101,7 @@ impl Metadata for ClusterMetadata { #[derive(Debug, Default, Clone, PartialEq)] pub struct ClusterMetadata { /// Unlike other metadata that has implemented `MetadataModel`, - /// DEFAULT_COLUMN_FAMILY stores various single row metadata, e.g. id offset and epoch offset. + /// `DEFAULT_COLUMN_FAMILY` stores various single row metadata, e.g. id offset and epoch offset. /// So we use `default_cf` stores raw KVs for them. pub default_cf: HashMap, Vec>, pub hummock_version: HummockVersion, diff --git a/src/storage/compactor/src/lib.rs b/src/storage/compactor/src/lib.rs index 1fd39a674db58..3ceb9f8954e3b 100644 --- a/src/storage/compactor/src/lib.rs +++ b/src/storage/compactor/src/lib.rs @@ -41,7 +41,7 @@ pub struct CompactorOpts { /// The address for contacting this instance of the service. /// This would be synonymous with the service's "public address" /// or "identifying address". - /// Optional, we will use listen_addr if not specified. + /// Optional, we will use `listen_addr` if not specified. #[clap(long, env = "RW_ADVERTISE_ADDR")] pub advertise_addr: Option, diff --git a/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs b/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs index 9e07598d07920..56cea696b4143 100644 --- a/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs +++ b/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs @@ -502,7 +502,9 @@ impl HummockVersion { ); let parent_group_id = group_construct.parent_group_id; new_levels.parent_group_id = parent_group_id; - new_levels.member_table_ids = group_construct.table_ids.clone(); + new_levels + .member_table_ids + .clone_from(&group_construct.table_ids); self.levels.insert(*compaction_group_id, new_levels); sst_split_info.extend(self.init_with_parent_group( parent_group_id, diff --git a/src/storage/hummock_trace/src/record.rs b/src/storage/hummock_trace/src/record.rs index f8e4ceed65449..916a54a2530c0 100644 --- a/src/storage/hummock_trace/src/record.rs +++ b/src/storage/hummock_trace/src/record.rs @@ -151,16 +151,16 @@ pub enum Operation { /// Seal operation of Hummock. Seal(u64, bool), - /// MetaMessage operation of Hummock. + /// `MetaMessage` operation of Hummock. MetaMessage(Box), /// Result operation of Hummock. Result(OperationResult), - /// NewLocalStorage operation of Hummock. + /// `NewLocalStorage` operation of Hummock. NewLocalStorage(TracedNewLocalOptions, LocalStorageId), - /// DropLocalStorage operation of Hummock. + /// `DropLocalStorage` operation of Hummock. DropLocalStorage, /// Init of a local storage diff --git a/src/storage/src/hummock/compactor/compaction_utils.rs b/src/storage/src/hummock/compactor/compaction_utils.rs index 9282b41c7726d..1424ebdd7f5e2 100644 --- a/src/storage/src/hummock/compactor/compaction_utils.rs +++ b/src/storage/src/hummock/compactor/compaction_utils.rs @@ -220,7 +220,7 @@ fn generate_splits_fast( let mut last_split_key_count = 0; for key in indexes { if last_split_key_count >= parallel_key_count { - splits.last_mut().unwrap().right = key.clone(); + splits.last_mut().unwrap().right.clone_from(&key); splits.push(KeyRange_vec::new(key.clone(), vec![])); last_split_key_count = 0; } @@ -289,7 +289,7 @@ pub async fn generate_splits( && !last_key.eq(&key) && remaining_size > parallel_compact_size { - splits.last_mut().unwrap().right = key.clone(); + splits.last_mut().unwrap().right.clone_from(&key); splits.push(KeyRange_vec::new(key.clone(), vec![])); last_buffer_size = data_size; } else { diff --git a/src/storage/src/hummock/store/hummock_storage.rs b/src/storage/src/hummock/store/hummock_storage.rs index a8d2ec560cff1..cef5cca728a17 100644 --- a/src/storage/src/hummock/store/hummock_storage.rs +++ b/src/storage/src/hummock/store/hummock_storage.rs @@ -107,7 +107,7 @@ pub struct HummockStorage { backup_reader: BackupReaderRef, - /// current_epoch < min_current_epoch cannot be read. + /// `current_epoch` < `min_current_epoch` cannot be read. min_current_epoch: Arc, write_limiter: WriteLimiterRef, diff --git a/src/storage/src/hummock/store/local_hummock_storage.rs b/src/storage/src/hummock/store/local_hummock_storage.rs index bfd8d5ace90c9..5215a9eaf18db 100644 --- a/src/storage/src/hummock/store/local_hummock_storage.rs +++ b/src/storage/src/hummock/store/local_hummock_storage.rs @@ -75,7 +75,7 @@ pub struct LocalHummockStorage { /// This also handles a corner case where an executor doing replication /// is scheduled to the same CN as its Upstream executor. /// In that case, we use this flag to avoid reading the same data twice, - /// by ignoring the replicated ReadVersion. + /// by ignoring the replicated `ReadVersion`. is_replicated: bool, /// Event sender. diff --git a/src/storage/src/hummock/store/version.rs b/src/storage/src/hummock/store/version.rs index b0e1f5911fead..232b55dd1212c 100644 --- a/src/storage/src/hummock/store/version.rs +++ b/src/storage/src/hummock/store/version.rs @@ -209,7 +209,7 @@ pub struct HummockReadVersion { /// Indicate if this is replicated. If it is, we should ignore it during /// global state store read, to avoid duplicated results. /// Otherwise for local state store, it is fine, see we will see the - /// ReadVersion just for that local state store. + /// `ReadVersion` just for that local state store. is_replicated: bool, table_watermarks: Option, diff --git a/src/storage/src/hummock/test_utils.rs b/src/storage/src/hummock/test_utils.rs index 81524670a83b9..872e0877ac4a5 100644 --- a/src/storage/src/hummock/test_utils.rs +++ b/src/storage/src/hummock/test_utils.rs @@ -342,7 +342,7 @@ pub async fn gen_default_test_sstable( .await } -pub async fn count_stream(mut i: impl StateStoreIter + Send) -> usize { +pub async fn count_stream(mut i: impl StateStoreIter) -> usize { let mut c: usize = 0; while i.try_next().await.unwrap().is_some() { c += 1 diff --git a/src/storage/src/mem_table.rs b/src/storage/src/mem_table.rs index 99f02758623e2..311e51d2b8e9d 100644 --- a/src/storage/src/mem_table.rs +++ b/src/storage/src/mem_table.rs @@ -52,7 +52,7 @@ pub type ImmId = SharedBufferBatchId; pub enum KeyOp { Insert(Bytes), Delete(Bytes), - /// (old_value, new_value) + /// (`old_value`, `new_value`) Update((Bytes, Bytes)), } diff --git a/src/storage/src/opts.rs b/src/storage/src/opts.rs index 6a39cad111268..eb4008da89942 100644 --- a/src/storage/src/opts.rs +++ b/src/storage/src/opts.rs @@ -134,7 +134,7 @@ pub struct StorageOpts { pub compactor_max_sst_key_count: u64, pub compactor_max_task_multiplier: f32, pub compactor_max_sst_size: u64, - /// enable FastCompactorRunner. + /// enable `FastCompactorRunner`. pub enable_fast_compaction: bool, pub check_compaction_result: bool, pub max_preload_io_retry_times: usize, diff --git a/src/storage/src/store.rs b/src/storage/src/store.rs index 8b6e9df841616..8b15e581796a8 100644 --- a/src/storage/src/store.rs +++ b/src/storage/src/store.rs @@ -315,7 +315,7 @@ pub trait StateStoreWrite: StaticSendSync { pub struct SyncResult { /// The size of all synced shared buffers. pub sync_size: usize, - /// The sst_info of sync. + /// The `sst_info` of sync. pub uncommitted_ssts: Vec, /// The collected table watermarks written by state tables. pub table_watermarks: HashMap, @@ -612,7 +612,7 @@ pub struct NewLocalOptions { pub table_option: TableOption, /// Indicate if this is replicated. If it is, we should not - /// upload its ReadVersions. + /// upload its `ReadVersions`. pub is_replicated: bool, /// The vnode bitmap for the local state store instance diff --git a/src/storage/src/store_impl.rs b/src/storage/src/store_impl.rs index 66bd7b6acc723..c340a9380d57c 100644 --- a/src/storage/src/store_impl.rs +++ b/src/storage/src/store_impl.rs @@ -59,7 +59,7 @@ pub enum StateStoreImpl { /// In-memory B-Tree state store. Should only be used in unit and integration tests. If you /// want speed up e2e test, you should use Hummock in-memory mode instead. Also, this state /// store misses some critical implementation to ensure the correctness of persisting streaming - /// state. (e.g., no read_epoch support, no async checkpoint) + /// state. (e.g., no `read_epoch` support, no async checkpoint) MemoryStateStore(Monitored), SledStateStore(Monitored), } diff --git a/src/storage/src/table/batch_table/storage_table.rs b/src/storage/src/table/batch_table/storage_table.rs index cfed20ddb3ba2..3cf02d31ce87c 100644 --- a/src/storage/src/table/batch_table/storage_table.rs +++ b/src/storage/src/table/batch_table/storage_table.rs @@ -61,7 +61,7 @@ pub struct StorageTableInner { store: S, /// The schema of the output columns, i.e., this table VIEWED BY some executor like - /// RowSeqScanExecutor. + /// `RowSeqScanExecutor`. schema: Schema, /// Used for serializing and deserializing the primary key. @@ -69,10 +69,10 @@ pub struct StorageTableInner { output_indices: Vec, - /// the key part of output_indices. + /// the key part of `output_indices`. key_output_indices: Option>, - /// the value part of output_indices. + /// the value part of `output_indices`. value_output_indices: Vec, /// used for deserializing key part of output row from pk. @@ -91,7 +91,7 @@ pub struct StorageTableInner { distribution: TableDistribution, - /// Used for catalog table_properties + /// Used for catalog `table_properties` table_option: TableOption, read_prefix_len_hint: usize, @@ -676,10 +676,10 @@ struct StorageTableInnerIterInner { output_indices: Vec, - /// the key part of output_indices. + /// the key part of `output_indices`. key_output_indices: Option>, - /// the value part of output_indices. + /// the value part of `output_indices`. value_output_indices: Vec, /// used for deserializing key part of output row from pk. diff --git a/src/stream/src/common/table/state_table.rs b/src/stream/src/common/table/state_table.rs index eaead15d11e4d..cb16229f813ad 100644 --- a/src/stream/src/common/table/state_table.rs +++ b/src/stream/src/common/table/state_table.rs @@ -121,7 +121,7 @@ pub struct StateTableInner< prefix_hint_len: usize, - /// Used for catalog table_properties + /// Used for catalog `table_properties` table_option: TableOption, value_indices: Option>, @@ -141,7 +141,7 @@ pub struct StateTableInner< /// We will need to use to build data chunks from state table rows. data_types: Vec, - /// "i" here refers to the base state_table's actual schema. + /// "i" here refers to the base `state_table`'s actual schema. /// "o" here refers to the replicated state table's output schema. /// This mapping is used to reconstruct a row being written from replicated state table. /// Such that the schema of this row will match the full schema of the base state table. @@ -150,7 +150,7 @@ pub struct StateTableInner< /// Output indices /// Used for: - /// 1. Computing output_value_indices to ser/de replicated rows. + /// 1. Computing `output_value_indices` to ser/de replicated rows. /// 2. Computing output pk indices to used them for backfill state. output_indices: Vec, diff --git a/src/stream/src/executor/backfill/cdc/cdc_backfill.rs b/src/stream/src/executor/backfill/cdc/cdc_backfill.rs index 7218a6947de12..be53266868116 100644 --- a/src/stream/src/executor/backfill/cdc/cdc_backfill.rs +++ b/src/stream/src/executor/backfill/cdc/cdc_backfill.rs @@ -67,7 +67,7 @@ pub struct CdcBackfillExecutor { /// User may select a subset of columns from the upstream table. output_indices: Vec, - /// State table of the CdcBackfill executor + /// State table of the `CdcBackfill` executor state_table: StateTable, progress: Option, @@ -401,7 +401,7 @@ impl CdcBackfillExecutor { // Update last seen binlog offset if consumed_binlog_offset.is_some() { - last_binlog_offset = consumed_binlog_offset.clone(); + last_binlog_offset.clone_from(&consumed_binlog_offset); } // update and persist backfill state diff --git a/src/stream/src/executor/backfill/cdc/state.rs b/src/stream/src/executor/backfill/cdc/state.rs index d27ec89d8ad21..9fda6c811de13 100644 --- a/src/stream/src/executor/backfill/cdc/state.rs +++ b/src/stream/src/executor/backfill/cdc/state.rs @@ -107,7 +107,7 @@ impl CdcBackfillState { let state = self.cached_state.as_mut_slice(); let split_id = Some(ScalarImpl::from(self.split_id.clone())); let state_len = state.len(); - state[0] = split_id.clone(); + state[0].clone_from(&split_id); if let Some(current_pk_pos) = ¤t_pk_pos { state[1..=current_pk_pos.len()].clone_from_slice(current_pk_pos.as_inner()); } diff --git a/src/stream/src/executor/backfill/cdc/upstream_table/external.rs b/src/stream/src/executor/backfill/cdc/upstream_table/external.rs index 0f5677bf92236..a09d8e2954d90 100644 --- a/src/stream/src/executor/backfill/cdc/upstream_table/external.rs +++ b/src/stream/src/executor/backfill/cdc/upstream_table/external.rs @@ -29,7 +29,7 @@ pub struct ExternalStorageTable { table_reader: ExternalTableReaderImpl, /// The schema of the output columns, i.e., this table VIEWED BY some executor like - /// RowSeqScanExecutor. + /// `RowSeqScanExecutor`. /// todo: the schema of the external table defined in the CREATE TABLE DDL schema: Schema, diff --git a/src/stream/src/executor/backfill/no_shuffle_backfill.rs b/src/stream/src/executor/backfill/no_shuffle_backfill.rs index c663e920c1fcd..46597d9414270 100644 --- a/src/stream/src/executor/backfill/no_shuffle_backfill.rs +++ b/src/stream/src/executor/backfill/no_shuffle_backfill.rs @@ -97,7 +97,7 @@ pub struct BackfillExecutor { /// Rate limit, just used to initialize the chunk size for /// snapshot read side. - /// If smaller than chunk_size, it will take precedence. + /// If smaller than `chunk_size`, it will take precedence. rate_limit: Option, } diff --git a/src/stream/src/executor/backfill/utils.rs b/src/stream/src/executor/backfill/utils.rs index c11dd68471253..779845615b928 100644 --- a/src/stream/src/executor/backfill/utils.rs +++ b/src/stream/src/executor/backfill/utils.rs @@ -554,7 +554,7 @@ pub(crate) async fn flush_data( if old_state[1..] != current_partial_state[1..] { vnodes.iter_vnodes_scalar().for_each(|vnode| { let datum = Some(vnode.into()); - current_partial_state[0] = datum.clone(); + current_partial_state[0].clone_from(&datum); old_state[0] = datum; table.write_record(Record::Update { old_row: &old_state[..], diff --git a/src/stream/src/executor/dynamic_filter.rs b/src/stream/src/executor/dynamic_filter.rs index eb5a95991051c..6fa51b9fe7d24 100644 --- a/src/stream/src/executor/dynamic_filter.rs +++ b/src/stream/src/executor/dynamic_filter.rs @@ -425,7 +425,7 @@ impl DynamicFilterExecutor DynamicFilterExecutor HashJoinExecutor, - /// All the watermark derivations, (input_column_index, output_column_index). And the + /// All the watermark derivations, (`input_column_index`, `output_column_index`). And the /// derivation expression is the project's expression itself. watermark_derivations: MultiMap, /// Indices of nondecreasing expressions in the expression list. diff --git a/src/stream/src/executor/project_set.rs b/src/stream/src/executor/project_set.rs index 9fadb5949dac2..dc2a3ea3e15e7 100644 --- a/src/stream/src/executor/project_set.rs +++ b/src/stream/src/executor/project_set.rs @@ -43,11 +43,11 @@ pub struct ProjectSetExecutor { struct Inner { _ctx: ActorContextRef, - /// Expressions of the current project_section. + /// Expressions of the current `project_section`. select_list: Vec, chunk_size: usize, - /// All the watermark derivations, (input_column_index, expr_idx). And the - /// derivation expression is the project_set's expression itself. + /// All the watermark derivations, (`input_column_index`, `expr_idx`). And the + /// derivation expression is the `project_set`'s expression itself. watermark_derivations: MultiMap, /// Indices of nondecreasing expressions in the expression list. nondecreasing_expr_indices: Vec, diff --git a/src/stream/src/executor/source/fs_source_executor.rs b/src/stream/src/executor/source/fs_source_executor.rs index 94576d6a4c459..2aaeadac94731 100644 --- a/src/stream/src/executor/source/fs_source_executor.rs +++ b/src/stream/src/executor/source/fs_source_executor.rs @@ -297,7 +297,7 @@ impl FsSourceExecutor { .. }) => { if let Some(splits) = splits.get(&self.actor_ctx.id) { - boot_state = splits.clone(); + boot_state.clone_from(splits); } } _ => {} diff --git a/src/stream/src/executor/source/source_backfill_executor.rs b/src/stream/src/executor/source/source_backfill_executor.rs index 7109538c38feb..0b7a530f61e98 100644 --- a/src/stream/src/executor/source/source_backfill_executor.rs +++ b/src/stream/src/executor/source/source_backfill_executor.rs @@ -256,7 +256,7 @@ impl SourceBackfillExecutorInner { .. }) => { if let Some(splits) = splits.get(&self.actor_ctx.id) { - owned_splits = splits.clone(); + owned_splits.clone_from(splits); } } _ => {} diff --git a/src/stream/src/executor/source/source_executor.rs b/src/stream/src/executor/source/source_executor.rs index 36358bdcd372e..b48e2c0a13503 100644 --- a/src/stream/src/executor/source/source_executor.rs +++ b/src/stream/src/executor/source/source_executor.rs @@ -380,7 +380,7 @@ impl SourceExecutor { self.actor_ctx.id, splits ); - boot_state = splits.clone(); + boot_state.clone_from(splits); } } _ => {} diff --git a/src/stream/src/executor/top_n/group_top_n.rs b/src/stream/src/executor/top_n/group_top_n.rs index 0720559dc54d0..4f8e3da165994 100644 --- a/src/stream/src/executor/top_n/group_top_n.rs +++ b/src/stream/src/executor/top_n/group_top_n.rs @@ -89,7 +89,7 @@ pub struct InnerGroupTopNExecutor cache for this group caches: GroupTopNCache, - /// Used for serializing pk into CacheKey. + /// Used for serializing pk into `CacheKey`. cache_key_serde: CacheKeySerde, ctx: ActorContextRef, diff --git a/src/stream/src/executor/top_n/group_top_n_appendonly.rs b/src/stream/src/executor/top_n/group_top_n_appendonly.rs index b50897f874bcf..346d73fed0196 100644 --- a/src/stream/src/executor/top_n/group_top_n_appendonly.rs +++ b/src/stream/src/executor/top_n/group_top_n_appendonly.rs @@ -93,7 +93,7 @@ pub struct InnerAppendOnlyGroupTopNExecutor cache for this group caches: GroupTopNCache, - /// Used for serializing pk into CacheKey. + /// Used for serializing pk into `CacheKey`. cache_key_serde: CacheKeySerde, ctx: ActorContextRef, diff --git a/src/stream/src/executor/top_n/top_n_appendonly.rs b/src/stream/src/executor/top_n/top_n_appendonly.rs index 229c87422a0bb..c88d9af3c0f7f 100644 --- a/src/stream/src/executor/top_n/top_n_appendonly.rs +++ b/src/stream/src/executor/top_n/top_n_appendonly.rs @@ -74,7 +74,7 @@ pub struct InnerAppendOnlyTopNExecutor { /// TODO: support WITH TIES cache: TopNCache, - /// Used for serializing pk into CacheKey. + /// Used for serializing pk into `CacheKey`. cache_key_serde: CacheKeySerde, } diff --git a/src/stream/src/executor/top_n/top_n_plain.rs b/src/stream/src/executor/top_n/top_n_plain.rs index f9f183164093a..5a70efc3f3f8e 100644 --- a/src/stream/src/executor/top_n/top_n_plain.rs +++ b/src/stream/src/executor/top_n/top_n_plain.rs @@ -90,7 +90,7 @@ pub struct InnerTopNExecutor { /// In-memory cache of top (N + N * `TOPN_CACHE_HIGH_CAPACITY_FACTOR`) rows cache: TopNCache, - /// Used for serializing pk into CacheKey. + /// Used for serializing pk into `CacheKey`. cache_key_serde: CacheKeySerde, } diff --git a/src/stream/src/executor/top_n/top_n_state.rs b/src/stream/src/executor/top_n/top_n_state.rs index 58bdd867b684e..57f4017e51185 100644 --- a/src/stream/src/executor/top_n/top_n_state.rs +++ b/src/stream/src/executor/top_n/top_n_state.rs @@ -36,7 +36,7 @@ pub struct ManagedTopNState { /// Relational table. state_table: StateTable, - /// Used for serializing pk into CacheKey. + /// Used for serializing pk into `CacheKey`. cache_key_serde: CacheKeySerde, } diff --git a/src/stream/src/executor/watermark_filter.rs b/src/stream/src/executor/watermark_filter.rs index e53545dd394f6..0d77ad49fd32b 100644 --- a/src/stream/src/executor/watermark_filter.rs +++ b/src/stream/src/executor/watermark_filter.rs @@ -242,7 +242,7 @@ impl WatermarkFilterExecutor { if barrier.kind.is_checkpoint() && last_checkpoint_watermark != current_watermark { - last_checkpoint_watermark = current_watermark.clone(); + last_checkpoint_watermark.clone_from(¤t_watermark); // Persist the watermark when checkpoint arrives. if let Some(watermark) = current_watermark.clone() { for vnode in table.vnodes().clone().iter_vnodes() { diff --git a/src/stream/src/task/barrier_manager/managed_state.rs b/src/stream/src/task/barrier_manager/managed_state.rs index 8ce8461dc5c01..9a17afc08a039 100644 --- a/src/stream/src/task/barrier_manager/managed_state.rs +++ b/src/stream/src/task/barrier_manager/managed_state.rs @@ -128,7 +128,7 @@ fn sync_epoch( pub(super) struct ManagedBarrierState { /// Record barrier state for each epoch of concurrent checkpoints. /// - /// The key is prev_epoch, and the first value is curr_epoch + /// The key is `prev_epoch`, and the first value is `curr_epoch` epoch_barrier_state_map: BTreeMap, /// Record the progress updates of creating mviews for each epoch of concurrent checkpoints. diff --git a/src/stream/src/task/stream_manager.rs b/src/stream/src/task/stream_manager.rs index 09c568541b400..acd6d54e313e4 100644 --- a/src/stream/src/task/stream_manager.rs +++ b/src/stream/src/task/stream_manager.rs @@ -118,7 +118,7 @@ pub struct ExecutorParams { /// The input executor. pub input: Vec, - /// FragmentId of the actor + /// `FragmentId` of the actor pub fragment_id: FragmentId, /// Metrics diff --git a/src/tests/simulation/src/cluster.rs b/src/tests/simulation/src/cluster.rs index 60b164ca48ead..8caf8b52931ca 100644 --- a/src/tests/simulation/src/cluster.rs +++ b/src/tests/simulation/src/cluster.rs @@ -81,7 +81,7 @@ pub struct Configuration { /// The number of CPU cores for each compute node. /// - /// This determines worker_node_parallelism. + /// This determines `worker_node_parallelism`. pub compute_node_cores: usize, /// The probability of etcd request timeout. diff --git a/src/tests/simulation/src/main.rs b/src/tests/simulation/src/main.rs index cf976095328ba..a20e120c36762 100644 --- a/src/tests/simulation/src/main.rs +++ b/src/tests/simulation/src/main.rs @@ -53,7 +53,7 @@ pub struct Args { /// The number of CPU cores for each compute node. /// - /// This determines worker_node_parallelism. + /// This determines `worker_node_parallelism`. #[clap(long, default_value = "2")] compute_node_cores: usize, diff --git a/src/tests/sqlsmith/src/sql_gen/mod.rs b/src/tests/sqlsmith/src/sql_gen/mod.rs index 8b821becb59cf..7e86d4df83a49 100644 --- a/src/tests/sqlsmith/src/sql_gen/mod.rs +++ b/src/tests/sqlsmith/src/sql_gen/mod.rs @@ -142,11 +142,11 @@ pub(crate) struct SqlGenerator<'a, R: Rng> { bound_relations: Vec, /// Columns bound in generated query. - /// May not contain all columns from Self::bound_relations. - /// e.g. GROUP BY clause will constrain bound_columns. + /// May not contain all columns from `Self::bound_relations`. + /// e.g. GROUP BY clause will constrain `bound_columns`. bound_columns: Vec, - /// SqlGenerator can be used in two execution modes: + /// `SqlGenerator` can be used in two execution modes: /// 1. Generating Query Statements. /// 2. Generating queries for CREATE MATERIALIZED VIEW. /// Under this mode certain restrictions and workarounds are applied diff --git a/src/tests/sqlsmith/src/sql_gen/query.rs b/src/tests/sqlsmith/src/sql_gen/query.rs index fb5b8c6145a67..11a229844c95a 100644 --- a/src/tests/sqlsmith/src/sql_gen/query.rs +++ b/src/tests/sqlsmith/src/sql_gen/query.rs @@ -264,7 +264,7 @@ impl<'a, R: Rng> SqlGenerator<'a, R> { match self.rng.gen_range(0..=9) { 0..=8 => { let group_by_cols = self.gen_random_bound_columns(); - self.bound_columns = group_by_cols.clone(); + self.bound_columns.clone_from(&group_by_cols); group_by_cols .into_iter() .map(|c| Expr::Identifier(Ident::new_unchecked(c.name)))