Class ResultSetRecycler

class ResultSetRecycler : public DataRecycler<ResultSetPtr, ResultSetMetaInfo>

Public Functions

ResultSetRecycler()
std::optional<std::vector<TargetMetaInfo>> getOutputMetaInfo(QueryPlanHash key)
void putItemToCache(QueryPlanHash key, ResultSetPtr item_ptr, CacheItemType item_type, DeviceIdentifier device_identifier, size_t item_size, size_t compute_time, std::optional<ResultSetMetaInfo> meta_info = std::nullopt)
void initCache()
void clearCache()
void markCachedItemAsDirty(size_t table_key, std::unordered_set<QueryPlanHash> &key_set, CacheItemType item_type, DeviceIdentifier device_identifier)
std::string toString() const
std::tuple<QueryPlanHash, ResultSetPtr, std::optional<ResultSetMetaInfo>> getCachedResultSetWithoutCacheKey(std::set<size_t> &visited, DeviceIdentifier device_identifier)
void addQueryPlanDagForTableKeys(size_t hashed_query_plan_dag, const std::unordered_set<size_t> &table_keys, std::lock_guard<std::mutex> &lock)
std::optional<std::unordered_set<size_t>> getMappedQueryPlanDagsWithTableKey(size_t table_key) const
void removeTableKeyInfoFromQueryPlanDagMap(size_t table_key)
bool hasItemInCache(QueryPlanHash key)
std::vector<std::shared_ptr<Analyzer::Expr>> &getTargetExprs(QueryPlanHash key) const

Public Members

ResultSetRecycler::g_query_resultset_cache_total_bytes
ResultSetRecycler::g_max_cacheable_query_resultset_size_bytes

Private Functions

bool hasItemInCache(QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, std::lock_guard<std::mutex> &lock, std::optional<ResultSetMetaInfo> meta_info = std::nullopt) const
void removeItemFromCache(QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, std::lock_guard<std::mutex> &lock, std::optional<ResultSetMetaInfo> meta_info = std::nullopt)
void cleanupCacheForInsertion(CacheItemType item_type, DeviceIdentifier device_identifier, size_t required_size, std::lock_guard<std::mutex> &lock, std::optional<ResultSetMetaInfo> meta_info = std::nullopt)

Private Members

std::unordered_map<size_t, std::unordered_set<size_t>> table_key_to_query_plan_dag_map_