From 4184a467d9eee90600ddcbf34d896c763e76f78f Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Mon, 11 Mar 2024 13:12:05 +0100 Subject: [PATCH] maint: Remove dependency on some elements of folly (#1370) Signed-off-by: Julien Jerphanion Co-authored-by: Georgi Petrov <32372905+G-D-Petrov@users.noreply.github.com> --- cpp/arcticdb/entity/performance_tracing.cpp | 3 +-- cpp/arcticdb/pipeline/index_segment_reader.hpp | 6 ------ cpp/arcticdb/pipeline/read_frame.cpp | 11 +++++------ cpp/arcticdb/pipeline/read_pipeline.hpp | 1 - cpp/arcticdb/pipeline/value_set.hpp | 3 +-- .../processing/test/test_component_manager.cpp | 1 - cpp/arcticdb/storage/library_path.hpp | 6 ++---- cpp/arcticdb/stream/aggregator.hpp | 2 -- cpp/arcticdb/stream/row_builder.hpp | 1 - cpp/arcticdb/stream/stream_utils.hpp | 1 - cpp/arcticdb/stream/test/test_aggregator.cpp | 1 - cpp/arcticdb/stream/test/test_row_builder.cpp | 1 - cpp/arcticdb/version/version_map_batch_methods.hpp | 2 +- 13 files changed, 10 insertions(+), 29 deletions(-) diff --git a/cpp/arcticdb/entity/performance_tracing.cpp b/cpp/arcticdb/entity/performance_tracing.cpp index eb3c5e0d5f..5d16bb8d16 100644 --- a/cpp/arcticdb/entity/performance_tracing.cpp +++ b/cpp/arcticdb/entity/performance_tracing.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -61,7 +60,7 @@ RemoteryInstance::~RemoteryInstance() { namespace arcticdb::detail { struct ThreadNameCache { - folly::F14FastMap fqn_by_task_name_; + std::unordered_map fqn_by_task_name_; std::string thread_name_; ThreadNameCache():fqn_by_task_name_(),thread_name_(folly::getCurrentThreadName().value_or("Thread")){} diff --git a/cpp/arcticdb/pipeline/index_segment_reader.hpp b/cpp/arcticdb/pipeline/index_segment_reader.hpp index 92c2ff34b7..63496e80fd 100644 --- a/cpp/arcticdb/pipeline/index_segment_reader.hpp +++ b/cpp/arcticdb/pipeline/index_segment_reader.hpp @@ -11,7 +11,6 @@ #include #include #include -#include #include @@ -82,12 +81,7 @@ struct IndexSegmentReader { } private: -#ifndef _WIN32 - mutable folly::F14FastMap, AxisRange::Hasher> descriptor_by_col_group_; -#else - //TODO: Fix this for windows - folly complains regarding private inheritance mutable std::unordered_map, AxisRange::Hasher> descriptor_by_col_group_; -#endif SegmentInMemory seg_; TimeseriesDescriptor tsd_; }; diff --git a/cpp/arcticdb/pipeline/read_frame.cpp b/cpp/arcticdb/pipeline/read_frame.cpp index 08d1d8b617..a7d63f3407 100644 --- a/cpp/arcticdb/pipeline/read_frame.cpp +++ b/cpp/arcticdb/pipeline/read_frame.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -642,7 +641,7 @@ class StringReducer { virtual void reduce(PipelineContextRow& context_row, size_t column_index) = 0; }; -using LockType = folly::SpinLock; +using LockType = std::mutex; class EmptyDynamicStringReducer { protected: @@ -884,7 +883,7 @@ class DynamicStringReducer : public StringReducer { auto none = std::make_unique(py::none{}); LockPolicy::unlock(*lock_); size_t none_count = 0u; - ankerl::unordered_dense::map> local_map; + ankerl::unordered_dense::map>> local_map; local_map.reserve(end - row_); // TODO this is no good for non-contigous blocks, but we currently expect // output data to be contiguous @@ -901,16 +900,16 @@ class DynamicStringReducer : public StringReducer { if(it != local_map.end()) { auto& object_and_lock = it->second; *ptr_dest_ = object_and_lock.first; - LockPolicy::lock(object_and_lock.second); + LockPolicy::lock(*object_and_lock.second); Py_INCREF(*ptr_dest_); - LockPolicy::unlock(object_and_lock.second); + LockPolicy::unlock(*object_and_lock.second); } else { const auto sv = get_string_from_pool(offset, string_pool); LockPolicy::lock(*lock_); *ptr_dest_ = StringCreator::create(sv, has_type_conversion); LockPolicy::unlock(*lock_); PyObject* dest = *ptr_dest_; - local_map.insert(std::make_pair(std::move(offset), std::make_pair(std::move(dest), folly::SpinLock{}))); + local_map.insert(std::make_pair(std::move(offset), std::make_pair(std::move(dest), std::make_unique()))); } } } diff --git a/cpp/arcticdb/pipeline/read_pipeline.hpp b/cpp/arcticdb/pipeline/read_pipeline.hpp index 22896dc31a..b0dc0349d4 100644 --- a/cpp/arcticdb/pipeline/read_pipeline.hpp +++ b/cpp/arcticdb/pipeline/read_pipeline.hpp @@ -10,7 +10,6 @@ #include #include -#include #include #include diff --git a/cpp/arcticdb/pipeline/value_set.hpp b/cpp/arcticdb/pipeline/value_set.hpp index 59200d7be6..6a8ec3cbce 100644 --- a/cpp/arcticdb/pipeline/value_set.hpp +++ b/cpp/arcticdb/pipeline/value_set.hpp @@ -14,7 +14,6 @@ #include #include -#include #include #include @@ -98,7 +97,7 @@ class ValueSet { }; std::shared_ptr> typed_set_string_; - folly::F14FastMap>> typed_set_fixed_width_strings_; + std::unordered_map>> typed_set_fixed_width_strings_; typed_set typed_set_uint8_t_; typed_set typed_set_uint16_t_; diff --git a/cpp/arcticdb/processing/test/test_component_manager.cpp b/cpp/arcticdb/processing/test/test_component_manager.cpp index 215f3221c6..181e060435 100644 --- a/cpp/arcticdb/processing/test/test_component_manager.cpp +++ b/cpp/arcticdb/processing/test/test_component_manager.cpp @@ -5,7 +5,6 @@ * As of the Change Date specified in that file, in accordance with the Business Source License, use of this software will be governed by the Apache License, version 2.0. */ -#include #include #include diff --git a/cpp/arcticdb/storage/library_path.hpp b/cpp/arcticdb/storage/library_path.hpp index 012a79184f..fcef9d314e 100644 --- a/cpp/arcticdb/storage/library_path.hpp +++ b/cpp/arcticdb/storage/library_path.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include @@ -44,8 +44,6 @@ class DefaultStringViewable : public std::shared_ptr { return hash_; } - DefaultStringViewable operator=(const DefaultStringViewable&) = delete; - private: HashedValue hash_; }; @@ -152,7 +150,7 @@ class LibraryPathImpl { return accum.digest(); } - folly::small_vector parts_; + boost::container::small_vector parts_; HashedValue hash_; }; diff --git a/cpp/arcticdb/stream/aggregator.hpp b/cpp/arcticdb/stream/aggregator.hpp index 9e5db51ae4..434b5fc98d 100644 --- a/cpp/arcticdb/stream/aggregator.hpp +++ b/cpp/arcticdb/stream/aggregator.hpp @@ -12,8 +12,6 @@ #include #include -#include - #include namespace arcticdb::stream { diff --git a/cpp/arcticdb/stream/row_builder.hpp b/cpp/arcticdb/stream/row_builder.hpp index ade422f531..c0c79f44c0 100644 --- a/cpp/arcticdb/stream/row_builder.hpp +++ b/cpp/arcticdb/stream/row_builder.hpp @@ -21,7 +21,6 @@ #include #include -#include #include diff --git a/cpp/arcticdb/stream/stream_utils.hpp b/cpp/arcticdb/stream/stream_utils.hpp index 4cbebc8dde..95b15a8f5b 100644 --- a/cpp/arcticdb/stream/stream_utils.hpp +++ b/cpp/arcticdb/stream/stream_utils.hpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/cpp/arcticdb/stream/test/test_aggregator.cpp b/cpp/arcticdb/stream/test/test_aggregator.cpp index 406565f3df..ead376d72f 100644 --- a/cpp/arcticdb/stream/test/test_aggregator.cpp +++ b/cpp/arcticdb/stream/test/test_aggregator.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include diff --git a/cpp/arcticdb/stream/test/test_row_builder.cpp b/cpp/arcticdb/stream/test/test_row_builder.cpp index 44c2e7501a..b7c2a79298 100644 --- a/cpp/arcticdb/stream/test/test_row_builder.cpp +++ b/cpp/arcticdb/stream/test/test_row_builder.cpp @@ -6,7 +6,6 @@ */ #include -#include #include #include diff --git a/cpp/arcticdb/version/version_map_batch_methods.hpp b/cpp/arcticdb/version/version_map_batch_methods.hpp index 6b98fb93b6..e6b77b78b2 100644 --- a/cpp/arcticdb/version/version_map_batch_methods.hpp +++ b/cpp/arcticdb/version/version_map_batch_methods.hpp @@ -269,7 +269,7 @@ inline std::shared_ptr, AtomKe struct StreamVersionData { size_t count_ = 0; LoadParameter load_param_ = LoadParameter{LoadType::NOT_LOADED}; - folly::small_vector snapshots_; + boost::container::small_vector snapshots_; explicit StreamVersionData(const pipelines::VersionQuery& version_query); StreamVersionData() = default;