OmniSciDB  ca0c39ec8f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fragmenter_Namespace::FragmentInfo Class Reference

Used by Fragmenter classes to store info about each fragment - the fragment id and number of tuples(rows) currently stored by that fragment. More...

#include <Fragmenter.h>

+ Collaboration diagram for Fragmenter_Namespace::FragmentInfo:

Public Member Functions

 FragmentInfo ()
 
void setChunkMetadataMap (const ChunkMetadataMap &chunk_metadata_map)
 
void setChunkMetadata (const int col, std::shared_ptr< ChunkMetadata > chunkMetadata)
 
const ChunkMetadataMapgetChunkMetadataMap () const
 
const ChunkMetadataMapgetChunkMetadataMapPhysical () const
 
ChunkMetadataMap getChunkMetadataMapPhysicalCopy () const
 
size_t getNumTuples () const
 
size_t getPhysicalNumTuples () const
 
bool isEmptyPhysicalFragment () const
 
void setPhysicalNumTuples (const size_t physNumTuples)
 
void invalidateChunkMetadataMap () const
 
void invalidateNumTuples () const
 

Static Public Member Functions

static void setUnconditionalVacuum (const double unconditionalVacuum)
 

Public Attributes

int fragmentId
 
size_t shadowNumTuples
 
std::vector< int > deviceIds
 
int physicalTableId
 
int shard
 
ChunkMetadataMap shadowChunkMetadataMap
 
ResultSetresultSet
 
std::shared_ptr< std::mutex > resultSetMutex
 

Private Attributes

size_t numTuples
 
ChunkMetadataMap chunkMetadataMap
 
bool synthesizedNumTuplesIsValid
 
bool synthesizedMetadataIsValid
 

Static Private Attributes

static bool unconditionalVacuum_ {false}
 

Friends

class InsertOrderFragmenter
 

Detailed Description

Used by Fragmenter classes to store info about each fragment - the fragment id and number of tuples(rows) currently stored by that fragment.

Definition at line 86 of file Fragmenter.h.

Constructor & Destructor Documentation

Fragmenter_Namespace::FragmentInfo::FragmentInfo ( )
inline

Member Function Documentation

const ChunkMetadataMap & Fragmenter_Namespace::FragmentInfo::getChunkMetadataMap ( ) const

Definition at line 459 of file InputMetadata.cpp.

References chunkMetadataMap, g_enable_data_recycler, g_enable_filter_push_down, g_use_chunk_metadata_cache, Executor::getExecutor(), resultSet, synthesize_metadata(), synthesizedMetadataIsValid, and Executor::UNITARY_EXECUTOR_ID.

Referenced by Executor::canSkipFragmentForFpQual(), ColumnFetcher::getOneColumnFragment(), Executor::isFragmentFullyDeleted(), and Executor::skipFragment().

459  {
461  bool need_to_compute_metadata = true;
462  // we disable chunk metadata recycler when filter pushdown is enabled
463  // since re-executing the query invalidates the cached metdata
464  // todo(yoonmin): relax this
465  bool enable_chunk_metadata_cache = g_enable_data_recycler &&
469  if (enable_chunk_metadata_cache) {
470  std::optional<ChunkMetadataMap> cached =
471  executor->getRecultSetRecyclerHolder().getCachedChunkMetadata(
472  resultSet->getQueryPlanHash());
473  if (cached) {
474  chunkMetadataMap = *cached;
475  need_to_compute_metadata = false;
476  }
477  }
478  if (need_to_compute_metadata) {
480  if (enable_chunk_metadata_cache && !chunkMetadataMap.empty()) {
481  executor->getRecultSetRecyclerHolder().putChunkMetadataToCache(
482  resultSet->getQueryPlanHash(),
483  resultSet->getInputTableKeys(),
485  }
486  }
488  }
489  return chunkMetadataMap;
490 }
ChunkMetadataMap synthesize_metadata(const ResultSet *rows)
bool g_enable_data_recycler
Definition: Execute.cpp:146
bool g_use_chunk_metadata_cache
Definition: Execute.cpp:149
static std::shared_ptr< Executor > getExecutor(const ExecutorId id, const std::string &debug_dir="", const std::string &debug_file="", const SystemParameters &system_parameters=SystemParameters())
Definition: Execute.cpp:477
bool g_enable_filter_push_down
Definition: Execute.cpp:95
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:376

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const ChunkMetadataMap& Fragmenter_Namespace::FragmentInfo::getChunkMetadataMapPhysical ( ) const
inline

Definition at line 108 of file Fragmenter.h.

References chunkMetadataMap.

Referenced by Fragmenter_Namespace::get_chunks(), and Fragmenter_Namespace::InsertOrderFragmenter::getChunksForAllColumns().

108 { return chunkMetadataMap; }

+ Here is the caller graph for this function:

ChunkMetadataMap Fragmenter_Namespace::FragmentInfo::getChunkMetadataMapPhysicalCopy ( ) const

Definition at line 492 of file InputMetadata.cpp.

Referenced by UpdelRoll::initializeUnsetMetadata().

