use of io.strimzi.api.kafka.model.JvmOptions in project strimzi by strimzi.
the class AbstractModelTest method testJvmPerformanceOptions.
@ParallelTest
public void testJvmPerformanceOptions() {
JvmOptions opts = TestUtils.fromJson("{}", JvmOptions.class);
assertThat(getPerformanceOptions(opts), is(nullValue()));
opts = TestUtils.fromJson("{" + " \"-XX\":" + " {\"key1\": \"value1\"," + " \"key2\": \"true\"," + " \"key3\": false," + " \"key4\": 10}" + "}", JvmOptions.class);
assertThat(getPerformanceOptions(opts), is("-XX:key1=value1 -XX:+key2 -XX:-key3 -XX:key4=10"));
}
use of io.strimzi.api.kafka.model.JvmOptions in project strimzi by strimzi.
the class AbstractModelTest method jvmOptions.
private static JvmOptions jvmOptions(String xmx, String xms) {
JvmOptions result = new JvmOptions();
result.setXms(xms);
result.setXmx(xmx);
return result;
}
use of io.strimzi.api.kafka.model.JvmOptions in project strimzi by strimzi.
the class AbstractModelTest method getStringStringMap.
private Map<String, String> getStringStringMap(String xmx, String xms, double dynamicFraction, long dynamicMax, ResourceRequirements resources) {
Kafka resource = new KafkaBuilder().withNewMetadata().endMetadata().build();
AbstractModel am = new Model(resource);
am.setLabels(Labels.forStrimziCluster("foo"));
am.setJvmOptions(jvmOptions(xmx, xms));
am.setResources(resources);
List<EnvVar> envVars = new ArrayList<>(1);
am.heapOptions(envVars, dynamicFraction, dynamicMax);
return envVars.stream().collect(Collectors.toMap(e -> e.getName(), e -> e.getValue()));
}
use of io.strimzi.api.kafka.model.JvmOptions in project strimzi-kafka-operator by strimzi.
the class AbstractModelTest method getStringStringMap.
private Map<String, String> getStringStringMap(String xmx, String xms, double dynamicFraction, long dynamicMax, ResourceRequirements resources) {
Kafka resource = new KafkaBuilder().withNewMetadata().endMetadata().build();
AbstractModel am = new Model(resource);
am.setLabels(Labels.forStrimziCluster("foo"));
am.setJvmOptions(jvmOptions(xmx, xms));
am.setResources(resources);
List<EnvVar> envVars = new ArrayList<>(1);
am.heapOptions(envVars, dynamicFraction, dynamicMax);
return envVars.stream().collect(Collectors.toMap(e -> e.getName(), e -> e.getValue()));
}
use of io.strimzi.api.kafka.model.JvmOptions in project strimzi-kafka-operator by strimzi.
the class AbstractModelTest method testJvmPerformanceOptions.
@ParallelTest
public void testJvmPerformanceOptions() {
JvmOptions opts = TestUtils.fromJson("{}", JvmOptions.class);
assertThat(getPerformanceOptions(opts), is(nullValue()));
opts = TestUtils.fromJson("{" + " \"-XX\":" + " {\"key1\": \"value1\"," + " \"key2\": \"true\"," + " \"key3\": false," + " \"key4\": 10}" + "}", JvmOptions.class);
assertThat(getPerformanceOptions(opts), is("-XX:key1=value1 -XX:+key2 -XX:-key3 -XX:key4=10"));
}
Aggregations