Skip to content

Commit 2cdbba4

Browse files
committed
clippy
1 parent 91485af commit 2cdbba4

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

rust/operator-binary/src/config/jvm.rs

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,9 @@ pub enum Error {
2828
/// All JVM arguments.
2929
fn construct_jvm_args(
3030
hive: &HiveCluster,
31-
merged_config: &MetaStoreConfig,
3231
role: &Role<MetaStoreConfigFragment, GenericRoleConfig, JavaCommonConfig>,
3332
role_group: &str,
3433
) -> Result<Vec<String>, Error> {
35-
let heap_size = MemoryQuantity::try_from(
36-
merged_config
37-
.resources
38-
.memory
39-
.limit
40-
.as_ref()
41-
.context(MissingMemoryResourceConfigSnafu)?,
42-
)
43-
.context(InvalidMemoryConfigSnafu)?
44-
.scale_to(BinaryMultiple::Mebi)
45-
* JAVA_HEAP_FACTOR;
46-
let java_heap = heap_size
47-
.format_for_java()
48-
.context(InvalidMemoryConfigSnafu)?;
49-
5034
let mut jvm_args = vec![
5135
format!("-Djava.security.properties={STACKABLE_CONFIG_DIR}/{JVM_SECURITY_PROPERTIES_FILE}"),
5236
format!("-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar={METRICS_PORT}:/stackable/jmx/jmx_hive_config.yaml"),
@@ -73,11 +57,10 @@ fn construct_jvm_args(
7357
/// [`construct_heap_jvm_args`]).
7458
pub fn construct_non_heap_jvm_args(
7559
hive: &HiveCluster,
76-
merged_config: &MetaStoreConfig,
7760
role: &Role<MetaStoreConfigFragment, GenericRoleConfig, JavaCommonConfig>,
7861
role_group: &str,
7962
) -> Result<String, Error> {
80-
let mut jvm_args = construct_jvm_args(hive, merged_config, role, role_group)?;
63+
let mut jvm_args = construct_jvm_args(hive, role, role_group)?;
8164
jvm_args.retain(|arg| !is_heap_jvm_argument(arg));
8265

8366
Ok(jvm_args.join(" "))
@@ -133,8 +116,7 @@ mod tests {
133116
replicas: 1
134117
"#;
135118
let (hive, merged_config, role, rolegroup) = construct_boilerplate(input);
136-
let non_heap_jvm_args =
137-
construct_non_heap_jvm_args(&hive, &merged_config, &role, &rolegroup).unwrap();
119+
let non_heap_jvm_args = construct_non_heap_jvm_args(&hive, &role, &rolegroup).unwrap();
138120
let hadoop_heapsize_env = construct_hadoop_heapsize_env(&merged_config).unwrap();
139121

140122
assert_eq!(
@@ -186,8 +168,7 @@ mod tests {
186168
- -Dhttps.proxyPort=1234
187169
"#;
188170
let (hive, merged_config, role, rolegroup) = construct_boilerplate(input);
189-
let non_heap_jvm_args =
190-
construct_non_heap_jvm_args(&hive, &merged_config, &role, &rolegroup).unwrap();
171+
let non_heap_jvm_args = construct_non_heap_jvm_args(&hive, &role, &rolegroup).unwrap();
191172
let hadoop_heapsize_env = construct_hadoop_heapsize_env(&merged_config).unwrap();
192173

193174
assert_eq!(

rust/operator-binary/src/controller.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -626,13 +626,8 @@ fn build_metastore_rolegroup_config_map(
626626
),
627627
(
628628
"HADOOP_OPTS".to_string(),
629-
construct_non_heap_jvm_args(
630-
hive,
631-
merged_config,
632-
role,
633-
&rolegroup.role_group,
634-
)
635-
.context(ConstructJvmArgumentsSnafu)?,
629+
construct_non_heap_jvm_args(hive, role, &rolegroup.role_group)
630+
.context(ConstructJvmArgumentsSnafu)?,
636631
),
637632
]);
638633

0 commit comments

Comments
 (0)