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

Public Types

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

Public Member Functions

 ScalarChunkConverter (const size_t num_rows, const Chunk_NS::Chunk *chunk)
 
 ~ScalarChunkConverter () 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, typename INSERT_DATA_TYPE>
struct Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >

Definition at line 113 of file UpdelStorage.cpp.

Member Typedef Documentation

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
using Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::ColumnDataPtr = std::unique_ptr<INSERT_DATA_TYPE, CheckedMallocDeleter<INSERT_DATA_TYPE>>

Definition at line 115 of file UpdelStorage.cpp.

Constructor & Destructor Documentation

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

Definition at line 122 of file UpdelStorage.cpp.

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

123  : chunk_(chunk), column_descriptor_(chunk->getColumnDesc()) {
124  column_data_ = ColumnDataPtr(reinterpret_cast<INSERT_DATA_TYPE*>(
125  checked_malloc(num_rows * sizeof(INSERT_DATA_TYPE))));
126  data_buffer_addr_ = (BUFFER_DATA_TYPE*)chunk->getBuffer()->getMemoryPtr();
127  }
const ColumnDescriptor * column_descriptor_
virtual int8_t * getMemoryPtr()=0
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
const BUFFER_DATA_TYPE * data_buffer_addr_
std::unique_ptr< INSERT_DATA_TYPE, CheckedMallocDeleter< INSERT_DATA_TYPE >> ColumnDataPtr

+ Here is the call graph for this function:

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::~ScalarChunkConverter ( )
inlineoverride

Definition at line 129 of file UpdelStorage.cpp.

129 {}

Member Function Documentation

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
void Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::addDataBlocksToInsertData ( Fragmenter_Namespace::InsertData insertData)
inlineoverridevirtual

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 137 of file UpdelStorage.cpp.

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

137  {
138  DataBlockPtr dataBlock;
139  dataBlock.numbersPtr = reinterpret_cast<int8_t*>(column_data_.get());
140  insertData.data.push_back(dataBlock);
141  insertData.columnIds.push_back(column_descriptor_->columnId);
142  }
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 , typename INSERT_DATA_TYPE >
void Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::convertToColumnarFormat ( size_t  row,
size_t  indexInFragment 
)
inlineoverridevirtual

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 131 of file UpdelStorage.cpp.

References Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::column_data_, and Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::data_buffer_addr_.

131  {
132  auto buffer_value = data_buffer_addr_[indexInFragment];
133  auto insert_value = static_cast<INSERT_DATA_TYPE>(buffer_value);
134  column_data_.get()[row] = insert_value;
135  }
const BUFFER_DATA_TYPE * data_buffer_addr_

Member Data Documentation

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
const Chunk_NS::Chunk* Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::chunk_

Definition at line 117 of file UpdelStorage.cpp.

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
const ColumnDescriptor* Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::column_descriptor_
template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
const BUFFER_DATA_TYPE* Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::data_buffer_addr_

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