OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Chunk_NS::Chunk Class Reference

#include <Chunk.h>

+ Collaboration diagram for Chunk_NS::Chunk:

Public Member Functions

 Chunk ()
 
 Chunk (const ColumnDescriptor *td)
 
 Chunk (AbstractBuffer *b, AbstractBuffer *ib, const ColumnDescriptor *td)
 
 ~Chunk ()
 
const ColumnDescriptorgetColumnDesc () const
 
ChunkIter begin_iterator (const std::shared_ptr< ChunkMetadata > &, int start_idx=0, int skip=1) const
 
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< ChunkMetadataappendData (DataBlockPtr &srcData, const size_t numAppendElems, const size_t startIdx, const bool replicating=false)
 
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)
 
AbstractBuffergetBuffer () const
 
AbstractBuffergetIndexBuf () const
 
void setBuffer (AbstractBuffer *b)
 
void setIndexBuffer (AbstractBuffer *ib)
 
void initEncoder ()
 
void decompress (int8_t *compressed, VarlenDatum *result, Datum *datum) const
 

Static Public Member Functions

static void translateColumnDescriptorsToChunkVec (const std::list< const ColumnDescriptor * > &colDescs, std::vector< Chunk > &chunkVec)
 
static std::shared_ptr< ChunkgetChunk (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)
 

Private Member Functions

void unpinBuffer ()
 

Private Attributes

AbstractBufferbuffer_
 
AbstractBufferindex_buf_
 
const ColumnDescriptorcolumn_desc_
 

Detailed Description

Definition at line 41 of file Chunk.h.

Constructor & Destructor Documentation

Chunk_NS::Chunk::Chunk ( )
inline

Definition at line 43 of file Chunk.h.

Referenced by getChunk().

43 : buffer_(nullptr), index_buf_(nullptr), column_desc_(nullptr) {}
const ColumnDescriptor * column_desc_
Definition: Chunk.h:119
AbstractBuffer * buffer_
Definition: Chunk.h:117
AbstractBuffer * index_buf_
Definition: Chunk.h:118

+ Here is the caller graph for this function:

Chunk_NS::Chunk::Chunk ( const ColumnDescriptor td)
inlineexplicit

Definition at line 45 of file Chunk.h.

46  : buffer_(nullptr), index_buf_(nullptr), column_desc_(td) {}
const ColumnDescriptor * column_desc_
Definition: Chunk.h:119
AbstractBuffer * buffer_
Definition: Chunk.h:117
AbstractBuffer * index_buf_
Definition: Chunk.h:118
Chunk_NS::Chunk::Chunk ( AbstractBuffer b,
AbstractBuffer ib,
const ColumnDescriptor td 
)
inline

Definition at line 48 of file Chunk.h.

49  : buffer_(b), index_buf_(ib), column_desc_(td){};
const ColumnDescriptor * column_desc_
Definition: Chunk.h:119
AbstractBuffer * buffer_
Definition: Chunk.h:117
AbstractBuffer * index_buf_
Definition: Chunk.h:118
Chunk_NS::Chunk::~Chunk ( )
inline

Definition at line 51 of file Chunk.h.

References unpinBuffer().

51 { unpinBuffer(); }
void unpinBuffer()
Definition: Chunk.cpp:215

+ Here is the call graph for this function:

Member Function Documentation

std::shared_ptr< ChunkMetadata > Chunk_NS::Chunk::appendData ( DataBlockPtr srcData,
const size_t  numAppendElems,
const size_t  startIdx,
const bool  replicating = false 
)

Definition at line 171 of file Chunk.cpp.

References StringNoneEncoder::appendData(), FixedLengthArrayNoneEncoder::appendData(), ArrayNoneEncoder::appendData(), DataBlockPtr::arraysPtr, buffer_, CHECK(), CHECK_EQ, column_desc_, ColumnDescriptor::columnType, Data_Namespace::AbstractBuffer::encoder, kARRAY, kCHAR, kENCODING_NONE, kLINESTRING, kMULTIPOLYGON, kPOINT, kPOLYGON, kTEXT, kVARCHAR, DataBlockPtr::numbersPtr, and DataBlockPtr::stringsPtr.

Referenced by foreign_storage::CsvDataWrapper::populateChunk().

