OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::GeoAlterColumnContext Class Reference
+ Inheritance diagram for Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::GeoAlterColumnContext:
+ Collaboration diagram for Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::GeoAlterColumnContext:

Public Member Functions

 GeoAlterColumnContext (int device_id, const ChunkKey &chunk_key_prefix, Fragmenter_Namespace::FragmentInfo *fragment_info, const ColumnDescriptor *src_cd, const ColumnDescriptor *dst_cd, const size_t num_elements, Data_Namespace::DataMgr *data_mgr, Catalog_Namespace::Catalog *catalog, std::map< int, Chunk_NS::Chunk > &column_map, const std::list< const ColumnDescriptor * > &columns)
 
void createScratchBuffers ()
 
void deleteScratchBuffers ()
 
void encodeData (const bool geo_validate_geometry)
 
void putBuffersToDisk ()
 
- Public Member Functions inherited from Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::BaseAlterColumnContext
 BaseAlterColumnContext (int device_id, const ChunkKey &chunk_key_prefix, Fragmenter_Namespace::FragmentInfo *fragment_info, const ColumnDescriptor *src_cd, const ColumnDescriptor *dst_cd, const size_t num_elements, Data_Namespace::DataMgr *data_mgr, Catalog_Namespace::Catalog *catalog, std::map< int, Chunk_NS::Chunk > &column_map)
 
void readSourceData ()
 

Private Attributes

const std::list< const
ColumnDescriptor * > & 
dst_columns_
 

Additional Inherited Members

- Static Public Member Functions inherited from Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::BaseAlterColumnContext
static void unpinChunk (Chunk &chunk)
 
- Protected Member Functions inherited from Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::BaseAlterColumnContext
void createChunkScratchBuffer (Chunk_NS::Chunk &chunk)
 
void freeChunkScratchBuffer (Chunk_NS::Chunk &chunk)
 
- Protected Attributes inherited from Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::BaseAlterColumnContext
int device_id_
 
const ChunkKeychunk_key_prefix_
 
Fragmenter_Namespace::FragmentInfofragment_info_
 
const ColumnDescriptorsrc_cd_
 
const ColumnDescriptordst_cd_
 
const size_t num_elements_
 
Data_Namespace::DataMgrdata_mgr_
 
Catalog_Namespace::Catalogcatalog_
 
std::map< int, Chunk_NS::Chunk > & column_map_
 
data_conversion::ConversionFactoryParam param_
 
std::unique_ptr
< data_conversion::BaseSource
source
 
AbstractBufferbuffer_
 
AbstractBufferindex_buffer_
 
Chunk_NS::Chunk disk_level_src_chunk_
 
Chunk_NS::Chunk mem_level_src_chunk_
 
ChunkKey key_
 
const int8_t * src_data_
 
ArrayElemTypeChunk scalar_temp_chunk_
 

Detailed Description

Definition at line 225 of file InsertOrderFragmenter.cpp.

Constructor & Destructor Documentation

Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::GeoAlterColumnContext::GeoAlterColumnContext ( int  device_id,
const ChunkKey chunk_key_prefix,
Fragmenter_Namespace::FragmentInfo fragment_info,
const ColumnDescriptor src_cd,
const ColumnDescriptor dst_cd,
const size_t  num_elements,
Data_Namespace::DataMgr data_mgr,
Catalog_Namespace::Catalog catalog,
std::map< int, Chunk_NS::Chunk > &  column_map,
const std::list< const ColumnDescriptor * > &  columns 
)
inline

Definition at line 227 of file InsertOrderFragmenter.cpp.

237  : BaseAlterColumnContext(device_id,
238  chunk_key_prefix,
239  fragment_info,
240  src_cd,
241  dst_cd,
242  num_elements,
243  data_mgr,
244  catalog,
245  column_map)
246  , dst_columns_(columns) {}
BaseAlterColumnContext(int device_id, const ChunkKey &chunk_key_prefix, Fragmenter_Namespace::FragmentInfo *fragment_info, const ColumnDescriptor *src_cd, const ColumnDescriptor *dst_cd, const size_t num_elements, Data_Namespace::DataMgr *data_mgr, Catalog_Namespace::Catalog *catalog, std::map< int, Chunk_NS::Chunk > &column_map)

Member Function Documentation

void Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::GeoAlterColumnContext::createScratchBuffers ( )
inline

Definition at line 248 of file InsertOrderFragmenter.cpp.

