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)); }
protected bool Equals(TopicMetadata other) { return string.Equals(this.Topic, other.Topic) && this.PartitionsMetadata.SequenceEqual(other.PartitionsMetadata) && this.ErrorCode == other.ErrorCode; }
protected bool Equals(TopicMetadata other) { return(string.Equals(this.Topic, other.Topic) && this.PartitionsMetadata.SequenceEqual(other.PartitionsMetadata) && this.ErrorCode == other.ErrorCode); }