Search in sources :

Example 96 with KafkaRebalance

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

the class KafkaRebalanceStateMachineTest method testRebalancingCompletedWithError.

@Test
public void testRebalancingCompletedWithError(Vertx vertx, VertxTestContext context) throws IOException, URISyntaxException {
    KafkaRebalance kcRebalance = createKafkaRebalance(KafkaRebalanceState.Rebalancing, MockCruiseControl.REBALANCE_NO_GOALS_RESPONSE_UTID, null, EMPTY_KAFKA_REBALANCE_SPEC);
    this.krRebalancingToStopped(vertx, context, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.Rebalancing, MockCruiseControl.REBALANCE_NO_GOALS_RESPONSE_UTID, null, ADD_BROKER_KAFKA_REBALANCE_SPEC);
    this.krRebalancingToStopped(vertx, context, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.Rebalancing, MockCruiseControl.REBALANCE_NO_GOALS_RESPONSE_UTID, null, REMOVE_BROKER_KAFKA_REBALANCE_SPEC);
    this.krRebalancingToStopped(vertx, context, kcRebalance);
}
Also used : KafkaRebalance(io.strimzi.api.kafka.model.KafkaRebalance) Test(org.junit.jupiter.api.Test)

Example 97 with KafkaRebalance

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

the class KafkaRebalanceStateMachineTest method testReadyRefreshToProposalReady.

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

Example 98 with KafkaRebalance

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

the class KafkaRebalanceStateMachineTest method testNotReadyRefreshToPendingProposal.

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

Example 99 with KafkaRebalance

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

the class KafkaRebalanceStateMachineTest method testProposalReadyToRebalancing.

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

Example 100 with KafkaRebalance

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

the class KafkaRebalanceStateMachineTest method testStoppedRefreshToProposalReady.

@Test
public void testStoppedRefreshToProposalReady(Vertx vertx, VertxTestContext context) throws IOException, URISyntaxException {
    KafkaRebalance kcRebalance = createKafkaRebalance(KafkaRebalanceState.Stopped, null, null, EMPTY_KAFKA_REBALANCE_SPEC);
    this.krStoppedRefreshToProposalReady(vertx, context, 0, CruiseControlEndpoints.REBALANCE, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.Stopped, null, null, ADD_BROKER_KAFKA_REBALANCE_SPEC);
    this.krStoppedRefreshToProposalReady(vertx, context, 0, CruiseControlEndpoints.ADD_BROKER, kcRebalance);
    kcRebalance = createKafkaRebalance(KafkaRebalanceState.Stopped, null, null, REMOVE_BROKER_KAFKA_REBALANCE_SPEC);
    this.krStoppedRefreshToProposalReady(vertx, context, 0, 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