public PartitionData PartitionData(string topic, int partition) { if (TopicDataDict.ContainsKey(topic)) { var topicData = TopicDataDict[topic]; if (topicData != null) { return(TopicData.FindPartition(topicData.PartitionData, partition)); } } return(new PartitionData(partition, new BufferedMessageSet(Enumerable.Empty <Message>(), partition))); }
public BufferedMessageSet MessageSet(string topic, int partition) { var messageSet = new BufferedMessageSet(Enumerable.Empty <Message>(), partition); if (TopicDataDict.ContainsKey(topic)) { var topicData = TopicDataDict[topic]; if (topicData != null) { var data = TopicData.FindPartition(topicData.PartitionData, partition); if (data != null) { messageSet = new BufferedMessageSet(data.MessageSet.Messages, (short)data.Error, partition); messageSet.HighwaterOffset = data.HighWaterMark; } else { Logger.WarnFormat("Partition data was not found for partition {0}.", partition); } } } return(messageSet); }