OmniSciDB  1dac507f6e
 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 ColumnDescriptorget_column_desc () const
 
ChunkIter begin_iterator (const 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)
 
ChunkMetadata appendData (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)
 
AbstractBufferget_buffer () const
 
AbstractBufferget_index_buf () const
 
void set_buffer (AbstractBuffer *b)
 
void set_index_buf (AbstractBuffer *ib)
 
void init_encoder ()
 
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 unpin_buffer ()
 

Private Attributes

AbstractBufferbuffer
 
AbstractBufferindex_buf
 
const ColumnDescriptorcolumn_desc
 

Detailed Description

Definition at line 44 of file Chunk.h.

Constructor & Destructor Documentation

Chunk_NS::Chunk::Chunk ( )
inline

Definition at line 46 of file Chunk.h.

Referenced by getChunk().

46 : buffer(nullptr), index_buf(nullptr), column_desc(nullptr) {}
const ColumnDescriptor * column_desc
Definition: Chunk.h:104
AbstractBuffer * index_buf
Definition: Chunk.h:103
AbstractBuffer * buffer
Definition: Chunk.h:102

+ Here is the caller graph for this function:

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

Definition at line 47 of file Chunk.h.

48  : buffer(nullptr), index_buf(nullptr), column_desc(td) {}
const ColumnDescriptor * column_desc
Definition: Chunk.h:104
AbstractBuffer * index_buf
Definition: Chunk.h:103
AbstractBuffer * buffer
Definition: Chunk.h:102
Chunk_NS::Chunk::Chunk ( AbstractBuffer b,
AbstractBuffer ib,
const ColumnDescriptor td 
)
inline

Definition at line 49 of file Chunk.h.

50  : buffer(b), index_buf(ib), column_desc(td){};
const ColumnDescriptor * column_desc
Definition: Chunk.h:104
AbstractBuffer * index_buf
Definition: Chunk.h:103
AbstractBuffer * buffer
Definition: Chunk.h:102
Chunk_NS::Chunk::~Chunk ( )
inline

Definition at line 51 of file Chunk.h.

References unpin_buffer().

51 { unpin_buffer(); }
void unpin_buffer()
Definition: Chunk.cpp:212

+ Here is the call graph for this function:

Member Function Documentation

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

Definition at line 168 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.

171  {
172  const auto& ti = column_desc->columnType;
173  if (ti.is_varlen()) {
174  switch (ti.get_type()) {
175  case kARRAY: {
176  if (ti.get_size() > 0) {
177  FixedLengthArrayNoneEncoder* array_encoder =
178  dynamic_cast<FixedLengthArrayNoneEncoder*>(buffer->encoder.get());
179  return array_encoder->appendData(
180  src_data.arraysPtr, start_idx, num_elems, replicating);
181  }
182  ArrayNoneEncoder* array_encoder =
183  dynamic_cast<ArrayNoneEncoder*>(buffer->encoder.get());
184  return array_encoder->appendData(
185  src_data.arraysPtr, start_idx, num_elems, replicating);
186  }
187  case kTEXT:
188  case kVARCHAR:
189  case kCHAR: {
190  CHECK_EQ(kENCODING_NONE, ti.get_compression());
191  StringNoneEncoder* str_encoder =
192  dynamic_cast<StringNoneEncoder*>(buffer->encoder.get());
193  return str_encoder->appendData(
194  src_data.stringsPtr, start_idx, num_elems, replicating);
195  }
196  case kPOINT:
197  case kLINESTRING:
198  case kPOLYGON:
199  case kMULTIPOLYGON: {
200  StringNoneEncoder* str_encoder =
201  dynamic_cast<StringNoneEncoder*>(buffer->encoder.get());
202  return str_encoder->appendData(
203  src_data.stringsPtr, start_idx, num_elems, replicating);
204  }
205  default:
206  CHECK(false);
207  }
208  }
209  return buffer->encoder->appendData(src_data.numbersPtr, num_elems, ti, replicating);
210 }
#define CHECK_EQ(x, y)
Definition: Logger.h:198
const ColumnDescriptor * column_desc
Definition: Chunk.h:104
CHECK(cgen_state)
AbstractBuffer * buffer
Definition: Chunk.h:102
ChunkMetadata appendData(int8_t *&srcData, const size_t numAppendElems, const SQLTypeInfo &, const bool replicating=false) override
Definition: sqltypes.h:55
ChunkMetadata appendData(int8_t *&srcData, const size_t numAppendElems, const SQLTypeInfo &, const bool replicating=false) override
Definition: sqltypes.h:44
SQLTypeInfo columnType
std::unique_ptr< Encoder > encoder
ChunkMetadata appendData(int8_t *&srcData, const size_t numAppendElems, const SQLTypeInfo &, const bool replicating=false) override