248  {
249  std::list<Chunk_NS::Chunk>& geo_chunks = param_.geo_chunks;
250  std::list<std::unique_ptr<ChunkMetadata>>& chunk_metadata = param_.geo_chunk_metadata;
251  // create all geo chunk buffers
252  for (auto dst_cd : dst_columns_) {
253  geo_chunks.emplace_back(dst_cd, true);
254  auto& dst_chunk = geo_chunks.back();
255 
256  createChunkScratchBuffer(dst_chunk);
257  dst_chunk.initEncoder();
258 
259  chunk_metadata.push_back(std::make_unique<ChunkMetadata>());
260  }
261  }
std::list< Chunk_NS::Chunk > geo_chunks
std::list< std::unique_ptr< ChunkMetadata > > geo_chunk_metadata
void Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::GeoAlterColumnContext::deleteScratchBuffers ( )
inline

Definition at line 263 of file InsertOrderFragmenter.cpp.

void Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::GeoAlterColumnContext::encodeData ( const bool  geo_validate_geometry)
inline

Definition at line 269 of file InsertOrderFragmenter.cpp.

References data_conversion::create_string_view_encoder().

269  {
270  auto convert_encoder =
271  data_conversion::create_string_view_encoder(param_, false, geo_validate_geometry);
272  try {
273  convert_encoder->encodeAndAppendData(src_data_, num_elements_);
274  convert_encoder->finalize(num_elements_);
275  } catch (std::exception& except) {
276  throw std::runtime_error("Column " + (*dst_columns_.begin())->columnName + ": " +
277  except.what());
278  }
279  }
std::unique_ptr< BaseConvertEncoder > create_string_view_encoder(ConversionFactoryParam &param, const bool error_tracking_enabled, const bool geo_validate_geometry)

+ Here is the call graph for this function:

void Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::GeoAlterColumnContext::putBuffersToDisk ( )
inline

Definition at line 281 of file InsertOrderFragmenter.cpp.

References CHECK, data_mgr_(), Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::get_chunk_key(), and Chunk_NS::Chunk::setBuffer().

281  {
282  auto metadata_it = param_.geo_chunk_metadata.begin();
283  auto chunk_it = param_.geo_chunks.begin();
284  for (auto dst_cd : dst_columns_) {
285  auto& chunk = *chunk_it;
286  auto& metadata = *metadata_it;
287 
288  auto encoder = chunk.getBuffer()->getEncoder();
289  CHECK(encoder);
290  encoder->resetChunkStats(metadata->chunkStats);
291  encoder->setNumElems(num_elements_);
292 
293  ChunkKey dst_key =
295 
296  if (dst_cd->columnType.is_varlen_indeed()) {
297  auto data_key = dst_key;
298  data_key.push_back(1);
299  auto index_key = dst_key;
300  index_key.push_back(2);
301 
302  chunk.getBuffer()->setUpdated();
303  chunk.getIndexBuf()->setUpdated();
304 
305  Chunk fragmenter_chunk{dst_cd, false};
306  fragmenter_chunk.setBuffer(
307  data_mgr_->getGlobalFileMgr()->putBuffer(data_key, chunk.getBuffer()));
308  fragmenter_chunk.setIndexBuffer(
309  data_mgr_->getGlobalFileMgr()->putBuffer(index_key, chunk.getIndexBuf()));
310  column_map_[src_cd_->columnId] = fragmenter_chunk;
311 
312  } else {
313  chunk.getBuffer()->setUpdated();
314 
315  Chunk fragmenter_chunk{dst_cd, false};
316  fragmenter_chunk.setBuffer(
317  data_mgr_->getGlobalFileMgr()->putBuffer(dst_key, chunk.getBuffer()));
318  column_map_[src_cd_->columnId] = fragmenter_chunk;
319  }
320 
321  chunk_it++;
322  metadata_it++;
323  }
324  }
AbstractBuffer * putBuffer(const ChunkKey &key, AbstractBuffer *d, const size_t numBytes=0) override
Puts the contents of d into the Chunk with the given key.
std::vector< int > ChunkKey
Definition: types.h:36
void setBuffer(AbstractBuffer *b)
Definition: Chunk.h:150
File_Namespace::GlobalFileMgr * getGlobalFileMgr() const
Definition: DataMgr.cpp:699
ChunkKey get_chunk_key(const ChunkKey &prefix, int column_id, int fragment_id)
#define CHECK(condition)
Definition: Logger.h:291
std::list< Chunk_NS::Chunk > geo_chunks
std::list< std::unique_ptr< ChunkMetadata > > geo_chunk_metadata

+ Here is the call graph for this function:

Member Data Documentation

const std::list<const ColumnDescriptor*>& Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::GeoAlterColumnContext::dst_columns_
private

Definition at line 327 of file InsertOrderFragmenter.cpp.


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