Class CacheMachine

Inheritance Relationships

Derived Type

Class Documentation

class ral::cache::CacheMachine

A class that represents a Cache Machine on a multi-tier (GPU memory, CPU memory, Disk memory) cache system.

Subclassed by ral::cache::ConcatenatingCacheMachine

Public Functions

CacheMachine(std::shared_ptr<Context> context, std::string cache_machine_name, bool log_timeout = true, int cache_level_override = -1, bool is_array_access = false)
~CacheMachine()
virtual void put(size_t index, std::unique_ptr<ral::frame::BlazingTable> table)
virtual void put(size_t index, std::unique_ptr<ral::cache::CacheData> cacheData)
virtual std::unique_ptr<ral::frame::BlazingTable> get_or_wait(size_t index)
virtual std::unique_ptr<ral::cache::CacheData> get_or_wait_CacheData(size_t index)
virtual void clear()
virtual bool addToCache(std::unique_ptr<ral::frame::BlazingTable> table, std::string message_id = "", bool always_add = false, const MetadataDictionary &metadata = {}, bool use_pinned = false)
virtual bool addCacheData(std::unique_ptr<ral::cache::CacheData> cache_data, std::string message_id = "", bool always_add = false)
virtual bool addHostFrameToCache(std::unique_ptr<ral::frame::BlazingHostTable> table, std::string message_id = "")
virtual void finish()
virtual bool is_finished()
uint64_t get_num_bytes_added()
uint64_t get_num_rows_added()
uint64_t get_num_batches_added()
void wait_until_finished()
std::int32_t get_id() const
Context *get_context() const
inline bool wait_for_next()
inline bool has_next_now()
bool has_messages_now(std::vector<std::string> messages)
std::unique_ptr<ral::cache::CacheData> pullAnyCacheData(const std::vector<std::string> &messages)
inline std::size_t get_num_batches()
virtual std::unique_ptr<ral::frame::BlazingTable> pullFromCache()
virtual std::unique_ptr<ral::frame::BlazingTable> pullUnorderedFromCache()
std::vector<std::unique_ptr<ral::cache::CacheData>> pull_all_cache_data()
virtual std::unique_ptr<ral::cache::CacheData> pullCacheData(std::string message_id)
virtual std::unique_ptr<ral::cache::CacheData> pullCacheData()
std::vector<size_t> get_all_indexes()
inline void wait_for_count(int count)
virtual size_t downgradeCacheData()
bool has_data_in_index_now(size_t index)

Protected Attributes

std::unique_ptr<WaitingQueue<std::unique_ptr<message>>> waitingCache

This property represents a waiting queue object which stores all CacheData Objects.

std::vector<BlazingMemoryResource*> memory_resources

References to the properties of the multi-tier cache system.

std::atomic<std::size_t> num_bytes_added
std::atomic<uint64_t> num_rows_added
bool something_added

This variable is to keep track of if anything has been added to the cache. Its useful to keep from adding empty tables to the cache, where we might want an empty table at least to know the schema.

std::shared_ptr<Context> ctx
const std::size_t cache_id
int cache_level_override
std::string cache_machine_name
std::shared_ptr<spdlog::logger> cache_events_logger
bool is_array_access
int global_index

Protected Static Attributes

static std::size_t cache_count