174  {
175  const auto& ti = column_desc_->columnType;
176  if (ti.is_varlen()) {
177  switch (ti.get_type()) {
178  case kARRAY: {
179  if (ti.get_size() > 0) {
180  FixedLengthArrayNoneEncoder* array_encoder =
181  dynamic_cast<FixedLengthArrayNoneEncoder*>(buffer_->encoder.get());
182  return array_encoder->appendData(
183  src_data.arraysPtr, start_idx, num_elems, replicating);
184  }
185  ArrayNoneEncoder* array_encoder =
186  dynamic_cast<ArrayNoneEncoder*>(buffer_->encoder.get());
187  return array_encoder->appendData(
188  src_data.arraysPtr, start_idx, num_elems, replicating);
189  }
190  case kTEXT:
191  case kVARCHAR:
192  case kCHAR: {
193  CHECK_EQ(kENCODING_NONE, ti.get_compression());
194  StringNoneEncoder* str_encoder =
195  dynamic_cast<StringNoneEncoder*>(buffer_->encoder.get());
196  return str_encoder->appendData(
197  src_data.stringsPtr, start_idx, num_elems, replicating);
198  }
199  case kPOINT:
200  case kLINESTRING:
201  case kPOLYGON:
202  case kMULTIPOLYGON: {
203  StringNoneEncoder* str_encoder =
204  dynamic_cast<StringNoneEncoder*>(buffer_->encoder.get());
205  return str_encoder->appendData(
206  src_data.stringsPtr, start_idx, num_elems, replicating);
207  }
208  default:
209  CHECK(false);
210  }
211  }
212  return buffer_->encoder->appendData(src_data.numbersPtr, num_elems, ti, replicating);
213 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
const ColumnDescriptor * column_desc_
Definition: Chunk.h:119
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
AbstractBuffer * buffer_
Definition: Chunk.h:117
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
CHECK(cgen_state)
Definition: sqltypes.h:53
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
Definition: sqltypes.h:42
SQLTypeInfo columnType
std::unique_ptr< Encoder > encoder

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ChunkIter Chunk_NS::Chunk::begin_iterator ( const std::shared_ptr< ChunkMetadata > &  chunk_metadata,
int  start_idx = 0,
int  skip = 1 
) const

Definition at line 259 of file Chunk.cpp.

References buffer_, column_desc_, ColumnDescriptor::columnType, ChunkIter::current_pos, ChunkIter::end_pos, SQLTypeInfo::get_size(), Data_Namespace::AbstractBuffer::getMemoryPtr(), index_buf_, ChunkIter::num_elems, ChunkIter::second_buf, Data_Namespace::AbstractBuffer::size(), Testing::skip, ChunkIter::skip, ChunkIter::skip_size, ChunkIter::start_pos, and ChunkIter::type_info.

261  {
262  ChunkIter it;
264  it.skip = skip;
266  if (it.skip_size < 0) { // if it's variable length
267  it.current_pos = it.start_pos =
268  index_buf_->getMemoryPtr() + start_idx * sizeof(StringOffsetT);
271  } else {
272  it.current_pos = it.start_pos = buffer_->getMemoryPtr() + start_idx * it.skip_size;
273  it.end_pos = buffer_->getMemoryPtr() + buffer_->size();
274  it.second_buf = nullptr;
275  }
276  it.num_elems = chunk_metadata->numElements;
277  return it;
278 }
int8_t * start_pos
Definition: ChunkIter.h:33
HOST DEVICE int get_size() const
Definition: sqltypes.h:268
int8_t * current_pos
Definition: ChunkIter.h:32
SQLTypeInfo type_info
Definition: ChunkIter.h:30
const ColumnDescriptor * column_desc_
Definition: Chunk.h:119
virtual size_t size() const =0
virtual int8_t * getMemoryPtr()=0
static unsigned skip
Definition: testing.h:31
int32_t StringOffsetT
Definition: sqltypes.h:866
int8_t * end_pos
Definition: ChunkIter.h:34
size_t num_elems
Definition: ChunkIter.h:37
AbstractBuffer * buffer_
Definition: Chunk.h:117
int skip_size
Definition: ChunkIter.h:36
int8_t * second_buf
Definition: ChunkIter.h:31
int skip
Definition: ChunkIter.h:35
SQLTypeInfo columnType
AbstractBuffer * index_buf_
Definition: Chunk.h:118

+ Here is the call graph for this function:

void Chunk_NS::Chunk::createChunkBuffer ( DataMgr data_mgr,
const ChunkKey key,
const MemoryLevel  mem_level,
const int  deviceId = 0,
const size_t  page_size = 0 
)

Definition at line 110 of file Chunk.cpp.

References buffer_, column_desc_, ColumnDescriptor::columnType, Data_Namespace::DataMgr::createChunkBuffer(), index_buf_, SQLTypeInfo::is_fixlen_array(), and SQLTypeInfo::is_varlen().

114  {
117  ChunkKey subKey = key;
118  subKey.push_back(1); // 1 for the main buffer_
119  buffer_ = data_mgr->createChunkBuffer(subKey, mem_level, device_id, page_size);
120  subKey.pop_back();
121  subKey.push_back(2); // 2 for the index buffer_
122  index_buf_ = data_mgr->createChunkBuffer(subKey, mem_level, device_id, page_size);
123  } else {
124  buffer_ = data_mgr->createChunkBuffer(key, mem_level, device_id, page_size);
125  }
126 }
std::vector< int > ChunkKey
Definition: types.h:35
const ColumnDescriptor * column_desc_
Definition: Chunk.h:119
bool is_varlen() const
Definition: sqltypes.h:430
bool is_fixlen_array() const
Definition: sqltypes.h:425
AbstractBuffer * buffer_
Definition: Chunk.h:117
AbstractBuffer * createChunkBuffer(const ChunkKey &key, const MemoryLevel memoryLevel, const int deviceId=0, const size_t page_size=0)
Definition: DataMgr.cpp:408
SQLTypeInfo columnType
AbstractBuffer * index_buf_
Definition: Chunk.h:118

