OmniSciDB
085a039ca4
|
#include <DataRecycler.h>
Public Types | |
using | CachedItemContainer = std::vector< CachedItem< CACHED_ITEM_TYPE, META_INFO_TYPE >> |
using | PerDeviceCacheItemContainer = std::unordered_map< DeviceIdentifier, std::shared_ptr< CachedItemContainer >> |
using | PerTypeCacheItemContainer = std::unordered_map< CacheItemType, std::shared_ptr< PerDeviceCacheItemContainer >> |
using | PerTypeCacheMetricTracker = std::unordered_map< CacheItemType, CacheMetricTracker > |
Public Member Functions | |
DataRecycler (const std::vector< CacheItemType > &item_types, size_t total_cache_size, size_t max_item_size, int num_gpus) | |
virtual | ~DataRecycler ()=default |
virtual CACHED_ITEM_TYPE | getItemFromCache (QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, std::optional< META_INFO_TYPE > meta_info=std::nullopt)=0 |
virtual void | putItemToCache (QueryPlanHash key, CACHED_ITEM_TYPE item_ptr, CacheItemType item_type, DeviceIdentifier device_identifier, size_t item_size, size_t compute_time, std::optional< META_INFO_TYPE > meta_info=std::nullopt)=0 |
virtual void | initCache ()=0 |
virtual void | clearCache ()=0 |
virtual void | markCachedItemAsDirty (size_t table_key, std::unordered_set< QueryPlanHash > &key_set, CacheItemType item_type, DeviceIdentifier device_identifier)=0 |
void | markCachedItemAsDirtyImpl (QueryPlanHash key, CachedItemContainer &m) const |
bool | isCachedItemDirty (QueryPlanHash key, CachedItemContainer &m) const |
virtual std::string | toString () const =0 |
std::shared_ptr < CachedItemContainer > | getCachedItemContainer (CacheItemType item_type, DeviceIdentifier device_identifier) const |
std::optional< CachedItem < CACHED_ITEM_TYPE, META_INFO_TYPE > > | 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) |
Protected Member Functions | |
void | removeCachedItemFromBeginning (CacheItemType item_type, DeviceIdentifier device_identifier, int offset) |
void | sortCacheContainerByQueryMetric (CacheItemType item_type, DeviceIdentifier device_identifier) |
std::mutex & | getCacheLock () const |
CacheMetricTracker & | getMetricTracker (CacheItemType item_type) |
CacheMetricTracker const & | getMetricTracker (CacheItemType item_type) const |
std::unordered_set < CacheItemType > const & | getCacheItemType () const |
PerTypeCacheItemContainer const & | getItemCache () const |
Private Member Functions | |
virtual bool | hasItemInCache (QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, std::lock_guard< std::mutex > &lock, std::optional< META_INFO_TYPE > meta_info=std::nullopt) const =0 |
virtual void | removeItemFromCache (QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier, std::lock_guard< std::mutex > &lock, std::optional< META_INFO_TYPE > meta_info=std::nullopt)=0 |
virtual void | cleanupCacheForInsertion (CacheItemType item_type, DeviceIdentifier device_identifier, size_t required_size, std::lock_guard< std::mutex > &lock, std::optional< META_INFO_TYPE > meta_info=std::nullopt)=0 |
Private Attributes | |
std::unordered_set< CacheItemType > | cache_item_types_ |
PerTypeCacheMetricTracker | metric_tracker_ |
PerTypeCacheItemContainer | cached_items_container_ |
std::mutex | cache_lock_ |
Definition at line 413 of file DataRecycler.h.
using DataRecycler< CACHED_ITEM_TYPE, META_INFO_TYPE >::CachedItemContainer = std::vector<CachedItem<CACHED_ITEM_TYPE, META_INFO_TYPE>> |
Definition at line 415 of file DataRecycler.h.
using DataRecycler< CACHED_ITEM_TYPE, META_INFO_TYPE >::PerDeviceCacheItemContainer = std::unordered_map<DeviceIdentifier, std::shared_ptr<CachedItemContainer>> |
Definition at line 417 of file DataRecycler.h.
using DataRecycler< CACHED_ITEM_TYPE, META_INFO_TYPE >::PerTypeCacheItemContainer = std::unordered_map<CacheItemType, std::shared_ptr<PerDeviceCacheItemContainer>> |
Definition at line 419 of file DataRecycler.h.
using DataRecycler< CACHED_ITEM_TYPE, META_INFO_TYPE >::PerTypeCacheMetricTracker = std::unordered_map<CacheItemType, CacheMetricTracker> |
Definition at line 420 of file DataRecycler.h.
|
inline |
Definition at line 422 of file DataRecycler.h.
|
virtualdefault |
|
privatepure virtual |
Implemented in HashtableRecycler, ResultSetRecycler, ChunkMetadataRecycler, OverlapsTuningParamRecycler, and HashingSchemeRecycler.
|
pure virtual |
Implemented in HashtableRecycler, ResultSetRecycler, ChunkMetadataRecycler, OverlapsTuningParamRecycler, and HashingSchemeRecycler.
|
inline |
Definition at line 492 of file DataRecycler.h.
Referenced by DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCurrentNumCachedItems(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCurrentNumCleanCachedItems(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCurrentNumDirtyCachedItems(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::removeCachedItemFromBeginning(), and DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::sortCacheContainerByQueryMetric().
|
inline |
Definition at line 562 of file DataRecycler.h.
|
inline |
Definition at line 507 of file DataRecycler.h.
|
inlineprotected |
Definition at line 628 of file DataRecycler.h.
|
inlineprotected |
Definition at line 616 of file DataRecycler.h.
|
inline |
Definition at line 554 of file DataRecycler.h.
|
inline |
Definition at line 529 of file DataRecycler.h.
|
inline |
Definition at line 545 of file DataRecycler.h.
|
inline |
Definition at line 536 of file DataRecycler.h.
|
inlineprotected |
Definition at line 632 of file DataRecycler.h.
|
pure virtual |
Implemented in ChunkMetadataRecycler.
|
inlineprotected |
Definition at line 618 of file DataRecycler.h.
Referenced by DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCachedItemMetric(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCurrentCacheSizeForDevice(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getMetricTracker(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::setMaxCacheItemSize(), and DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::setTotalCacheSize().
|
inlineprotected |
Definition at line 624 of file DataRecycler.h.
|
privatepure virtual |
Implemented in HashtableRecycler, ResultSetRecycler, ChunkMetadataRecycler, OverlapsTuningParamRecycler, and HashingSchemeRecycler.
|
pure virtual |
Implemented in HashtableRecycler, ResultSetRecycler, ChunkMetadataRecycler, OverlapsTuningParamRecycler, and HashingSchemeRecycler.
|
inline |
Definition at line 480 of file DataRecycler.h.
|
pure virtual |
Implemented in HashtableRecycler, ResultSetRecycler, ChunkMetadataRecycler, OverlapsTuningParamRecycler, and HashingSchemeRecycler.
|
inline |
Definition at line 468 of file DataRecycler.h.
|
pure virtual |
Implemented in HashtableRecycler, ResultSetRecycler, ChunkMetadataRecycler, OverlapsTuningParamRecycler, and HashingSchemeRecycler.
|
inlineprotected |
Definition at line 585 of file DataRecycler.h.
|
privatepure virtual |
Implemented in HashtableRecycler, ResultSetRecycler, ChunkMetadataRecycler, OverlapsTuningParamRecycler, and HashingSchemeRecycler.
Referenced by DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCachedItemWithoutConsideringMetaInfo().
|
inline |
Definition at line 577 of file DataRecycler.h.
|
inline |
Definition at line 570 of file DataRecycler.h.
|
inlineprotected |
Definition at line 596 of file DataRecycler.h.
|
pure virtual |
Implemented in HashtableRecycler, ResultSetRecycler, ChunkMetadataRecycler, OverlapsTuningParamRecycler, and HashingSchemeRecycler.
|
private |
Definition at line 662 of file DataRecycler.h.
Referenced by DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::DataRecycler(), and DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCacheItemType().
|
mutableprivate |
Definition at line 670 of file DataRecycler.h.
Referenced by DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCachedItemMetric(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCacheLock(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCurrentCacheSizeForDevice(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCurrentNumCachedItems(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCurrentNumCleanCachedItems(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCurrentNumDirtyCachedItems(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::setMaxCacheItemSize(), and DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::setTotalCacheSize().
|
private |
Definition at line 668 of file DataRecycler.h.
Referenced by DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::DataRecycler(), DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCachedItemContainer(), and DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getItemCache().
|
private |
Definition at line 665 of file DataRecycler.h.
Referenced by DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::DataRecycler(), and DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getMetricTracker().