+ Here is the call graph for this function:

ChunkIter Chunk_NS::Chunk::begin_iterator ( const ChunkMetadata chunk_metadata,
int  start_idx = 0,
int  skip = 1 
) const

Definition at line 255 of file Chunk.cpp.

References buffer, column_desc, ColumnDescriptor::columnType, ChunkIter::current_pos, ChunkIter::end_pos, SQLTypeInfoCore< TYPE_FACET_PACK >::get_size(), Data_Namespace::AbstractBuffer::getMemoryPtr(), index_buf, ChunkIter::num_elems, ChunkMetadata::numElements, ChunkIter::second_buf, Data_Namespace::AbstractBuffer::size(), Testing::skip, ChunkIter::skip, ChunkIter::skip_size, ChunkIter::start_pos, and ChunkIter::type_info.

257  {
258  ChunkIter it;
260  it.skip = skip;
262  if (it.skip_size < 0) { // if it's variable length
263  it.current_pos = it.start_pos =
264  index_buf->getMemoryPtr() + start_idx * sizeof(StringOffsetT);
265  it.end_pos = index_buf->getMemoryPtr() + index_buf->size() - sizeof(StringOffsetT);
267  } else {
268  it.current_pos = it.start_pos = buffer->getMemoryPtr() + start_idx * it.skip_size;
269  it.end_pos = buffer->getMemoryPtr() + buffer->size();
270  it.second_buf = nullptr;
271  }
272  it.num_elems = chunk_metadata.numElements;
273  return it;
274 }
int8_t * start_pos
Definition: ChunkIter.h:33
int8_t * current_pos
Definition: ChunkIter.h:32
SQLTypeInfo type_info
Definition: ChunkIter.h:30
virtual size_t size() const =0
virtual int8_t * getMemoryPtr()=0
HOST DEVICE int get_size() const
Definition: sqltypes.h:336
const ColumnDescriptor * column_desc
Definition: Chunk.h:104
AbstractBuffer * index_buf
Definition: Chunk.h:103
static unsigned skip
Definition: testing.h:31
int32_t StringOffsetT
Definition: sqltypes.h:912
int8_t * end_pos
Definition: ChunkIter.h:34
size_t num_elems
Definition: ChunkIter.h:37
AbstractBuffer * buffer
Definition: Chunk.h:102
int skip_size
Definition: ChunkIter.h:36
int8_t * second_buf
Definition: ChunkIter.h:31
int skip
Definition: ChunkIter.h:35
SQLTypeInfo columnType
size_t numElements
Definition: ChunkMetadata.h:34

+ 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 108 of file Chunk.cpp.

References buffer, column_desc, ColumnDescriptor::columnType, Data_Namespace::DataMgr::createChunkBuffer(), index_buf, SQLTypeInfoCore< TYPE_FACET_PACK >::is_fixlen_array(), and SQLTypeInfoCore< TYPE_FACET_PACK >::is_varlen().

