Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ public class ApacheKafkaContainerCluster implements Startable {
private final Collection<KafkaContainer> brokers;

public ApacheKafkaContainerCluster(String version, int brokersNum, int internalTopicsRf) {
if (brokersNum < 0) {
if (brokersNum <= 0) {
throw new IllegalArgumentException("brokersNum '" + brokersNum + "' must be greater than 0");
}
if (internalTopicsRf < 0 || internalTopicsRf > brokersNum) {
if (internalTopicsRf <= 0 || internalTopicsRf > brokersNum) {
throw new IllegalArgumentException(
"internalTopicsRf '" + internalTopicsRf + "' must be less than brokersNum and greater than 0"
"internalTopicsRf '" +
internalTopicsRf +
"' must be less than or equal to brokersNum and greater than 0"
);
}

Expand Down Expand Up @@ -99,6 +101,6 @@ public void start() {

@Override
public void stop() {
this.brokers.stream().parallel().forEach(GenericContainer::stop);
this.brokers.parallelStream().forEach(GenericContainer::stop);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ public class ConfluentKafkaContainerCluster implements Startable {
private final Collection<ConfluentKafkaContainer> brokers;

public ConfluentKafkaContainerCluster(String confluentPlatformVersion, int brokersNum, int internalTopicsRf) {
if (brokersNum < 0) {
if (brokersNum <= 0) {
throw new IllegalArgumentException("brokersNum '" + brokersNum + "' must be greater than 0");
}
if (internalTopicsRf < 0 || internalTopicsRf > brokersNum) {
if (internalTopicsRf <= 0 || internalTopicsRf > brokersNum) {
throw new IllegalArgumentException(
"internalTopicsRf '" + internalTopicsRf + "' must be less than brokersNum and greater than 0"
"internalTopicsRf '" +
internalTopicsRf +
"' must be less than or equal to brokersNum and greater than 0"
);
}

Expand Down Expand Up @@ -100,6 +102,6 @@ public void start() {

@Override
public void stop() {
this.brokers.stream().parallel().forEach(GenericContainer::stop);
this.brokers.parallelStream().forEach(GenericContainer::stop);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ public class KafkaContainerCluster implements Startable {
private final Collection<KafkaContainer> brokers;

public KafkaContainerCluster(String confluentPlatformVersion, int brokersNum, int internalTopicsRf) {
if (brokersNum < 0) {
if (brokersNum <= 0) {
throw new IllegalArgumentException("brokersNum '" + brokersNum + "' must be greater than 0");
}
if (internalTopicsRf < 0 || internalTopicsRf > brokersNum) {
if (internalTopicsRf <= 0 || internalTopicsRf > brokersNum) {
throw new IllegalArgumentException(
"internalTopicsRf '" + internalTopicsRf + "' must be less than brokersNum and greater than 0"
"internalTopicsRf '" +
internalTopicsRf +
"' must be less than or equal to brokersNum and greater than 0"
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ public class KafkaContainerKraftCluster implements Startable {
private final Collection<KafkaContainer> brokers;

public KafkaContainerKraftCluster(String confluentPlatformVersion, int brokersNum, int internalTopicsRf) {
if (brokersNum < 0) {
if (brokersNum <= 0) {
throw new IllegalArgumentException("brokersNum '" + brokersNum + "' must be greater than 0");
}
if (internalTopicsRf < 0 || internalTopicsRf > brokersNum) {
if (internalTopicsRf <= 0 || internalTopicsRf > brokersNum) {
throw new IllegalArgumentException(
"internalTopicsRf '" + internalTopicsRf + "' must be less than brokersNum and greater than 0"
"internalTopicsRf '" +
internalTopicsRf +
"' must be less than or equal to brokersNum and greater than 0"
);
}

Expand Down Expand Up @@ -101,6 +103,6 @@ public void start() {

@Override
public void stop() {
this.brokers.stream().parallel().forEach(GenericContainer::stop);
this.brokers.parallelStream().forEach(GenericContainer::stop);
}
}
Loading