Search in sources :

Example 91 with KafkaRebalance

use of io.strimzi.api.kafka.model.KafkaRebalance in project strimzi-kafka-operator by strimzi.

the class KafkaRebalanceStateMachineTest method testNotReadyRefreshToProposalReady.

@Test
public void testNotReadyRefreshToProposalReady(Vertx vertx, VertxTestContext context) throws IOException, URISyntaxException {
    KafkaRebalance kcRebalance = createKafkaRebalance(KafkaRebalanceState.NotReady, null, null, EMPTY_KAFKA_REBALANCE_SPEC);
    this.krNotReadyRefreshToProposalReady(vertx, context, 0, CruiseControlEndpoints.REBALANCE, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.NotReady, null, null, ADD_BROKER_KAFKA_REBALANCE_SPEC);
    this.krNotReadyRefreshToProposalReady(vertx, context, 0, CruiseControlEndpoints.ADD_BROKER, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.NotReady, null, null, REMOVE_BROKER_KAFKA_REBALANCE_SPEC);
    this.krNotReadyRefreshToProposalReady(vertx, context, 0, CruiseControlEndpoints.REMOVE_BROKER, kcRebalance);
}
Also used : KafkaRebalance(io.strimzi.api.kafka.model.KafkaRebalance) Test(org.junit.jupiter.api.Test)

Example 92 with KafkaRebalance

use of io.strimzi.api.kafka.model.KafkaRebalance in project strimzi-kafka-operator by strimzi.

the class KafkaRebalanceStateMachineTest method testProposalReadyToRebalancingWithNotEnoughData.

@Test
public void testProposalReadyToRebalancingWithNotEnoughData(Vertx vertx, VertxTestContext context) throws IOException, URISyntaxException {
    KafkaRebalance kcRebalance = createKafkaRebalance(KafkaRebalanceState.ProposalReady, null, null, EMPTY_KAFKA_REBALANCE_SPEC);
    this.krProposalReadyToRebalancingWithNotEnoughData(vertx, context, CruiseControlEndpoints.REBALANCE, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.ProposalReady, null, null, ADD_BROKER_KAFKA_REBALANCE_SPEC);
    this.krProposalReadyToRebalancingWithNotEnoughData(vertx, context, CruiseControlEndpoints.ADD_BROKER, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.ProposalReady, null, null, REMOVE_BROKER_KAFKA_REBALANCE_SPEC);
    this.krProposalReadyToRebalancingWithNotEnoughData(vertx, context, CruiseControlEndpoints.REMOVE_BROKER, kcRebalance);
}
Also used : KafkaRebalance(io.strimzi.api.kafka.model.KafkaRebalance) Test(org.junit.jupiter.api.Test)

Example 93 with KafkaRebalance

use of io.strimzi.api.kafka.model.KafkaRebalance in project strimzi-kafka-operator by strimzi.

the class KafkaRebalanceStateMachineTest method testNewToProposalReady.

@Test
public void testNewToProposalReady(Vertx vertx, VertxTestContext context) throws IOException, URISyntaxException {
    KafkaRebalance kcRebalance = createKafkaRebalance(KafkaRebalanceState.New, null, null, EMPTY_KAFKA_REBALANCE_SPEC);
    this.krNewToProposalReady(vertx, context, 0, CruiseControlEndpoints.REBALANCE, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.New, null, null, ADD_BROKER_KAFKA_REBALANCE_SPEC);
    this.krNewToProposalReady(vertx, context, 0, CruiseControlEndpoints.ADD_BROKER, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.New, null, null, REMOVE_BROKER_KAFKA_REBALANCE_SPEC);
    this.krNewToProposalReady(vertx, context, 0, CruiseControlEndpoints.REMOVE_BROKER, kcRebalance);
}
Also used : KafkaRebalance(io.strimzi.api.kafka.model.KafkaRebalance) Test(org.junit.jupiter.api.Test)

Example 94 with KafkaRebalance

use of io.strimzi.api.kafka.model.KafkaRebalance in project strimzi-kafka-operator by strimzi.