112  {
114  ChunkKey subKey = key;
115  subKey.push_back(1); // 1 for the main buffer
116  buffer = data_mgr->createChunkBuffer(subKey, mem_level, device_id, page_size);
117  subKey.pop_back();
118  subKey.push_back(2); // 2 for the index buffer
119  index_buf = data_mgr->createChunkBuffer(subKey, mem_level, device_id, page_size);
120  } else {
121  buffer = data_mgr->createChunkBuffer(key, mem_level, device_id, page_size);
122  }
123 }
std::vector< int > ChunkKey
Definition: types.h:35
const ColumnDescriptor * column_desc
Definition: Chunk.h:104
bool is_varlen() const
Definition: sqltypes.h:491
AbstractBuffer * index_buf
Definition: Chunk.h:103
AbstractBuffer * buffer
Definition: Chunk.h:102
bool is_fixlen_array() const
Definition: sqltypes.h:487
AbstractBuffer * createChunkBuffer(const ChunkKey &key, const MemoryLevel memoryLevel, const int deviceId=0, const size_t page_size=0)
Definition: DataMgr.cpp:336
SQLTypeInfo columnType

+ 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::get_buffer ( ) const
inline

Definition at line 94 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().

94 { return buffer; }
AbstractBuffer * buffer
Definition: Chunk.h:102

+ Here is the caller graph for this function:

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

Definition at line 52 of file Chunk.h.

References column_desc.

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

52 { return column_desc; }
const ColumnDescriptor * column_desc
Definition: Chunk.h:104

+ Here is the caller graph for this function:

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

Definition at line 95 of file Chunk.h.

References index_buf.

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

95 { return index_buf; }
AbstractBuffer * index_buf
Definition: Chunk.h:103

+ 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(), and Catalog_Namespace::Catalog::vacuumDeletedRows().

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 57 of file Chunk.cpp.

