| 320 | std::string getName() const override { return "StorageKeeperMapSource"; } |
| 321 | |
| 322 | Chunk generate() override |
| 323 | { |
| 324 | auto component_guard = Coordination::setCurrentComponent("StorageKeeperMapSource::generate"); |
| 325 | if (it >= end) |
| 326 | { |
| 327 | it = {}; |
| 328 | return {}; |
| 329 | } |
| 330 | |
| 331 | using KeyType = typename KeyContainer::value_type; |
| 332 | if constexpr (std::same_as<KeyType, Field>) |
| 333 | { |
| 334 | const auto & sample_block = getPort().getHeader(); |
| 335 | const auto & key_column_type = sample_block.getByName(storage.getPrimaryKey().at(0)).type; |
| 336 | auto raw_keys = serializeKeysToRawString(it, end, key_column_type, max_block_size); |
| 337 | |
| 338 | for (auto & raw_key : raw_keys) |
| 339 | raw_key = base64Encode(raw_key, /* url_encoding */ true); |
| 340 | |
| 341 | return storage.getBySerializedKeys(raw_keys, nullptr, with_version_column, getContext()); |
| 342 | } |
| 343 | else |
| 344 | { |
| 345 | size_t elem_num = std::min(max_block_size, static_cast<size_t>(end - it)); |
| 346 | auto chunk = storage.getBySerializedKeys(std::span{it, it + elem_num}, nullptr, with_version_column, getContext()); |
| 347 | it += elem_num; |
| 348 | return chunk; |
| 349 | } |
| 350 | } |
| 351 | }; |
| 352 | |
| 353 | StorageKeeperMap::StorageKeeperMap( |
nothing calls this directly
no test coverage detected