OmniSciDB
a5dc49c757
|
#include <ChunkMetadataRecycler.h>
Public Member Functions | |
ChunkMetadataRecycler () | |
std::numeric_limits () | |
std::numeric_limits () | |
void | putItemToCache (QueryPlanHash key, std::optional< ChunkMetadataMap > item, CacheItemType item_type, DeviceIdentifier device_identifier, size_t item_size, size_t compute_time, std::optional< ChunkMetadataMetaInfo > meta_info=std::nullopt) override |
void | initCache () override |
void | clearCache () override |
void | markCachedItemAsDirty (size_t table_key, std::unordered_set< QueryPlanHash > &key_set, CacheItemType item_type, DeviceIdentifier device_identifier) override |
std::string | toString () const override |
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) |
Public Member Functions inherited from DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo > | |
DataRecycler (const std::vector< CacheItemType > &item_types, size_t total_cache_size, size_t max_item_size, int num_gpus) | |
virtual | ~DataRecycler ()=default |
virtual std::optional < ChunkMetadataMap > | getItemFromCache (QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, std::optional< ChunkMetadataMetaInfo > meta_info=std::nullopt)=0 |
void | markCachedItemAsDirtyImpl (QueryPlanHash key, CachedItemContainer &m) const |
bool | isCachedItemDirty (QueryPlanHash key, CachedItemContainer &m) const |
std::shared_ptr < CachedItemContainer > | getCachedItemContainer (CacheItemType item_type, DeviceIdentifier device_identifier) const |
std::optional< CachedItem < std::optional < ChunkMetadataMap > , ChunkMetadataMetaInfo > > | getCachedItemWithoutConsideringMetaInfo (QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, CachedItemContainer &m, std::lock_guard< std::mutex > &lock) |
size_t | getCurrentNumCachedItems (CacheItemType item_type, DeviceIdentifier device_identifier) const |
size_t | getCurrentNumDirtyCachedItems (CacheItemType item_type, DeviceIdentifier device_identifier) const |
size_t | getCurrentNumCleanCachedItems (CacheItemType item_type, DeviceIdentifier device_identifier) const |
size_t | getCurrentCacheSizeForDevice (CacheItemType item_type, DeviceIdentifier device_identifier) const |
std::shared_ptr< CacheItemMetric > | getCachedItemMetric (CacheItemType item_type, DeviceIdentifier device_identifier, QueryPlanHash key) const |
void | setTotalCacheSize (CacheItemType item_type, size_t new_total_cache_size) |
void | setMaxCacheItemSize (CacheItemType item_type, size_t new_max_cache_item_size) |
Private Member Functions | |
bool | hasItemInCache (QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, std::lock_guard< std::mutex > &lock, std::optional< ChunkMetadataMetaInfo > meta_info=std::nullopt) const override |
void | removeItemFromCache (QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, std::lock_guard< std::mutex > &lock, std::optional< ChunkMetadataMetaInfo > meta_info=std::nullopt) override |
void | cleanupCacheForInsertion (CacheItemType item_type, DeviceIdentifier device_identifier, size_t required_size, std::lock_guard< std::mutex > &lock, std::optional< ChunkMetadataMetaInfo > meta_info=std::nullopt) override |
Private Attributes | |
std::unordered_map< size_t, std::unordered_set< size_t > > | table_key_to_query_plan_dag_map_ |
Definition at line 33 of file ChunkMetadataRecycler.h.
|
inline |
Definition at line 40 of file ChunkMetadataRecycler.h.
References CHUNK_METADATA.
void ChunkMetadataRecycler::addQueryPlanDagForTableKeys | ( | size_t | hashed_query_plan_dag, |
const std::unordered_set< size_t > & | table_keys, | ||
std::lock_guard< std::mutex > & | lock | ||
) |
Definition at line 184 of file ChunkMetadataRecycler.cpp.
References table_key_to_query_plan_dag_map_.
Referenced by putItemToCache().
|
inlineoverrideprivatevirtual |
Implements DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >.
Definition at line 99 of file ChunkMetadataRecycler.h.
|
overridevirtual |
Implements DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >.
Definition at line 121 of file ChunkMetadataRecycler.cpp.
References CHUNK_METADATA, CHUNK_METADATA_CACHE_DEVICE_IDENTIFIER, DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::getCachedItemContainer(), DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::getCacheLock(), DataRecyclerUtil::getDeviceIdentifierString(), and VLOG.
std::optional< std::unordered_set< size_t > > ChunkMetadataRecycler::getMappedQueryPlanDagsWithTableKey | ( | size_t | table_key | ) | const |
Definition at line 195 of file ChunkMetadataRecycler.cpp.
References DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::getCacheLock(), and table_key_to_query_plan_dag_map_.
|
overrideprivatevirtual |
Implements DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >.
Definition at line 164 of file ChunkMetadataRecycler.cpp.
References CHECK_EQ, CHUNK_METADATA, CHUNK_METADATA_CACHE_DEVICE_IDENTIFIER, EMPTY_HASHED_PLAN_DAG_KEY, g_enable_data_recycler, g_use_chunk_metadata_cache, and DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::getCachedItemContainer().
|
inlineoverridevirtual |
Implements DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >.
Definition at line 62 of file ChunkMetadataRecycler.h.
|
overridevirtual |
Implements DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >.
Definition at line 135 of file ChunkMetadataRecycler.cpp.
References CHECK_EQ, CHUNK_METADATA, CHUNK_METADATA_CACHE_DEVICE_IDENTIFIER, g_enable_data_recycler, g_use_chunk_metadata_cache, DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::getCachedItemContainer(), DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::getCacheLock(), and DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::markCachedItemAsDirtyImpl().
|
overridevirtual |
Implements DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >.
Definition at line 53 of file ChunkMetadataRecycler.cpp.
References addQueryPlanDagForTableKeys(), CHECK, CHECK_EQ, CHUNK_METADATA, CHUNK_METADATA_CACHE_DEVICE_IDENTIFIER, EMPTY_HASHED_PLAN_DAG_KEY, g_enable_data_recycler, g_use_chunk_metadata_cache, DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::getCachedItemContainer(), DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::getCacheLock(), DataRecyclerUtil::getDeviceIdentifierString(), DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::getMetricTracker(), removeItemFromCache(), and VLOG.
|
overrideprivatevirtual |
Implements DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >.
Definition at line 102 of file ChunkMetadataRecycler.cpp.
References CHECK_EQ, CHUNK_METADATA, CHUNK_METADATA_CACHE_DEVICE_IDENTIFIER, DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::getCachedItemContainer(), DataRecyclerUtil::getDeviceIdentifierString(), and VLOG.
Referenced by putItemToCache().
void ChunkMetadataRecycler::removeTableKeyInfoFromQueryPlanDagMap | ( | size_t | table_key | ) |
Definition at line 202 of file ChunkMetadataRecycler.cpp.
References table_key_to_query_plan_dag_map_.
ChunkMetadataRecycler::std::numeric_limits | ( | ) |
ChunkMetadataRecycler::std::numeric_limits | ( | ) |
|
overridevirtual |
Implements DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >.
Definition at line 152 of file ChunkMetadataRecycler.cpp.
References CHUNK_METADATA, CHUNK_METADATA_CACHE_DEVICE_IDENTIFIER, DataRecycler< std::optional< ChunkMetadataMap >, ChunkMetadataMetaInfo >::getCachedItemContainer(), and DataRecyclerUtil::getDeviceIdentifierString().
|
private |
Definition at line 107 of file ChunkMetadataRecycler.h.
Referenced by addQueryPlanDagForTableKeys(), getMappedQueryPlanDagsWithTableKey(), and removeTableKeyInfoFromQueryPlanDagMap().