OmniSciDB
a5dc49c757
|
#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 449 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 451 of file DataRecycler.h.
using DataRecycler< CACHED_ITEM_TYPE, META_INFO_TYPE >::PerDeviceCacheItemContainer = std::unordered_map<DeviceIdentifier, std::shared_ptr<CachedItemContainer>> |
Definition at line 453 of file DataRecycler.h.
using DataRecycler< CACHED_ITEM_TYPE, META_INFO_TYPE >::PerTypeCacheItemContainer = std::unordered_map<CacheItemType, std::shared_ptr<PerDeviceCacheItemContainer>> |
Definition at line 455 of file DataRecycler.h.
using DataRecycler< CACHED_ITEM_TYPE, META_INFO_TYPE >::PerTypeCacheMetricTracker = std::unordered_map<CacheItemType, CacheMetricTracker> |
Definition at line 456 of file DataRecycler.h.
|
inline |
Definition at line 458 of file DataRecycler.h.
|
virtualdefault |
|
privatepure virtual |
|
pure virtual |
|
inline |
Definition at line 528 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 598 of file DataRecycler.h.
|
inline |
Definition at line 543 of file DataRecycler.h.
|
inlineprotected |
Definition at line 664 of file DataRecycler.h.
|
inlineprotected |
Definition at line 652 of file DataRecycler.h.
|
inline |
Definition at line 590 of file DataRecycler.h.
Referenced by anonymous_namespace{DBHandler.cpp}::log_cache_size().
|
inline |
Definition at line 565 of file DataRecycler.h.
|
inline |
Definition at line 581 of file DataRecycler.h.
|
inline |
Definition at line 572 of file DataRecycler.h.
|
inlineprotected |
Definition at line 668 of file DataRecycler.h.
|
pure virtual |
Implemented in BoundingBoxIntersectTuningParamRecycler.
|
inlineprotected |
Definition at line 654 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 660 of file DataRecycler.h.
|
privatepure virtual |
|
pure virtual |
|
inline |
Definition at line 516 of file DataRecycler.h.
|
pure virtual |
|
inline |
Definition at line 504 of file DataRecycler.h.
|
pure virtual |
|
inlineprotected |
Definition at line 621 of file DataRecycler.h.
|
privatepure virtual |
Implemented in HashtableRecycler, ResultSetRecycler, ChunkMetadataRecycler, BoundingBoxIntersectTuningParamRecycler, and HashingSchemeRecycler.
Referenced by DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getCachedItemWithoutConsideringMetaInfo().
|
inline |
Definition at line 613 of file DataRecycler.h.
Referenced by CommandLineOptions::parse_command_line().
|
inline |
Definition at line 606 of file DataRecycler.h.
Referenced by CommandLineOptions::parse_command_line().
|
inlineprotected |
Definition at line 632 of file DataRecycler.h.
|
pure virtual |
|
private |
Definition at line 698 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 706 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 704 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 701 of file DataRecycler.h.
Referenced by DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::DataRecycler(), and DataRecycler< std::optional< HashType >, EMPTY_META_INFO >::getMetricTracker().