+ Here is the call graph for this function:

void Chunk_NS::Chunk::decompress ( int8_t *  compressed,
VarlenDatum result,
Datum datum 
) const
AbstractBuffer* Chunk_NS::Chunk::getBuffer ( ) const
inline

Definition at line 104 of file Chunk.h.

References buffer_.

Referenced by Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::DateChunkConverter(), Fragmenter_Namespace::FixedLenArrayChunkConverter::FixedLenArrayChunkConverter(), Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::ScalarChunkConverter(), and Fragmenter_Namespace::StringChunkConverter::StringChunkConverter().

104 { return buffer_; }
AbstractBuffer * buffer_
Definition: Chunk.h:117

+ Here is the caller graph for this function:

std::shared_ptr< Chunk > Chunk_NS::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 
)
static

Definition at line 28 of file Chunk.cpp.

References Chunk().

Referenced by Fragmenter_Namespace::get_chunks(), getChunkAccessorTable(), Fragmenter_Namespace::InsertOrderFragmenter::getChunksForAllColumns(), ColumnFetcher::getOneColumnFragment(), ColumnFetcher::getOneTableColumnFragment(), Fragmenter_Namespace::InsertOrderFragmenter::updateChunkStats(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), Catalog_Namespace::Catalog::vacuumDeletedRows(), StorageIOFacility< EXECUTOR_TRAITS, FRAGMENT_UPDATER >::yieldDeleteCallback(), and StorageIOFacility< EXECUTOR_TRAITS, FRAGMENT_UPDATER >::yieldUpdateCallback().

34  {
35  std::shared_ptr<Chunk> chunkp = std::make_shared<Chunk>(Chunk(cd));
36  chunkp->getChunkBuffer(data_mgr, key, memoryLevel, deviceId, numBytes, numElems);
37  return chunkp;
38 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Chunk_NS::Chunk::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 
)

Definition at line 58 of file Chunk.cpp.

References buffer_, CHECK(), CHECK_EQ, column_desc_, ColumnDescriptor::columnType, Data_Namespace::AbstractBuffer::encoder, SQLTypeInfo::get_compression(), SQLTypeInfo::get_type(), Data_Namespace::DataMgr::getChunkBuffer(), index_buf_, SQLTypeInfo::is_fixlen_array(), SQLTypeInfo::is_varlen(), kARRAY, kCHAR, kENCODING_NONE, kLINESTRING, kMULTIPOLYGON, kPOINT, kPOLYGON, kTEXT, kVARCHAR, and UNREACHABLE.

