OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE > Struct Template Reference
+ Inheritance diagram for Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >:
+ Collaboration diagram for Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >:

Public Types

using ColumnDataPtr = std::unique_ptr< int64_t, CheckedMallocDeleter< int64_t >>
 

Public Member Functions

 DateChunkConverter (const size_t num_rows, const Chunk_NS::Chunk *chunk)
 
 ~DateChunkConverter () override
 
void convertToColumnarFormat (size_t row, size_t indexInFragment) override
 
void addDataBlocksToInsertData (Fragmenter_Namespace::InsertData &insertData) override
 
- Public Member Functions inherited from Fragmenter_Namespace::ChunkToInsertDataConverter
virtual ~ChunkToInsertDataConverter ()
 

Public Attributes

const Chunk_NS::Chunkchunk_
 
ColumnDataPtr column_data_
 
const ColumnDescriptorcolumn_descriptor_
 
const BUFFER_DATA_TYPE * data_buffer_addr_
 

Detailed Description

template<typename BUFFER_DATA_TYPE>
struct Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >

Definition at line 237 of file UpdelStorage.cpp.

Member Typedef Documentation

template<typename BUFFER_DATA_TYPE >
using Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::ColumnDataPtr = std::unique_ptr<int64_t, CheckedMallocDeleter<int64_t>>

Definition at line 238 of file UpdelStorage.cpp.

Constructor & Destructor Documentation

template<typename BUFFER_DATA_TYPE >
Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::DateChunkConverter ( const size_t  num_rows,
const Chunk_NS::Chunk chunk 
)
inline

Definition at line 245 of file UpdelStorage.cpp.

References checked_malloc(), Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::column_data_, Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::data_buffer_addr_, Chunk_NS::Chunk::getBuffer(), and Data_Namespace::AbstractBuffer::getMemoryPtr().

246  : chunk_(chunk), column_descriptor_(chunk->getColumnDesc()) {
248  reinterpret_cast<int64_t*>(checked_malloc(num_rows * sizeof(int64_t))));
249  data_buffer_addr_ = (BUFFER_DATA_TYPE*)chunk->getBuffer()->getMemoryPtr();
250  }
const BUFFER_DATA_TYPE * data_buffer_addr_
std::unique_ptr< int64_t, CheckedMallocDeleter< int64_t >> ColumnDataPtr
virtual int8_t * getMemoryPtr()=0
const ColumnDescriptor * column_descriptor_
const ColumnDescriptor * getColumnDesc() const
Definition: Chunk.h:65
void * checked_malloc(const size_t size)
Definition: checked_alloc.h:45
AbstractBuffer * getBuffer() const
Definition: Chunk.h:146

+ Here is the call graph for this function:

template<typename BUFFER_DATA_TYPE >
Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::~DateChunkConverter ( )
inlineoverride

Definition at line 252 of file UpdelStorage.cpp.

252 {}

Member Function Documentation

template<typename BUFFER_DATA_TYPE >
void Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::addDataBlocksToInsertData ( Fragmenter_Namespace::InsertData insertData)
inlineoverridevirtual

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 260 of file UpdelStorage.cpp.

References Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::column_data_, Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::column_descriptor_, ColumnDescriptor::columnId, Fragmenter_Namespace::InsertData::columnIds, Fragmenter_Namespace::InsertData::data, and DataBlockPtr::numbersPtr.

260  {
261  DataBlockPtr dataBlock;
262  dataBlock.numbersPtr = reinterpret_cast<int8_t*>(column_data_.get());
263  insertData.data.push_back(dataBlock);
264  insertData.columnIds.push_back(column_descriptor_->columnId);
265  }
const ColumnDescriptor * column_descriptor_
std::vector< DataBlockPtr > data
the number of rows being inserted
Definition: Fragmenter.h:73
int8_t * numbersPtr
Definition: sqltypes.h:233
std::vector< int > columnIds
identifies the table into which the data is being inserted
Definition: Fragmenter.h:71
template<typename BUFFER_DATA_TYPE >
void Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::convertToColumnarFormat ( size_t  row,
size_t  indexInFragment 
)
inlineoverridevirtual

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 254 of file UpdelStorage.cpp.

References Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::column_data_, Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::data_buffer_addr_, and DateConverters::get_epoch_seconds_from_days().

254  {
255  auto buffer_value = data_buffer_addr_[indexInFragment];
256  auto insert_value = static_cast<int64_t>(buffer_value);
258  }
const BUFFER_DATA_TYPE * data_buffer_addr_
int64_t get_epoch_seconds_from_days(const int64_t days)

+ Here is the call graph for this function:

Member Data Documentation

template<typename BUFFER_DATA_TYPE >
const Chunk_NS::Chunk* Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::chunk_

Definition at line 240 of file UpdelStorage.cpp.

template<typename BUFFER_DATA_TYPE >
const ColumnDescriptor* Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::column_descriptor_
template<typename BUFFER_DATA_TYPE >
const BUFFER_DATA_TYPE* Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::data_buffer_addr_

The documentation for this struct was generated from the following file: