36 const size_t numBytes,
37 const size_t numElems,
38 const bool pinnable) {
39 std::shared_ptr<Chunk> chunkp = std::make_shared<Chunk>(
Chunk(cd, pinnable));
40 chunkp->getChunkBuffer(data_mgr, key, memoryLevel, deviceId, numBytes, numElems);
47 const bool pinnable) {
48 std::shared_ptr<Chunk> chunkp = std::make_shared<Chunk>(
Chunk(cd, pinnable));
49 chunkp->setChunkBuffer(data_buffer, index_buffer);
56 const int device_id) {
61 indexKey.push_back(1);
116 const size_t num_bytes,
117 const size_t num_elems) {
121 data_key.push_back(1);
123 index_key.push_back(2);
125 data_mgr->
getChunkBuffer(data_key, mem_level, device_id, num_bytes),
127 index_key, mem_level, device_id, (num_elems + 1) *
sizeof(
StringOffsetT)));
139 const size_t page_size) {
154 const int8_t* index_data,
155 const std::vector<size_t>& selected_idx,
156 const size_t byte_limit) {
160 index_data, selected_idx, byte_limit);
164 const size_t num_elems,
165 const size_t start_idx,
166 const size_t byte_limit,
167 const bool replicating) {
175 src_data.
arraysPtr, start_idx, num_elems, byte_limit, replicating);
180 src_data.
arraysPtr, start_idx, num_elems, byte_limit, replicating);
189 src_data.
stringsPtr, start_idx, num_elems, byte_limit, replicating);
200 src_data.
stringsPtr, start_idx, num_elems, byte_limit, replicating);
209 const Chunk& src_chunk,
210 const std::vector<size_t>& selected_idx) {
213 const int8_t* index_buffer_ptr =
217 index_buffer_ptr, data_buffer_ptr, selected_idx);
221 const size_t num_elements,
222 const size_t start_idx) {
225 const int8_t* index_buffer_ptr =
229 index_buffer_ptr, data_buffer_ptr, start_idx, num_elements);
233 const size_t num_elems,
234 const size_t start_idx,
235 const bool replicating) {
237 if (ti.is_varlen()) {
238 switch (ti.get_type()) {
240 if (ti.get_size() > 0) {
244 src_data.
arraysPtr, start_idx, num_elems, replicating);
249 src_data.
arraysPtr, start_idx, num_elems, replicating);
258 src_data.
stringsPtr, start_idx, num_elems, replicating);
269 src_data.
stringsPtr, start_idx, num_elems, replicating);
276 src_data.
numbersPtr, num_elems, ti, replicating);
344 it.
num_elems = chunk_metadata->numElements;
349 const std::list<const ColumnDescriptor*>& colDescs,
350 std::vector<Chunk>& chunkVec) {
351 for (
auto cd : colDescs) {
352 chunkVec.emplace_back(cd);
AbstractBuffer * getIndexBuf() const
std::vector< int > ChunkKey
size_t getNumElemsForBytesInsertData(const std::vector< ArrayDatum > *srcData, const int start_idx, const size_t numAppendElems, const size_t byteLimit, const bool replicating=false)
HOST DEVICE int get_size() const
std::vector< std::string > * stringsPtr
std::vector< ArrayDatum > * arraysPtr
const ColumnDescriptor * column_desc_
virtual int8_t * getMemoryPtr()=0
std::shared_ptr< ChunkMetadata > appendData(int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating=false, const int64_t offset=-1) override
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)
std::shared_ptr< ChunkMetadata > appendEncodedDataAtIndices(const Chunk &src_chunk, const std::vector< size_t > &selected_idx)
void setChunkBuffer(AbstractBuffer *buffer, AbstractBuffer *index_buffer)
HOST DEVICE SQLTypes get_type() const
void initEncoder(const SQLTypeInfo &tmp_sql_type)
size_t getNumElemsForBytesInsertData(const std::vector< std::string > *srcData, const int start_idx, const size_t numAppendElems, const size_t byteLimit, const bool replicating=false)
virtual size_t getNumElemsForBytesEncodedDataAtIndices(const int8_t *index_data, const std::vector< size_t > &selected_idx, const size_t byte_limit)=0
bool is_fixlen_array() const
std::shared_ptr< ChunkMetadata > appendData(int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating=false, const int64_t offset=-1) override
bool isChunkOnDevice(DataMgr *data_mgr, const ChunkKey &key, const MemoryLevel mem_level, const int device_id)
An AbstractBuffer is a unit of data management for a data manager.
specifies the content in-memory of a row in the column metadata table
void setIndexBuffer(AbstractBuffer *buf)
HOST DEVICE EncodingType get_compression() const
AbstractBuffer * getBuffer() const
std::shared_ptr< ChunkMetadata > appendData(int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating=false, const int64_t offset=-1) override
bool isBufferOnDevice(const ChunkKey &key, const MemoryLevel memLevel, const int deviceId)
AbstractBuffer * getChunkBuffer(const ChunkKey &key, const MemoryLevel memoryLevel, const int deviceId=0, const size_t numBytes=0)
std::string typeName(const T *v)
unencoded fixed length array encoder
Encoder * getEncoder() const
size_t getNumElemsForBytesEncodedDataAtIndices(const int8_t *index_data, const std::vector< size_t > &selected_idx, const size_t byte_limit)
void setIndexBuffer(AbstractBuffer *buf)
std::shared_ptr< ChunkMetadata > appendEncodedData(const Chunk &src_chunk, const size_t num_elements, const size_t start_idx)
std::string toString() const
AbstractBuffer * createChunkBuffer(const ChunkKey &key, const MemoryLevel memoryLevel, const int deviceId=0, const size_t page_size=0)
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)
ChunkIter begin_iterator(const std::shared_ptr< ChunkMetadata > &, int start_idx=0, int skip=1) const
void createChunkBuffer(DataMgr *data_mgr, const ChunkKey &key, const MemoryLevel mem_level, const int deviceId=0, const size_t page_size=0)
static 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)
virtual std::shared_ptr< ChunkMetadata > appendEncodedDataAtIndices(const int8_t *index_data, int8_t *data, const std::vector< size_t > &selected_idx)=0
AbstractBuffer * index_buf_
size_t getNumElemsForBytesInsertData(const std::vector< ArrayDatum > *srcData, const int start_idx, const size_t numAppendElems, const size_t byteLimit, const bool replicating=false)
Chunk(bool pinnable=true)
virtual std::shared_ptr< ChunkMetadata > appendEncodedData(const int8_t *index_data, int8_t *data, const size_t start_idx, const size_t num_elements)=0
std::shared_ptr< ChunkMetadata > appendData(DataBlockPtr &srcData, const size_t numAppendElems, const size_t startIdx, const bool replicating=false)
static void translateColumnDescriptorsToChunkVec(const std::list< const ColumnDescriptor * > &colDescs, std::vector< Chunk > &chunkVec)
virtual std::shared_ptr< ChunkMetadata > appendData(int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating=false, const int64_t offset=-1)=0