-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(proto): decode ConsumerGroupMetadata in cooperative sticky balanc…
…e strategy Signed-off-by: napallday <[email protected]>
- Loading branch information
Showing
6 changed files
with
117 additions
and
24 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
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,31 @@ | ||
package sarama | ||
|
||
type CooperativeStickyAssignorUserDataV0 struct { | ||
Generation int32 | ||
} | ||
|
||
func (m *CooperativeStickyAssignorUserDataV0) encode(pe packetEncoder) error { | ||
pe.putInt32(m.Generation) | ||
return nil | ||
} | ||
|
||
func (m *CooperativeStickyAssignorUserDataV0) decode(pd packetDecoder) (err error) { | ||
if m.Generation, err = pd.getInt32(); err != nil { | ||
return | ||
} | ||
return nil | ||
} | ||
|
||
type CooperativeStickyMemberData struct { | ||
PartitionsAssignments []topicPartitionAssignment | ||
Generation int32 | ||
RackID string | ||
} | ||
|
||
func (m *CooperativeStickyMemberData) partitions() []topicPartitionAssignment { | ||
return m.PartitionsAssignments | ||
} | ||
func (m *CooperativeStickyMemberData) hasGeneration() bool { return true } | ||
func (m *CooperativeStickyMemberData) generation() int { return int(m.Generation) } | ||
|
||
var _ MemberData = (*CooperativeStickyMemberData)(nil) |
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,12 @@ | ||
package sarama | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestCooperativeStickyAssignorUserDataV0(t *testing.T) { | ||
req := &CooperativeStickyAssignorUserDataV0{} | ||
data := decodeUserDataBytes(t, "/////w==") // 0xff 0xff 0xff 0xff | ||
testDecodable(t, "", req, data) | ||
testEncodable(t, "", req, data) | ||
} |
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