493  {
494  ChunkMetadataMap metadata_map;
495  for (const auto& [column_id, chunk_metadata] : chunkMetadataMap) {
496  metadata_map[column_id] = std::make_shared<ChunkMetadata>(*chunk_metadata);
497  }
498  return metadata_map;
499 }
std::map< int, std::shared_ptr< ChunkMetadata >> ChunkMetadataMap

+ Here is the caller graph for this function:

size_t Fragmenter_Namespace::FragmentInfo::getNumTuples ( ) const

Definition at line 501 of file InputMetadata.cpp.

References CHECK_EQ.

Referenced by QueryFragmentDescriptor::checkDeviceMemoryUsage(), and ColumnFetcher::getOneColumnFragment().

501  {
502  std::unique_ptr<std::lock_guard<std::mutex>> lock;
503  if (resultSetMutex) {
504  lock.reset(new std::lock_guard<std::mutex>(*resultSetMutex));
505  }
508  numTuples = resultSet->rowCount();
510  }
511  return numTuples;
512 }
#define CHECK_EQ(x, y)
Definition: Logger.h:230
std::shared_ptr< std::mutex > resultSetMutex
Definition: Fragmenter.h:135

+ Here is the caller graph for this function:

size_t Fragmenter_Namespace::FragmentInfo::getPhysicalNumTuples ( ) const
inline

Definition at line 114 of file Fragmenter.h.

References numTuples.

Referenced by Fragmenter_Namespace::InsertOrderFragmenter::vacuum_fixlen_rows(), and Fragmenter_Namespace::InsertOrderFragmenter::vacuum_varlen_rows().

114 { return numTuples; }

+ Here is the caller graph for this function:

void Fragmenter_Namespace::FragmentInfo::invalidateChunkMetadataMap ( ) const
inline

Definition at line 120 of file Fragmenter.h.

References synthesizedMetadataIsValid.

void Fragmenter_Namespace::FragmentInfo::invalidateNumTuples ( ) const
inline

Definition at line 121 of file Fragmenter.h.

References synthesizedNumTuplesIsValid.

bool Fragmenter_Namespace::FragmentInfo::isEmptyPhysicalFragment ( ) const
inline

Definition at line 116 of file Fragmenter.h.

References numTuples, and physicalTableId.

Referenced by ColumnFetcher::getOneColumnFragment().

+ Here is the caller graph for this function:

void Fragmenter_Namespace::FragmentInfo::setChunkMetadata ( const int  col,
std::shared_ptr< ChunkMetadata chunkMetadata 
)
inline

Definition at line 102 of file Fragmenter.h.

References chunkMetadataMap.

102  {
103  chunkMetadataMap[col] = chunkMetadata;
104  }
void Fragmenter_Namespace::FragmentInfo::setChunkMetadataMap ( const ChunkMetadataMap chunk_metadata_map)
inline

Definition at line 98 of file Fragmenter.h.

References chunkMetadataMap.

98  {
99  this->chunkMetadataMap = chunk_metadata_map;
100  }
void Fragmenter_Namespace::FragmentInfo::setPhysicalNumTuples ( const size_t  physNumTuples)
inline

Definition at line 118 of file Fragmenter.h.

References numTuples.

Referenced by Fragmenter_Namespace::InsertOrderFragmenter::getFragmentsForQuery().

118 { numTuples = physNumTuples; }

+ Here is the caller graph for this function:

static void Fragmenter_Namespace::FragmentInfo::setUnconditionalVacuum ( const double  unconditionalVacuum)
inlinestatic

Definition at line 124 of file Fragmenter.h.

References unconditionalVacuum_.

124  {
125  unconditionalVacuum_ = unconditionalVacuum;
126  }

Friends And Related Function Documentation

friend class InsertOrderFragmenter
friend

Definition at line 143 of file Fragmenter.h.

Member Data Documentation

ChunkMetadataMap Fragmenter_Namespace::FragmentInfo::chunkMetadataMap
mutableprivate
std::vector<int> Fragmenter_Namespace::FragmentInfo::deviceIds
size_t Fragmenter_Namespace::FragmentInfo::numTuples
mutableprivate
ResultSet* Fragmenter_Namespace::FragmentInfo::resultSet
mutable

Definition at line 134 of file Fragmenter.h.

Referenced by getChunkMetadataMap().

std::shared_ptr<std::mutex> Fragmenter_Namespace::FragmentInfo::resultSetMutex
mutable

Definition at line 135 of file Fragmenter.h.

ChunkMetadataMap Fragmenter_Namespace::FragmentInfo::shadowChunkMetadataMap
int Fragmenter_Namespace::FragmentInfo::shard
bool Fragmenter_Namespace::FragmentInfo::synthesizedMetadataIsValid
mutableprivate

Definition at line 141 of file Fragmenter.h.

Referenced by getChunkMetadataMap(), and invalidateChunkMetadataMap().

bool Fragmenter_Namespace::FragmentInfo::synthesizedNumTuplesIsValid
mutableprivate

Definition at line 140 of file Fragmenter.h.

Referenced by invalidateNumTuples().

bool Fragmenter_Namespace::FragmentInfo::unconditionalVacuum_ {false}
staticprivate

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