63  {
66  ChunkKey subKey = key;
67  subKey.push_back(1); // 1 for the main buffer_
68  buffer_ = data_mgr->getChunkBuffer(subKey, mem_level, device_id, num_bytes);
69  subKey.pop_back();
70  subKey.push_back(2); // 2 for the index buffer_
71  index_buf_ = data_mgr->getChunkBuffer(
72  subKey,
73  mem_level,
74  device_id,
75  (num_elems + 1) * sizeof(StringOffsetT)); // always record n+1 offsets so string
76  // length can be calculated
77  switch (column_desc_->columnType.get_type()) {
78  case kARRAY: {
79  auto array_encoder = dynamic_cast<ArrayNoneEncoder*>(buffer_->encoder.get());
80  CHECK(array_encoder);
81  array_encoder->setIndexBuffer(index_buf_);
82  break;
83  }
84  case kTEXT:
85  case kVARCHAR:
86  case kCHAR: {
88  auto str_encoder = dynamic_cast<StringNoneEncoder*>(buffer_->encoder.get());
89  CHECK(str_encoder);
90  str_encoder->setIndexBuffer(index_buf_);
91  break;
92  }
93  case kPOINT:
94  case kLINESTRING:
95  case kPOLYGON:
96  case kMULTIPOLYGON: {
97  auto str_encoder = dynamic_cast<StringNoneEncoder*>(buffer_->encoder.get());
98  CHECK(str_encoder);
99  str_encoder->setIndexBuffer(index_buf_);
100  break;
101  }
102  default:
103  UNREACHABLE();
104  }
105  } else {
106  buffer_ = data_mgr->getChunkBuffer(key, mem_level, device_id, num_bytes);
107  }
108 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
std::vector< int > ChunkKey
Definition: types.h:35
const ColumnDescriptor * column_desc_
Definition: Chunk.h:119
bool is_varlen() const
Definition: sqltypes.h:430
#define UNREACHABLE()
Definition: Logger.h:241
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:258
int32_t StringOffsetT
Definition: sqltypes.h:866
bool is_fixlen_array() const
Definition: sqltypes.h:425
AbstractBuffer * buffer_
Definition: Chunk.h:117
CHECK(cgen_state)
Definition: sqltypes.h:53
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:266
AbstractBuffer * getChunkBuffer(const ChunkKey &key, const MemoryLevel memoryLevel, const int deviceId=0, const size_t numBytes=0)
Definition: DataMgr.cpp:417
Definition: sqltypes.h:42
SQLTypeInfo columnType
AbstractBuffer * index_buf_
Definition: Chunk.h:118
std::unique_ptr< Encoder > encoder

+ Here is the call graph for this function:

const ColumnDescriptor* Chunk_NS::Chunk::getColumnDesc ( ) const
inline

Definition at line 53 of file Chunk.h.

References column_desc_.

Referenced by Fragmenter_Namespace::FixedLenArrayChunkConverter::FixedLenArrayChunkConverter(), and anonymous_namespace{ExecutionKernel.cpp}::need_to_hold_chunk().

53 { return column_desc_; }
const ColumnDescriptor * column_desc_
Definition: Chunk.h:119

+ Here is the caller graph for this function:

AbstractBuffer* Chunk_NS::Chunk::getIndexBuf ( ) const
inline

Definition at line 106 of file Chunk.h.

References index_buf_.

Referenced by Fragmenter_Namespace::ArrayChunkConverter::ArrayChunkConverter(), and Fragmenter_Namespace::StringChunkConverter::StringChunkConverter().

106 { return index_buf_; }
AbstractBuffer * index_buf_
Definition: Chunk.h:118

+ Here is the caller graph for this function:

size_t Chunk_NS::Chunk::getNumElemsForBytesInsertData ( const DataBlockPtr src_data,
const size_t  num_elems,
const size_t  start_idx,
const size_t  byte_limit,
const bool  replicating = false 
)

Definition at line 128 of file Chunk.cpp.

References DataBlockPtr::arraysPtr, buffer_, CHECK(), CHECK_EQ, column_desc_, ColumnDescriptor::columnType, Data_Namespace::AbstractBuffer::encoder, SQLTypeInfo::get_compression(), SQLTypeInfo::get_size(), SQLTypeInfo::get_type(), StringNoneEncoder::getNumElemsForBytesInsertData(), FixedLengthArrayNoneEncoder::getNumElemsForBytesInsertData(), ArrayNoneEncoder::getNumElemsForBytesInsertData(), SQLTypeInfo::is_varlen(), kARRAY, kCHAR, kENCODING_NONE, kLINESTRING, kMULTIPOLYGON, kPOINT, kPOLYGON, kTEXT, kVARCHAR, and DataBlockPtr::stringsPtr.

