OmniSciDB  85c2d10cdc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 112 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 114 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 121 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().

122  : chunk_(chunk), column_descriptor_(chunk->getColumnDesc()) {
123  column_data_ = ColumnDataPtr(reinterpret_cast<INSERT_DATA_TYPE*>(
124  checked_malloc(num_rows * sizeof(INSERT_DATA_TYPE))));
125  data_buffer_addr_ = (BUFFER_DATA_TYPE*)chunk->getBuffer()->getMemoryPtr();
126  }
const ColumnDescriptor * column_descriptor_
virtual int8_t * getMemoryPtr()=0
const ColumnDescriptor * getColumnDesc() const
Definition: Chunk.h:53
void * checked_malloc(const size_t size)
Definition: checked_alloc.h:45
AbstractBuffer * getBuffer() const
Definition: Chunk.h:104
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 128 of file UpdelStorage.cpp.

128 {}

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 136 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.

136  {
137  DataBlockPtr dataBlock;
138  dataBlock.numbersPtr = reinterpret_cast<int8_t*>(column_data_.get());
139  insertData.data.push_back(dataBlock);
140  insertData.columnIds.push_back(column_descriptor_->columnId);
141  }
const ColumnDescriptor * column_descriptor_
std::vector< DataBlockPtr > data
the number of rows being inserted
Definition: Fragmenter.h:64
int8_t * numbersPtr
Definition: sqltypes.h:220
std::vector< int > columnIds
identifies the table into which the data is being inserted
Definition: Fragmenter.h:62
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 130 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_.

130  {
131  auto buffer_value = data_buffer_addr_[indexInFragment];
132  auto insert_value = static_cast<INSERT_DATA_TYPE>(buffer_value);
133  column_data_.get()[row] = insert_value;
134  }
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 116 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: