-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed AlterPartitionReassignments request to support multiple topics (
#1204) * changed AlterPartitionReassignments request to support multiple topics * keep compatibility with existing code.
- Loading branch information
Boris Granveaud
authored
Oct 16, 2023
1 parent
f48706e
commit 5b97cf9
Showing
4 changed files
with
147 additions
and
12 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
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
55 changes: 55 additions & 0 deletions
55
protocol/alterpartitionreassignments/alterpartitionreassignments_test.go
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,55 @@ | ||
package alterpartitionreassignments_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/segmentio/kafka-go/protocol/alterpartitionreassignments" | ||
"github.com/segmentio/kafka-go/protocol/prototest" | ||
) | ||
|
||
const ( | ||
v0 = 0 | ||
) | ||
|
||
func TestAlterPartitionReassignmentsRequest(t *testing.T) { | ||
prototest.TestRequest(t, v0, &alterpartitionreassignments.Request{ | ||
TimeoutMs: 1, | ||
Topics: []alterpartitionreassignments.RequestTopic{ | ||
{ | ||
Name: "topic-1", | ||
Partitions: []alterpartitionreassignments.RequestPartition{ | ||
{ | ||
PartitionIndex: 1, | ||
Replicas: []int32{1, 2, 3}, | ||
}, | ||
{ | ||
PartitionIndex: 2, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAlterPartitionReassignmentsResponse(t *testing.T) { | ||
prototest.TestResponse(t, v0, &alterpartitionreassignments.Response{ | ||
ErrorCode: 1, | ||
ErrorMessage: "error", | ||
ThrottleTimeMs: 1, | ||
Results: []alterpartitionreassignments.ResponseResult{ | ||
{ | ||
Name: "topic-1", | ||
Partitions: []alterpartitionreassignments.ResponsePartition{ | ||
{ | ||
PartitionIndex: 1, | ||
ErrorMessage: "error", | ||
ErrorCode: 1, | ||
}, | ||
{ | ||
PartitionIndex: 2, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
} |