132  {
134  switch (column_desc_->columnType.get_type()) {
135  case kARRAY: {
136  if (column_desc_->columnType.get_size() > 0) {
137  FixedLengthArrayNoneEncoder* array_encoder =
138  dynamic_cast<FixedLengthArrayNoneEncoder*>(buffer_->encoder.get());
139  return array_encoder->getNumElemsForBytesInsertData(
140  src_data.arraysPtr, start_idx, num_elems, byte_limit, replicating);
141  }
142  ArrayNoneEncoder* array_encoder =
143  dynamic_cast<ArrayNoneEncoder*>(buffer_->encoder.get());
144  return array_encoder->getNumElemsForBytesInsertData(
145  src_data.arraysPtr, start_idx, num_elems, byte_limit, replicating);
146  }
147  case kTEXT:
148  case kVARCHAR:
149  case kCHAR: {
151  StringNoneEncoder* str_encoder =
152  dynamic_cast<StringNoneEncoder*>(buffer_->encoder.get());
153  return str_encoder->getNumElemsForBytesInsertData(
154  src_data.stringsPtr, start_idx, num_elems, byte_limit, replicating);
155  }
156  case kPOINT:
157  case kLINESTRING:
158  case kPOLYGON:
159  case kMULTIPOLYGON: {
160  StringNoneEncoder* str_encoder =
161  dynamic_cast<StringNoneEncoder*>(buffer_->encoder.get());
162  return str_encoder->getNumElemsForBytesInsertData(
163  src_data.stringsPtr, start_idx, num_elems, byte_limit, replicating);
164  }
165  default:
166  CHECK(false);
167  return 0;
168  }
169 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
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
Definition: sqltypes.h:268
std::vector< std::string > * stringsPtr
Definition: sqltypes.h:149
std::vector< ArrayDatum > * arraysPtr
Definition: sqltypes.h:150
const ColumnDescriptor * column_desc_
Definition: Chunk.h:119
bool is_varlen() const
Definition: sqltypes.h:430
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:258
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)
AbstractBuffer * buffer_
Definition: Chunk.h:117
CHECK(cgen_state)
Definition: sqltypes.h:53
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:266
Definition: sqltypes.h:42
SQLTypeInfo columnType
size_t getNumElemsForBytesInsertData(const std::vector< ArrayDatum > *srcData, const int start_idx, const size_t numAppendElems, const size_t byteLimit, const bool replicating=false)
std::unique_ptr< Encoder > encoder

+ Here is the call graph for this function:

void Chunk_NS::Chunk::initEncoder ( )

Definition at line 224 of file Chunk.cpp.

References buffer_, CHECK(), CHECK_EQ, column_desc_, ColumnDescriptor::columnType, Data_Namespace::AbstractBuffer::encoder, SQLTypeInfo::get_compression(), SQLTypeInfo::get_type(), index_buf_, Data_Namespace::AbstractBuffer::initEncoder(), SQLTypeInfo::is_fixlen_array(), SQLTypeInfo::is_varlen(), kARRAY, kCHAR, kENCODING_NONE, kLINESTRING, kMULTIPOLYGON, kPOINT, kPOLYGON, kTEXT, kVARCHAR, StringNoneEncoder::setIndexBuffer(), and ArrayNoneEncoder::setIndexBuffer().

