Class CPUCacheData

Inheritance Relationships

Base Type

Class Documentation

class ral::cache::CPUCacheData : public ral::cache::CacheData

A CacheData that keeps its dataframe in CPU memory. This is a CacheData representation that wraps a ral::frame::BlazingHostTable. It is the more performant than most file based caching strategies but less efficient than a GPUCacheData.

Public Functions

CPUCacheData(std::unique_ptr<ral::frame::BlazingTable> gpu_table, bool use_pinned = false)

Constructor Takes a GPU based ral::frame::BlazingTable and converts it CPU version that is stored in a ral::frame::BlazingHostTable.

Parameters
  • table: The BlazingTable that is converted to a BlazingHostTable and stored.

CPUCacheData(std::unique_ptr<ral::frame::BlazingTable> gpu_table, const MetadataDictionary &metadata, bool use_pinned = false)
CPUCacheData(const std::vector<blazingdb::transport::ColumnTransport> &column_transports, std::vector<ral::memory::blazing_chunked_column_info> &&chunked_column_infos, std::vector<std::unique_ptr<ral::memory::blazing_allocation_chunk>> &&allocations, const MetadataDictionary &metadata)
CPUCacheData(std::unique_ptr<ral::frame::BlazingHostTable> host_table)

Constructor Takes a GPU based ral::frame::BlazingHostTable and stores it in this CacheData instance.

Parameters
  • table: The BlazingHostTable that is moved into the CacheData.

inline virtual std::unique_ptr<ral::frame::BlazingTable> decache() override

Decache from a BlazingHostTable to BlazingTable and return the BlazingTable.

Return

A unique_ptr to a BlazingTable

inline std::unique_ptr<ral::frame::BlazingHostTable> releaseHostTable()

Release this BlazingHostTable from this CacheData If you want to allow this CacheData to be destroyed but want to keep the memory in CPU this allows you to pull it out as a BlazingHostTable.

Return

a unique_ptr to the BlazingHostTable that this was either constructed with or which was generated during construction from a BlazingTable.

inline virtual size_t sizeInBytes() const override

Get the amount of CPU memory consumed by this CacheData Having this function allows us to have one api for seeing the consumption of all the CacheData objects that are currently in Caches.

Return

The number of bytes the BlazingHostTable consumes.

inline virtual void set_names(const std::vector<std::string> &names) override

Set the names of the columns of a BlazingHostTable.

Parameters
  • names: a vector of the column names.

inline virtual ~CPUCacheData()

Destructor

Protected Attributes

std::unique_ptr<ral::frame::BlazingHostTable> host_table

The CPU representation of a DataFrame