use of io.strimzi.api.kafka.model.status.KafkaRebalanceStatusBuilder in project strimzi-kafka-operator by strimzi.
the class KafkaRebalanceAssemblyOperator method buildRebalanceStatusFromPreviousStatus.
private KafkaRebalanceStatus buildRebalanceStatusFromPreviousStatus(KafkaRebalanceStatus currentStatus, Set<Condition> validation) {
List<Condition> conditions = new ArrayList<>();
conditions.addAll(validation);
Condition currentState = rebalanceStateCondition(currentStatus);
conditions.add(currentState);
return new KafkaRebalanceStatusBuilder().withSessionId(currentStatus.getSessionId()).withOptimizationResult(currentStatus.getOptimizationResult()).withConditions(conditions).build();
}
use of io.strimzi.api.kafka.model.status.KafkaRebalanceStatusBuilder in project strimzi-kafka-operator by strimzi.
the class KafkaRebalanceAssemblyOperator method buildRebalanceStatus.
private MapAndStatus<ConfigMap, KafkaRebalanceStatus> buildRebalanceStatus(KafkaRebalance kafkaRebalance, String sessionID, KafkaRebalanceState cruiseControlState, JsonObject proposalJson, Set<Condition> validation) {
List<Condition> conditions = new ArrayList<>();
conditions.add(StatusUtils.buildRebalanceCondition(cruiseControlState.toString()));
conditions.addAll(validation);
MapAndStatus<ConfigMap, Map<String, Object>> optimizationProposalMapAndStatus = processOptimizationProposal(kafkaRebalance, proposalJson);
return new MapAndStatus<>(optimizationProposalMapAndStatus.getLoadMap(), new KafkaRebalanceStatusBuilder().withSessionId(sessionID).withConditions(conditions).withOptimizationResult(optimizationProposalMapAndStatus.getStatus()).build());
}
use of io.strimzi.api.kafka.model.status.KafkaRebalanceStatusBuilder in project strimzi by strimzi.
the class KafkaRebalanceAssemblyOperator method buildRebalanceStatusFromPreviousStatus.
private KafkaRebalanceStatus buildRebalanceStatusFromPreviousStatus(KafkaRebalanceStatus currentStatus, Set<Condition> validation) {
List<Condition> conditions = new ArrayList<>();
conditions.addAll(validation);
Condition currentState = rebalanceStateCondition(currentStatus);
conditions.add(currentState);
return new KafkaRebalanceStatusBuilder().withSessionId(currentStatus.getSessionId()).withOptimizationResult(currentStatus.getOptimizationResult()).withConditions(conditions).build();
}
use of io.strimzi.api.kafka.model.status.KafkaRebalanceStatusBuilder in project strimzi by strimzi.
the class KafkaRebalanceAssemblyOperator method buildRebalanceStatus.
private MapAndStatus<ConfigMap, KafkaRebalanceStatus> buildRebalanceStatus(KafkaRebalance kafkaRebalance, String sessionID, KafkaRebalanceState cruiseControlState, JsonObject proposalJson, Set<Condition> validation) {
List<Condition> conditions = new ArrayList<>();
conditions.add(StatusUtils.buildRebalanceCondition(cruiseControlState.toString()));
conditions.addAll(validation);
MapAndStatus<ConfigMap, Map<String, Object>> optimizationProposalMapAndStatus = processOptimizationProposal(kafkaRebalance, proposalJson);
return new MapAndStatus<>(optimizationProposalMapAndStatus.getLoadMap(), new KafkaRebalanceStatusBuilder().withSessionId(sessionID).withConditions(conditions).withOptimizationResult(optimizationProposalMapAndStatus.getStatus()).build());
}
Aggregations