use of io.strimzi.api.kafka.model.KafkaRebalance in project strimzi-kafka-operator by strimzi.
the class KafkaRebalanceAssemblyOperatorTest method testNewToProposalReadyToRebalancingToStoppedRebalance.
/**
* Tests the transition from 'New' to to 'ProposalReady'
* The rebalance proposal is approved and the resource moves to 'Rebalancing' then to 'Stopped' (via annotation)
*
* 1. A new KafkaRebalance resource is created; it is in the 'New' state
* 2. The operator requests a rebalance proposal through the Cruise Control REST API
* 3. The rebalance proposal is ready on the first call
* 4. The KafkaRebalance resource moves to the 'ProposalReady' state
* 9. The KafkaRebalance resource is annotated with 'strimzi.io/rebalance=approve'
* 10. The operator requests the rebalance operation through the Cruise Control REST API
* 11. The rebalance operation is not done immediately; the operator starts polling the Cruise Control REST API
* 12. The KafkaRebalance resource moves to the 'Rebalancing' state
* 13. While the operator is waiting for the rebalance to be done, the KafkaRebalance resource is annotated with 'strimzi.io/rebalance=stop'
* 14. The operator stops polling the Cruise Control REST API and requests a stop execution
* 15. The KafkaRebalance resource moves to the 'Stopped' state
*/
@Test
public void testNewToProposalReadyToRebalancingToStoppedRebalance(VertxTestContext context) throws IOException, URISyntaxException {
KafkaRebalance kr = createKafkaRebalance(CLUSTER_NAMESPACE, CLUSTER_NAME, RESOURCE_NAME, EMPTY_KAFKA_REBALANCE_SPEC);
this.krNewToPendingProposalDelete(context, 0, 0, 2, CruiseControlEndpoints.REBALANCE, kr);
}
use of io.strimzi.api.kafka.model.KafkaRebalance in project strimzi-kafka-operator by strimzi.
the class KafkaRebalanceAssemblyOperatorTest method testNewToProposalReadyRebalance.
/**
* Tests the transition from 'New' to 'ProposalReady'
*
* 1. A new KafkaRebalance resource is created; it is in the New state
* 2. The operator requests a rebalance proposal via the Cruise Control REST API
* 3. The rebalance proposal is ready on the first call
* 4. The KafkaRebalance resource moves to the 'ProposalReady' state
*/
@Test
public void testNewToProposalReadyRebalance(VertxTestContext context) throws IOException, URISyntaxException {
KafkaRebalance kr = createKafkaRebalance(CLUSTER_NAMESPACE, CLUSTER_NAME, RESOURCE_NAME, EMPTY_KAFKA_REBALANCE_SPEC);
this.krNewToProposalReady(context, 0, CruiseControlEndpoints.REBALANCE, kr);
}
use of io.strimzi.api.kafka.model.KafkaRebalance in project strimzi-kafka-operator by strimzi.
the class KafkaRebalanceAssemblyOperatorTest method testNewToPendingProposalDeleteRebalance.
/**
* Tests the transition from 'New' to 'PendingProposal' then the resource is deleted
*
* 1. A new KafkaRebalance resource is created; it is in the New state
* 2. The operator requests a rebalance proposal through the Cruise Control REST API
* 3. The rebalance proposal is not ready on the first call; the operator starts polling the Cruise Control REST API
* 4. The KafkaRebalance resource moves to the 'PendingProposal' state
* 5. The KafkaRebalance resource is deleted
*/
@Test
public void testNewToPendingProposalDeleteRebalance(VertxTestContext context) throws IOException, URISyntaxException {
KafkaRebalance kr = createKafkaRebalance(CLUSTER_NAMESPACE, CLUSTER_NAME, RESOURCE_NAME, EMPTY_KAFKA_REBALANCE_SPEC);
this.krNewToPendingProposalDelete(context, 2, CruiseControlEndpoints.REBALANCE, kr);
}
use of io.strimzi.api.kafka.model.KafkaRebalance in project strimzi-kafka-operator by strimzi.
the class KafkaRebalanceStateMachineTest method testProposalReadyNoChange.
@Test
public void testProposalReadyNoChange(Vertx vertx, VertxTestContext context) throws IOException, URISyntaxException {
KafkaRebalance kcRebalance = createKafkaRebalance(KafkaRebalanceState.ProposalReady, null, null, EMPTY_KAFKA_REBALANCE_SPEC);
this.krProposalReadyNoChange(vertx, context, 0, CruiseControlEndpoints.REBALANCE, kcRebalance);
kcRebalance = createKafkaRebalance(KafkaRebalanceState.ProposalReady, null, null, ADD_BROKER_KAFKA_REBALANCE_SPEC);
this.krProposalReadyNoChange(vertx, context, 0, CruiseControlEndpoints.ADD_BROKER, kcRebalance);
kcRebalance = createKafkaRebalance(KafkaRebalanceState.ProposalReady, null, null, REMOVE_BROKER_KAFKA_REBALANCE_SPEC);
this.krProposalReadyNoChange(vertx, context, 0, CruiseControlEndpoints.REMOVE_BROKER, kcRebalance);
}
use of io.strimzi.api.kafka.model.KafkaRebalance in project strimzi-kafka-operator by strimzi.
the class KafkaRebalanceStateMachineTest method testProposalReadyRefreshNoChange.
@Test
public void testProposalReadyRefreshNoChange(Vertx vertx, VertxTestContext context) throws IOException, URISyntaxException {
KafkaRebalance kcRebalance = createKafkaRebalance(KafkaRebalanceState.ProposalReady, null, null, EMPTY_KAFKA_REBALANCE_SPEC);
this.krProposalReadyRefreshNoChange(vertx, context, 0, CruiseControlEndpoints.REBALANCE, kcRebalance);
kcRebalance = createKafkaRebalance(KafkaRebalanceState.ProposalReady, null, null, ADD_BROKER_KAFKA_REBALANCE_SPEC);
this.krProposalReadyRefreshNoChange(vertx, context, 0, CruiseControlEndpoints.ADD_BROKER, kcRebalance);
kcRebalance = createKafkaRebalance(KafkaRebalanceState.ProposalReady, null, null, REMOVE_BROKER_KAFKA_REBALANCE_SPEC);
this.krProposalReadyRefreshNoChange(vertx, context, 0, CruiseControlEndpoints.REMOVE_BROKER, kcRebalance);
}
Aggregations