Class Chunk_NS::Chunk

class Chunk

Public Functions

Chunk(bool pinnable = true)
Chunk(const ColumnDescriptor *td)
Chunk(const ColumnDescriptor *td, bool pinnable)
Chunk(AbstractBuffer *b, AbstractBuffer *ib, const ColumnDescriptor *td, bool pinnable = true)
~Chunk()
void setPinnable(bool pinnable)
const ColumnDescriptor *getColumnDesc() const
void setColumnDesc(const ColumnDescriptor *cd)
ChunkIter begin_iterator(const std::shared_ptr<ChunkMetadata> &chunk_metadata, int start_idx = 0, int skip = 1) const
size_t getNumElemsForBytesEncodedDataAtIndices(const int8_t *index_data, const std::vector<size_t> &selected_idx, const size_t byte_limit)
size_t getNumElemsForBytesInsertData(const DataBlockPtr &src_data, const size_t num_elems, const size_t start_idx, const size_t byte_limit, const bool replicating = false)
std::shared_ptr<ChunkMetadata> appendData(DataBlockPtr &srcData, const size_t numAppendElems, const size_t startIdx, const bool replicating = false)
std::shared_ptr<ChunkMetadata> appendEncodedDataAtIndices(const Chunk &src_chunk, const std::vector<size_t> &selected_idx)
std::shared_ptr<ChunkMetadata> appendEncodedData(const Chunk &src_chunk, const size_t num_elements, const size_t start_idx)
void createChunkBuffer(DataMgr *data_mgr, const ChunkKey &key, const MemoryLevel mem_level, const int deviceId = 0, const size_t page_size = 0)
void getChunkBuffer(DataMgr *data_mgr, const ChunkKey &key, const MemoryLevel mem_level, const int deviceId = 0, const size_t num_bytes = 0, const size_t num_elems = 0)
bool isChunkOnDevice(DataMgr *data_mgr, const ChunkKey &key, const MemoryLevel mem_level, const int device_id)
AbstractBuffer *getBuffer() const
AbstractBuffer *getIndexBuf() const
void setBuffer(AbstractBuffer *b)
void setIndexBuffer(AbstractBuffer *ib)
void initEncoder()
void decompress(int8_t *compressed, VarlenDatum *result, Datum *datum) const
std::string toString() const

Public Static Functions

void translateColumnDescriptorsToChunkVec(const std::list<const ColumnDescriptor *> &colDescs, std::vector<Chunk> &chunkVec)
std::shared_ptr<Chunk> getChunk(const ColumnDescriptor *cd, DataMgr *data_mgr, const ChunkKey &key, const MemoryLevel mem_level, const int deviceId, const size_t num_bytes, const size_t num_elems, const bool pinnable = true)
std::shared_ptr<Chunk> getChunk(const ColumnDescriptor *cd, AbstractBuffer *data_buffer, AbstractBuffer *index_buffer, const bool pinnable = true)

Compose a chunk from components and return it.

Note, the

index_buffer is only applicable if the column is a variable length column. If the column type is not variable length, this parameter is ignored.
Return

a chunk composed of supplied components

Parameters
  • cd: - the column descriptor for the chunk

  • data_buffer: - the data buffer for the chunk

  • index_buffer: - the (optional) index buffer for the chunk

  • pinnable: - sets the chunk as pinnable (or not)

Private Functions

void setChunkBuffer(AbstractBuffer *buffer, AbstractBuffer *index_buffer)
void unpinBuffer()

Private Members

AbstractBuffer *buffer_
AbstractBuffer *index_buf_
const ColumnDescriptor *column_desc_
bool pinnable_