/// <inheritdoc /> public override IMemberMetadata DecodeMetadata(IKafkaReader reader) { var version = reader.ReadInt16(); var topicNames = new string[reader.ReadInt32()]; for (var t = 0; t < topicNames.Length; t++) { topicNames[t] = reader.ReadString(); } var userData = reader.ReadBytes(); return(new ConsumerProtocolMetadata(version, topicNames, userData)); }
/// <inheritdoc /> protected override ConsumerProtocolMetadata DecodeMetadata(string assignmentStrategy, IKafkaReader reader, int expectedLength) { var version = reader.ReadInt16(); var topicNames = new string[reader.ReadInt32()]; for (var t = 0; t < topicNames.Length; t++) { topicNames[t] = reader.ReadString(); } var userData = reader.ReadBytes(); return(new ConsumerProtocolMetadata(topicNames, assignmentStrategy, userData, version)); }
/// <inheritdoc /> public override IMemberAssignment DecodeAssignment(IKafkaReader reader) { var version = reader.ReadInt16(); var topics = new List <TopicPartition>(); var topicCount = reader.ReadInt32(); for (var t = 0; t < topicCount; t++) { var topicName = reader.ReadString(); var partitionCount = reader.ReadInt32(); for (var p = 0; p < partitionCount; p++) { var partitionId = reader.ReadInt32(); topics.Add(new TopicPartition(topicName, partitionId)); } } return(new ConsumerMemberAssignment(version, topics)); }
/// <inheritdoc /> protected override ConsumerMemberAssignment DecodeAssignment(IKafkaReader reader, int expectedLength) { var version = reader.ReadInt16(); var topics = new List <TopicPartition>(); var topicCount = reader.ReadInt32(); for (var t = 0; t < topicCount; t++) { var topicName = reader.ReadString(); var partitionCount = reader.ReadInt32(); for (var p = 0; p < partitionCount; p++) { var partitionId = reader.ReadInt32(); topics.Add(new TopicPartition(topicName, partitionId)); } } var userData = reader.ReadBytes(); return(new ConsumerMemberAssignment(topics, userData, version)); }