the class KafkaRebalanceStateMachineTest method testNotReadyRefreshToPendingProposalNotEnoughData.

@Test
public void testNotReadyRefreshToPendingProposalNotEnoughData(Vertx vertx, VertxTestContext context) throws IOException, URISyntaxException {
    KafkaRebalance kcRebalance = createKafkaRebalance(KafkaRebalanceState.NotReady, null, null, EMPTY_KAFKA_REBALANCE_SPEC);
    this.krNotReadyRefreshToPendingProposalNotEnoughData(vertx, context, CruiseControlEndpoints.REBALANCE, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.NotReady, null, null, ADD_BROKER_KAFKA_REBALANCE_SPEC);
    this.krNotReadyRefreshToPendingProposalNotEnoughData(vertx, context, CruiseControlEndpoints.ADD_BROKER, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.NotReady, null, null, REMOVE_BROKER_KAFKA_REBALANCE_SPEC);
    this.krNotReadyRefreshToPendingProposalNotEnoughData(vertx, context, CruiseControlEndpoints.REMOVE_BROKER, kcRebalance);
}
Also used : KafkaRebalance(io.strimzi.api.kafka.model.KafkaRebalance) Test(org.junit.jupiter.api.Test)

Example 95 with KafkaRebalance

use of io.strimzi.api.kafka.model.KafkaRebalance in project strimzi-kafka-operator by strimzi.

the class KafkaRebalanceStateMachineTest method testProposalPendingToStopped.

@Test
public void testProposalPendingToStopped(Vertx vertx, VertxTestContext context) throws IOException, URISyntaxException {
    KafkaRebalance kcRebalance = createKafkaRebalance(KafkaRebalanceState.PendingProposal, null, "stop", EMPTY_KAFKA_REBALANCE_SPEC);
    this.krProposalPendingToStopped(vertx, context, 3, CruiseControlEndpoints.REBALANCE, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.PendingProposal, null, "stop", ADD_BROKER_KAFKA_REBALANCE_SPEC);
    this.krProposalPendingToStopped(vertx, context, 3, CruiseControlEndpoints.ADD_BROKER, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.PendingProposal, null, "stop", REMOVE_BROKER_KAFKA_REBALANCE_SPEC);
    this.krProposalPendingToStopped(vertx, context, 3, CruiseControlEndpoints.REMOVE_BROKER, kcRebalance);
}
Also used : KafkaRebalance(io.strimzi.api.kafka.model.KafkaRebalance) Test(org.junit.jupiter.api.Test)

Aggregations

KafkaRebalance (io.strimzi.api.kafka.model.KafkaRebalance)200 Test (org.junit.jupiter.api.Test)182 KafkaRebalanceSpec (io.strimzi.api.kafka.model.KafkaRebalanceSpec)76 KafkaRebalanceSpecBuilder (io.strimzi.api.kafka.model.KafkaRebalanceSpecBuilder)72 ConfigMap (io.fabric8.kubernetes.api.model.ConfigMap)60 Condition (io.strimzi.api.kafka.model.status.Condition)58 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)56 KafkaRebalanceList (io.strimzi.api.kafka.KafkaRebalanceList)56 KafkaRebalanceBuilder (io.strimzi.api.kafka.model.KafkaRebalanceBuilder)56 InvalidResourceException (io.strimzi.operator.cluster.model.InvalidResourceException)56 NoSuchResourceException (io.strimzi.operator.cluster.model.NoSuchResourceException)56 ResourceOperatorSupplier (io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier)56 CruiseControlApi (io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlApi)56 CruiseControlApiImpl (io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlApiImpl)56 CruiseControlRestException (io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlRestException)56 Reconciliation (io.strimzi.operator.common.Reconciliation)56 ConfigMapOperator (io.strimzi.operator.common.operator.resource.ConfigMapOperator)56 Map (java.util.Map)56 Secret (io.fabric8.kubernetes.api.model.Secret)54 KafkaList (io.strimzi.api.kafka.KafkaList)54