| 143 | } |
| 144 | |
| 145 | std::optional<TopicMetadata> DataReader::getMetadata(TopicId topic_id) const { |
| 146 | auto lock = engine_.lockEngine(); |
| 147 | const TopicStorage* storage = engine_.getTopicStorage(topic_id); |
| 148 | if (storage == nullptr) { |
| 149 | return std::nullopt; |
| 150 | } |
| 151 | return storage->metadata(); // copied out under the lock |
| 152 | } |
| 153 | |
| 154 | Expected<RangeCursor> DataReader::rangeQuery(const QueryRange& range) const { |
| 155 | // Take the read-lock BEFORE the lookup (a concurrent createTopic rehash could |