-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ability to move data between JBOD disks using Cruise Control (#10644)
Signed-off-by: ShubhamRwt <[email protected]>
- Loading branch information
1 parent
1961072
commit a55eabf
Showing
23 changed files
with
1,206 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
api/src/main/java/io/strimzi/api/kafka/model/rebalance/BrokerAndVolumeIds.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright Strimzi authors. | ||
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). | ||
*/ | ||
package io.strimzi.api.kafka.model.rebalance; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
import io.strimzi.api.kafka.model.common.Constants; | ||
import io.strimzi.api.kafka.model.common.UnknownPropertyPreserving; | ||
import io.strimzi.crdgenerator.annotations.Description; | ||
import io.strimzi.crdgenerator.annotations.MinimumItems; | ||
import io.sundr.builder.annotations.Buildable; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.ToString; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* Configures the broker and Volume IDs for the remove-disks endpoint for Cruise Control | ||
*/ | ||
@Buildable( | ||
editableEnabled = false, | ||
builderPackage = Constants.FABRIC8_KUBERNETES_API | ||
) | ||
@JsonPropertyOrder({"brokerId", "volumeIds"}) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@EqualsAndHashCode | ||
@ToString | ||
public class BrokerAndVolumeIds implements UnknownPropertyPreserving { | ||
|
||
private Integer brokerId; | ||
private List<Integer> volumeIds; | ||
private Map<String, Object> additionalProperties; | ||
|
||
@Description("ID of the broker that contains the disk from which you want to move the partition replicas.") | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public Integer getBrokerId() { | ||
return brokerId; | ||
} | ||
|
||
public void setBrokerId(Integer brokerId) { | ||
this.brokerId = brokerId; | ||
} | ||
|
||
@Description("IDs of the disks from which the partition replicas need to be moved.") | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@MinimumItems(1) | ||
public List<Integer> getVolumeIds() { | ||
return volumeIds; | ||
} | ||
|
||
public void setVolumeIds(List<Integer> volumeIds) { | ||
this.volumeIds = volumeIds; | ||
} | ||
|
||
@Override | ||
public Map<String, Object> getAdditionalProperties() { | ||
return this.additionalProperties != null ? this.additionalProperties : Map.of(); | ||
} | ||
|
||
@Override | ||
public void setAdditionalProperty(String name, Object value) { | ||
if (this.additionalProperties == null) { | ||
this.additionalProperties = new HashMap<>(2); | ||
} | ||
this.additionalProperties.put(name, value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
.../api/kafka/model/rebalance/KafkaRebalance-remove-disks-with-empty-broker-and-volumes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kafka.strimzi.io/v1beta2 | ||
kind: KafkaRebalance | ||
metadata: | ||
name: my-rebalance | ||
spec: | ||
mode: remove-disks | ||
moveReplicasOffVolumes: [] |
9 changes: 9 additions & 0 deletions
9
.../io/strimzi/api/kafka/model/rebalance/KafkaRebalance-remove-disks-with-empty-volumes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kafka.strimzi.io/v1beta2 | ||
kind: KafkaRebalance | ||
metadata: | ||
name: my-rebalance | ||
spec: | ||
mode: remove-disks | ||
moveReplicasOffVolumes: | ||
- brokerId: 0 | ||
volumeIds: [] |
9 changes: 9 additions & 0 deletions
9
api/src/test/resources/io/strimzi/api/kafka/model/rebalance/KafkaRebalance-remove-disks.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kafka.strimzi.io/v1beta2 | ||
kind: KafkaRebalance | ||
metadata: | ||
name: my-rebalance | ||
spec: | ||
mode: remove-disks | ||
moveReplicasOffVolumes: | ||
- brokerId: 0 | ||
volumeIds: [1] |
Oops, something went wrong.