49 std::unique_lock lock(
mutex_);
61 IndexKey key{ outer_dst_selector, { dst_columns.begin(), dst_columns.end() } };
63 std::unique_lock lock(
mutex_);
68 auto future = it->second;
75 cache_[
key] = promise->get_future().share();
81 promise->set_value(
index);
88 std::unique_lock lock(
mutex_);
97 }
catch (
const std::exception& secondary) {
99 vinfo(
"SharedIndexCache: ignoring secondary failure in set_exception: ", secondary.what());
unordered_flat_map< IndexKey, std::shared_future< std::shared_ptr< DstIndex > > > cache_
SharedIndexCache()=default
SharedIndexCache & operator=(SharedIndexCache &&)=delete
SharedIndexCache & operator=(const SharedIndexCache &)=delete
SharedIndexCache(SharedIndexCache &&)=delete
const DstIndex & get_or_build(Column outer_dst_selector, std::span< const ColumnAndShifts > dst_columns, const TraceContainer &trace, const std::function< DstIndex(const TraceContainer &)> &build_fn)
SharedIndexCache(const SharedIndexCache &)=delete
unordered_flat_map< size_t, std::vector< uint32_t > > DstIndex
::ankerl::unordered_dense::map< Key, T > unordered_flat_map
size_t hash_as_tuple(const Ts &... ts)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
bool operator==(const IndexKey &) const =default
Column outer_dst_selector
std::vector< ColumnAndShifts > dst_columns