示例#1
0
        public static TopicMetadataResponse ReadFrom(ByteBuffer buffer)
        {
            var correlationId  = buffer.GetInt();
            var brokerCount    = buffer.GetInt();
            var brokers        = Enumerable.Range(0, brokerCount).Select(_ => Broker.ReadFrom(buffer)).ToList();
            var brokerMap      = brokers.ToDictionary(b => b.Id);
            var topicCount     = buffer.GetInt();
            var topicsMetadata =
                Enumerable.Range(0, topicCount).Select(_ => TopicMetadata.ReadFrom(buffer, brokerMap)).ToList();

            return(new TopicMetadataResponse(topicsMetadata, correlationId));
        }
示例#2
0
 protected bool Equals(TopicMetadata other)
 {
     return string.Equals(this.Topic, other.Topic) && this.PartitionsMetadata.SequenceEqual(other.PartitionsMetadata) && this.ErrorCode == other.ErrorCode;
 }
示例#3
0
 protected bool Equals(TopicMetadata other)
 {
     return(string.Equals(this.Topic, other.Topic) && this.PartitionsMetadata.SequenceEqual(other.PartitionsMetadata) && this.ErrorCode == other.ErrorCode);
 }