|
27 | 27 | #include <olp/core/client/Condition.h> |
28 | 28 | #include <olp/core/logging/Log.h> |
29 | 29 | #include "CatalogRepository.h" |
30 | | -#include "NamedMutex.h" |
31 | 30 | #include "generated/api/MetadataApi.h" |
32 | 31 | #include "generated/api/QueryApi.h" |
33 | 32 | #include "olp/dataservice/read/CatalogRequest.h" |
@@ -93,15 +92,6 @@ repository::PartitionResponse FindPartition( |
93 | 92 |
|
94 | 93 | return std::move(aggregated_partition); |
95 | 94 | } |
96 | | - |
97 | | -std::string HashPartitions( |
98 | | - const read::PartitionsRequest::PartitionIds& partitions) { |
99 | | - size_t seed = 0; |
100 | | - for (const auto& partition : partitions) { |
101 | | - boost::hash_combine(seed, partition); |
102 | | - } |
103 | | - return std::to_string(seed); |
104 | | -} |
105 | 95 | } // namespace |
106 | 96 |
|
107 | 97 | namespace olp { |
@@ -167,18 +157,6 @@ PartitionsRepository::GetPartitionsExtendedResponse( |
167 | 157 |
|
168 | 158 | const auto& partition_ids = request.GetPartitionIds(); |
169 | 159 |
|
170 | | - // Temporary workaround for merging the same requests. Should be removed after |
171 | | - // OlpClient could handle that. |
172 | | - const auto detail = |
173 | | - partition_ids.empty() ? "" : HashPartitions(partition_ids); |
174 | | - NamedMutex mutex(catalog_str + layer_id_ + detail); |
175 | | - std::unique_lock<NamedMutex> lock(mutex, std::defer_lock); |
176 | | - |
177 | | - // If we are not planning to go online or access the cache, do not lock. |
178 | | - if (fetch_option != CacheOnly && fetch_option != OnlineOnly) { |
179 | | - lock.lock(); |
180 | | - } |
181 | | - |
182 | 160 | if (fetch_option != OnlineOnly && fetch_option != CacheWithUpdate) { |
183 | 161 | auto cached_partitions = cache_.Get(request, version); |
184 | 162 | if (cached_partitions) { |
@@ -265,14 +243,6 @@ PartitionsResponse PartitionsRepository::GetPartitionById( |
265 | 243 | const auto request_key = |
266 | 244 | catalog_.ToString() + request.CreateKey(layer_id_, version); |
267 | 245 |
|
268 | | - NamedMutex mutex(request_key); |
269 | | - std::unique_lock<repository::NamedMutex> lock(mutex, std::defer_lock); |
270 | | - |
271 | | - // If we are not planning to go online or access the cache, do not lock. |
272 | | - if (fetch_option != CacheOnly && fetch_option != OnlineOnly) { |
273 | | - lock.lock(); |
274 | | - } |
275 | | - |
276 | 246 | std::chrono::seconds timeout{settings_.retry_settings.timeout}; |
277 | 247 | const auto key = request.CreateKey(layer_id_, version); |
278 | 248 |
|
@@ -348,14 +318,6 @@ QuadTreeIndexResponse PartitionsRepository::GetQuadTreeIndexForTile( |
348 | 318 | const auto& root_tile_key = tile_key.ChangedLevelBy(-kAggregateQuadTreeDepth); |
349 | 319 | const auto root_tile_here = root_tile_key.ToHereTile(); |
350 | 320 |
|
351 | | - NamedMutex mutex(catalog_.ToString() + layer_id_ + root_tile_here + "Index"); |
352 | | - std::unique_lock<NamedMutex> lock(mutex, std::defer_lock); |
353 | | - |
354 | | - // If we are not planning to go online or access the cache, do not lock. |
355 | | - if (fetch_option != CacheOnly && fetch_option != OnlineOnly) { |
356 | | - lock.lock(); |
357 | | - } |
358 | | - |
359 | 321 | // Look for QuadTree covering the tile in the cache |
360 | 322 | if (fetch_option != OnlineOnly && fetch_option != CacheWithUpdate) { |
361 | 323 | read::QuadTreeIndex cached_tree; |
|
0 commit comments