Skip to content

Commit 91694e1

Browse files
committed
Refactor CC capacity configuration classes
Signed-off-by: Kyle Liberti <[email protected]>
1 parent cebeb94 commit 91694e1

File tree

13 files changed

+820
-635
lines changed

13 files changed

+820
-635
lines changed

cluster-operator/src/main/java/io/strimzi/operator/cluster/model/CruiseControl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import io.strimzi.api.kafka.model.kafka.cruisecontrol.CruiseControlTemplate;
3636
import io.strimzi.certs.CertAndKey;
3737
import io.strimzi.operator.cluster.ClusterOperatorConfig;
38-
import io.strimzi.operator.cluster.model.cruisecontrol.Capacity;
38+
import io.strimzi.operator.cluster.model.cruisecontrol.CapacityConfiguration;
3939
import io.strimzi.operator.cluster.model.cruisecontrol.CruiseControlConfiguration;
4040
import io.strimzi.operator.cluster.model.cruisecontrol.HashLoginServiceApiCredentials;
4141
import io.strimzi.operator.cluster.model.logging.LoggingModel;
@@ -111,7 +111,7 @@ public class CruiseControl extends AbstractModel implements SupportsMetrics, Sup
111111
private boolean authEnabled;
112112
private HashLoginServiceApiCredentials apiCredentials;
113113
@SuppressFBWarnings({"UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"}) // This field is initialized in the fromCrd method
114-
protected Capacity capacity;
114+
protected CapacityConfiguration capacityConfiguration;
115115
@SuppressFBWarnings({"UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"}) // This field is initialized in the fromCrd method
116116
private MetricsModel metrics;
117117
private LoggingModel logging;
@@ -197,6 +197,7 @@ public static CruiseControl fromCrd(
197197
result.image = image;
198198

199199
KafkaConfiguration kafkaConfiguration = new KafkaConfiguration(reconciliation, kafkaClusterSpec.getConfig().entrySet());
200+
result.capacityConfiguration = new CapacityConfiguration(reconciliation, kafkaCr.getSpec(), kafkaBrokerNodes, kafkaStorage, kafkaBrokerResources);
200201
result.updateConfigurationWithDefaults(ccSpec, kafkaConfiguration);
201202

202203
CruiseControlConfiguration ccConfiguration = result.configuration;
@@ -207,7 +208,6 @@ public static CruiseControl fromCrd(
207208

208209
// To avoid illegal storage configurations provided by the user,
209210
// we rely on the storage configuration provided by the KafkaAssemblyOperator
210-
result.capacity = new Capacity(reconciliation, kafkaCr.getSpec(), kafkaBrokerNodes, kafkaStorage, kafkaBrokerResources);
211211
result.readinessProbeOptions = ProbeUtils.extractReadinessProbeOptionsOrDefault(ccSpec, ProbeUtils.DEFAULT_HEALTHCHECK_OPTIONS);
212212
result.livenessProbeOptions = ProbeUtils.extractLivenessProbeOptionsOrDefault(ccSpec, ProbeUtils.DEFAULT_HEALTHCHECK_OPTIONS);
213213
result.gcLoggingEnabled = ccSpec.getJvmOptions() == null ? JvmOptions.DEFAULT_GC_LOGGING_ENABLED : ccSpec.getJvmOptions().isGcLoggingEnabled();
@@ -530,7 +530,7 @@ public LoggingModel logging() {
530530
public ConfigMap generateConfigMap(MetricsAndLogging metricsAndLogging) {
531531
Map<String, String> configMapData = new HashMap<>();
532532
configMapData.put(SERVER_CONFIG_FILENAME, configuration.asOrderedProperties().asPairs());
533-
configMapData.put(CAPACITY_CONFIG_FILENAME, capacity.toString());
533+
configMapData.put(CAPACITY_CONFIG_FILENAME, capacityConfiguration.toString());
534534
configMapData.putAll(ConfigMapUtils.generateMetricsAndLogConfigMapData(reconciliation, this, metricsAndLogging));
535535

536536
return ConfigMapUtils

cluster-operator/src/main/java/io/strimzi/operator/cluster/model/cruisecontrol/BrokerCapacity.java

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)