Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/fix list partition reassignments #1640

Merged
merged 2 commits into from
Apr 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions list_partition_reassignments_response.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package sarama

type PartitionReplicaReassignmentsStatus struct {
replicas []int32
addingReplicas []int32
removingReplicas []int32
Replicas []int32
AddingReplicas []int32
RemovingReplicas []int32
}

func (b *PartitionReplicaReassignmentsStatus) encode(pe packetEncoder) error {
if err := pe.putCompactInt32Array(b.replicas); err != nil {
if err := pe.putCompactInt32Array(b.Replicas); err != nil {
return err
}
if err := pe.putCompactInt32Array(b.addingReplicas); err != nil {
if err := pe.putCompactInt32Array(b.AddingReplicas); err != nil {
return err
}
if err := pe.putCompactInt32Array(b.removingReplicas); err != nil {
if err := pe.putCompactInt32Array(b.RemovingReplicas); err != nil {
return err
}

Expand All @@ -23,15 +23,15 @@ func (b *PartitionReplicaReassignmentsStatus) encode(pe packetEncoder) error {
}

func (b *PartitionReplicaReassignmentsStatus) decode(pd packetDecoder) (err error) {
if b.replicas, err = pd.getCompactInt32Array(); err != nil {
if b.Replicas, err = pd.getCompactInt32Array(); err != nil {
return err
}

if b.addingReplicas, err = pd.getCompactInt32Array(); err != nil {
if b.AddingReplicas, err = pd.getCompactInt32Array(); err != nil {
return err
}

if b.removingReplicas, err = pd.getCompactInt32Array(); err != nil {
if b.RemovingReplicas, err = pd.getCompactInt32Array(); err != nil {
return err
}

Expand Down Expand Up @@ -60,7 +60,7 @@ func (r *ListPartitionReassignmentsResponse) AddBlock(topic string, partition in
r.TopicStatus[topic] = partitions
}

partitions[partition] = &PartitionReplicaReassignmentsStatus{replicas: replicas, addingReplicas: addingReplicas, removingReplicas: removingReplicas}
partitions[partition] = &PartitionReplicaReassignmentsStatus{Replicas: replicas, AddingReplicas: addingReplicas, RemovingReplicas: removingReplicas}
}

func (r *ListPartitionReassignmentsResponse) encode(pe packetEncoder) error {
Expand Down Expand Up @@ -110,7 +110,7 @@ func (r *ListPartitionReassignmentsResponse) decode(pd packetDecoder, version in
}

numTopics, err := pd.getCompactArrayLength()
if err != nil || numTopics == 0 {
if err != nil {
return err
}

Expand Down