References buffer, CHECK(), CHECK_EQ, column_desc, ColumnDescriptor::columnType, Data_Namespace::AbstractBuffer::encoder, SQLTypeInfoCore< TYPE_FACET_PACK >::get_compression(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_type(), Data_Namespace::DataMgr::getChunkBuffer(), index_buf, SQLTypeInfoCore< TYPE_FACET_PACK >::is_fixlen_array(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_varlen(), kARRAY, kCHAR, kENCODING_NONE, kLINESTRING, kMULTIPOLYGON, kPOINT, kPOLYGON, kTEXT, kVARCHAR, StringNoneEncoder::set_index_buf(), and ArrayNoneEncoder::set_index_buf().

62  {
64  ChunkKey subKey = key;
65  subKey.push_back(1); // 1 for the main buffer
66  buffer = data_mgr->getChunkBuffer(subKey, mem_level, device_id, num_bytes);
67  subKey.pop_back();
68  subKey.push_back(2); // 2 for the index buffer
69  index_buf = data_mgr->getChunkBuffer(
70  subKey,
71  mem_level,
72  device_id,
73  (num_elems + 1) * sizeof(StringOffsetT)); // always record n+1 offsets so string
74  // length can be calculated
75  switch (column_desc->columnType.get_type()) {
76  case kARRAY: {
77  ArrayNoneEncoder* array_encoder =
78  dynamic_cast<ArrayNoneEncoder*>(buffer->encoder.get());
79  array_encoder->set_index_buf(index_buf);
80  break;
81  }
82  case kTEXT:
83  case kVARCHAR:
84  case kCHAR: {
86  StringNoneEncoder* str_encoder =
87  dynamic_cast<StringNoneEncoder*>(buffer->encoder.get());
88  str_encoder->set_index_buf(index_buf);
89  break;
90  }
91  case kPOINT:
92  case kLINESTRING:
93  case kPOLYGON:
94  case kMULTIPOLYGON: {
95  StringNoneEncoder* str_encoder =
96  dynamic_cast<StringNoneEncoder*>(buffer->encoder.get());
97  str_encoder->set_index_buf(index_buf);
98  break;
99  }
100  default:
101  CHECK(false);
102  }
103  } else {
104  buffer = data_mgr->getChunkBuffer(key, mem_level, device_id, num_bytes);
105  }
106 }
#define CHECK_EQ(x, y)
Definition: Logger.h:198
std::vector< int > ChunkKey
Definition: types.h:35
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:334
const ColumnDescriptor * column_desc
Definition: Chunk.h:104
bool is_varlen() const
Definition: sqltypes.h:491
AbstractBuffer * index_buf
Definition: Chunk.h:103
void set_index_buf(AbstractBuffer *buf)
void set_index_buf(AbstractBuffer *buf)
int32_t StringOffsetT
Definition: sqltypes.h:912
CHECK(cgen_state)
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:326
AbstractBuffer * buffer
Definition: Chunk.h:102
bool is_fixlen_array() const
Definition: sqltypes.h:487
Definition: sqltypes.h:55
AbstractBuffer * getChunkBuffer(const ChunkKey &key, const MemoryLevel memoryLevel, const int deviceId=0, const size_t numBytes=0)
Definition: DataMgr.cpp:344
Definition: sqltypes.h:44
SQLTypeInfo columnType
std::unique_ptr< Encoder > encoder

+ Here is the call 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 125 of file Chunk.cpp.

References DataBlockPtr::arraysPtr, buffer, CHECK(), CHECK_EQ, column_desc, ColumnDescriptor::columnType, Data_Namespace::AbstractBuffer::encoder, SQLTypeInfoCore< TYPE_FACET_PACK >::get_compression(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_size(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_type(), StringNoneEncoder::getNumElemsForBytesInsertData(), FixedLengthArrayNoneEncoder::getNumElemsForBytesInsertData(), ArrayNoneEncoder::getNumElemsForBytesInsertData(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_varlen(), kARRAY, kCHAR, kENCODING_NONE, kLINESTRING, kMULTIPOLYGON, kPOINT, kPOLYGON, kTEXT, kVARCHAR, and DataBlockPtr::stringsPtr.

129  {
131  switch (column_desc->columnType.get_type()) {
132  case kARRAY: {
133  if (column_desc->columnType.get_size() > 0) {
134  FixedLengthArrayNoneEncoder* array_encoder =
135  dynamic_cast<FixedLengthArrayNoneEncoder*>(buffer->encoder.get());
136  return array_encoder->getNumElemsForBytesInsertData(
137  src_data.arraysPtr, start_idx, num_elems, byte_limit, replicating);
138  }
139  ArrayNoneEncoder* array_encoder =
140  dynamic_cast<ArrayNoneEncoder*>(buffer->encoder.get());
141  return array_encoder->getNumElemsForBytesInsertData(
142  src_data.arraysPtr, start_idx, num_elems, byte_limit, replicating);
143  }
144  case kTEXT:
145  case kVARCHAR:
146  case kCHAR: {
148  StringNoneEncoder* str_encoder =
149  dynamic_cast<StringNoneEncoder*>(buffer->encoder.get());
150  return str_encoder->getNumElemsForBytesInsertData(
151  src_data.stringsPtr, start_idx, num_elems, byte_limit, replicating);
152  }
153  case kPOINT:
154  case kLINESTRING:
155  case kPOLYGON:
156  case kMULTIPOLYGON: {
157  StringNoneEncoder* str_encoder =
158  dynamic_cast<StringNoneEncoder*>(buffer->encoder.get());
159  return str_encoder->getNumElemsForBytesInsertData(
160  src_data.stringsPtr, start_idx, num_elems, byte_limit, replicating);
161  }
162  default:
163  CHECK(false);
164  return 0;
165  }
166 }
#define CHECK_EQ(x, y)
Definition: Logger.h:198
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 EncodingType get_compression() const
Definition: sqltypes.h:334
std::vector< std::string > * stringsPtr
Definition: sqltypes.h:141
std::vector< ArrayDatum > * arraysPtr
Definition: sqltypes.h:142
HOST DEVICE int get_size() const
Definition: sqltypes.h:336
const ColumnDescriptor * column_desc
Definition: Chunk.h:104
bool is_varlen() const
Definition: sqltypes.h:491
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)
CHECK(cgen_state)
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:326
AbstractBuffer * buffer
Definition: Chunk.h:102
Definition: sqltypes.h:55
Definition: sqltypes.h:44
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::init_encoder ( )

Definition at line 221 of file Chunk.cpp.

References buffer, CHECK(), CHECK_EQ, column_desc, ColumnDescriptor::columnType, Data_Namespace::AbstractBuffer::encoder, SQLTypeInfoCore< TYPE_FACET_PACK >::get_compression(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_type(), index_buf, Data_Namespace::AbstractBuffer::initEncoder(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_fixlen_array(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_varlen(), kARRAY, kCHAR, kENCODING_NONE, kLINESTRING, kMULTIPOLYGON, kPOINT, kPOLYGON, kTEXT, kVARCHAR, StringNoneEncoder::set_index_buf(), and ArrayNoneEncoder::set_index_buf().

221  {
224  switch (column_desc->columnType.get_type()) {
225  case kARRAY: {
226  ArrayNoneEncoder* array_encoder =
227  dynamic_cast<ArrayNoneEncoder*>(buffer->encoder.get());
228  array_encoder->set_index_buf(index_buf);
229  break;
230  }
231  case kTEXT:
232  case kVARCHAR:
233  case kCHAR: {
235  StringNoneEncoder* str_encoder =
236  dynamic_cast<StringNoneEncoder*>(buffer->encoder.get());
237  str_encoder->set_index_buf(index_buf);
238  break;
239  }
240  case kPOINT:
241  case kLINESTRING:
242  case kPOLYGON:
243  case kMULTIPOLYGON: {
244  StringNoneEncoder* str_encoder =
245  dynamic_cast<StringNoneEncoder*>(buffer->encoder.get());
246  str_encoder->set_index_buf(index_buf);
247  break;
248  }
249  default:
250  CHECK(false);
251  }
252  }
253 }
void initEncoder(const SQLTypeInfo tmp_sql_type)
#define CHECK_EQ(x, y)
Definition: Logger.h:198
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:334
const ColumnDescriptor * column_desc
Definition: Chunk.h:104
bool is_varlen() const
Definition: sqltypes.h:491
AbstractBuffer * index_buf
Definition: Chunk.h:103
void set_index_buf(AbstractBuffer *buf)
void set_index_buf(AbstractBuffer *buf)
CHECK(cgen_state)
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:326
AbstractBuffer * buffer
Definition: Chunk.h:102
bool is_fixlen_array() const
Definition: sqltypes.h:487
Definition: sqltypes.h:55
Definition: sqltypes.h:44
SQLTypeInfo columnType
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, SQLTypeInfoCore< TYPE_FACET_PACK >::is_fixlen_array(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_varlen(), and Data_Namespace::DataMgr::isBufferOnDevice().

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

+ Here is the call graph for this function:

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

Definition at line 96 of file Chunk.h.

References buffer.

96 { buffer = b; }
AbstractBuffer * buffer
Definition: Chunk.h:102
void Chunk_NS::Chunk::set_index_buf ( AbstractBuffer ib)
inline

Definition at line 97 of file Chunk.h.

References index_buf.

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

Definition at line 53 of file Chunk.h.

55  {
56  for (auto cd : colDescs) {
57  chunkVec.emplace_back(cd);
58  }
59  }
void Chunk_NS::Chunk::unpin_buffer ( )
private

Definition at line 212 of file Chunk.cpp.

References buffer, index_buf, and Data_Namespace::AbstractBuffer::unPin().

Referenced by ~Chunk().

212  {
213  if (buffer != nullptr) {
214  buffer->unPin();
215  }
216  if (index_buf != nullptr) {
217  index_buf->unPin();
218  }
219 }
AbstractBuffer * index_buf
Definition: Chunk.h:103
AbstractBuffer * buffer
Definition: Chunk.h:102

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

AbstractBuffer* Chunk_NS::Chunk::index_buf
private

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