224  {
228  switch (column_desc_->columnType.get_type()) {
229  case kARRAY: {
230  ArrayNoneEncoder* array_encoder =
231  dynamic_cast<ArrayNoneEncoder*>(buffer_->encoder.get());
232  array_encoder->setIndexBuffer(index_buf_);
233  break;
234  }
235  case kTEXT:
236  case kVARCHAR:
237  case kCHAR: {
239  StringNoneEncoder* str_encoder =
240  dynamic_cast<StringNoneEncoder*>(buffer_->encoder.get());
241  str_encoder->setIndexBuffer(index_buf_);
242  break;
243  }
244  case kPOINT:
245  case kLINESTRING:
246  case kPOLYGON:
247  case kMULTIPOLYGON: {
248  StringNoneEncoder* str_encoder =
249  dynamic_cast<StringNoneEncoder*>(buffer_->encoder.get());
250  str_encoder->setIndexBuffer(index_buf_);
251  break;
252  }
253  default:
254  CHECK(false);
255  }
256  }
257 }
void initEncoder(const SQLTypeInfo tmp_sql_type)
#define CHECK_EQ(x, y)
Definition: Logger.h:205
const ColumnDescriptor * column_desc_
Definition: Chunk.h:119
bool is_varlen() const
Definition: sqltypes.h:430
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:258
bool is_fixlen_array() const
Definition: sqltypes.h:425
AbstractBuffer * buffer_
Definition: Chunk.h:117
CHECK(cgen_state)
void setIndexBuffer(AbstractBuffer *buf)
Definition: sqltypes.h:53
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:266
Definition: sqltypes.h:42
void setIndexBuffer(AbstractBuffer *buf)
SQLTypeInfo columnType
AbstractBuffer * index_buf_
Definition: Chunk.h:118
std::unique_ptr< Encoder > encoder

+ Here is the call graph for this function:

bool Chunk_NS::Chunk::isChunkOnDevice ( DataMgr data_mgr,
const ChunkKey key,
const MemoryLevel  mem_level,
const int  device_id 
)

Definition at line 40 of file Chunk.cpp.

References column_desc_, ColumnDescriptor::columnType, SQLTypeInfo::is_fixlen_array(), SQLTypeInfo::is_varlen(), and Data_Namespace::DataMgr::isBufferOnDevice().

43  {
46  ChunkKey subKey = key;
47  ChunkKey indexKey(subKey);
48  indexKey.push_back(1);
49  ChunkKey dataKey(subKey);
50  dataKey.push_back(2);
51  return data_mgr->isBufferOnDevice(indexKey, mem_level, device_id) &&
52  data_mgr->isBufferOnDevice(dataKey, mem_level, device_id);
53  } else {
54  return data_mgr->isBufferOnDevice(key, mem_level, device_id);
55  }
56 }
std::vector< int > ChunkKey
Definition: types.h:35
const ColumnDescriptor * column_desc_
Definition: Chunk.h:119
bool is_varlen() const
Definition: sqltypes.h:430
bool is_fixlen_array() const
Definition: sqltypes.h:425
bool isBufferOnDevice(const ChunkKey &key, const MemoryLevel memLevel, const int deviceId)
Definition: DataMgr.cpp:389
SQLTypeInfo columnType

+ Here is the call graph for this function:

void Chunk_NS::Chunk::setBuffer ( AbstractBuffer b)
inline

Definition at line 108 of file Chunk.h.

References buffer_.

Referenced by foreign_storage::CsvDataWrapper::getChunkBuffer().

108 { buffer_ = b; }
AbstractBuffer * buffer_
Definition: Chunk.h:117

+ Here is the caller graph for this function:

void Chunk_NS::Chunk::setIndexBuffer ( AbstractBuffer ib)
inline

Definition at line 110 of file Chunk.h.

References index_buf_.

110 { index_buf_ = ib; }
AbstractBuffer * index_buf_
Definition: Chunk.h:118
static void Chunk_NS::Chunk::translateColumnDescriptorsToChunkVec ( const std::list< const ColumnDescriptor * > &  colDescs,
std::vector< Chunk > &  chunkVec 
)
inlinestatic

Definition at line 55 of file Chunk.h.

57  {
58  for (auto cd : colDescs) {
59  chunkVec.emplace_back(cd);
60  }
61  }
void Chunk_NS::Chunk::unpinBuffer ( )
private

Definition at line 215 of file Chunk.cpp.

References buffer_, index_buf_, and Data_Namespace::AbstractBuffer::unPin().

Referenced by ~Chunk().

215  {
216  if (buffer_) {
217  buffer_->unPin();
218  }
219  if (index_buf_) {
220  index_buf_->unPin();
221  }
222 }
AbstractBuffer * buffer_
Definition: Chunk.h:117
AbstractBuffer * index_buf_
Definition: Chunk.h:118

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

const ColumnDescriptor* Chunk_NS::Chunk::column_desc_
private
AbstractBuffer* Chunk_NS::Chunk::index_buf_
private

The documentation for this class was generated from the following files: