OmniSciDB  c1a53651b2
 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 484 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().

484  {
486  bool need_to_compute_metadata = true;
487  // we disable chunk metadata recycler when filter pushdown is enabled
488  // since re-executing the query invalidates the cached metdata
489  // todo(yoonmin): relax this
490  bool enable_chunk_metadata_cache = g_enable_data_recycler &&
494  if (enable_chunk_metadata_cache) {
495  std::optional<ChunkMetadataMap> cached =
496  executor->getRecultSetRecyclerHolder().getCachedChunkMetadata(
497  resultSet->getQueryPlanHash());
498  if (cached) {
499  chunkMetadataMap = *cached;
500  need_to_compute_metadata = false;
501  }
502  }
503  if (need_to_compute_metadata) {
505  if (enable_chunk_metadata_cache && !chunkMetadataMap.empty()) {
506  executor->getRecultSetRecyclerHolder().putChunkMetadataToCache(
507  resultSet->getQueryPlanHash(),
508  resultSet->getInputTableKeys(),
510  }
511  }
513  }
514  return chunkMetadataMap;
515 }
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:475
bool g_enable_filter_push_down
Definition: Execute.cpp:95
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:373

+ 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 517 of file InputMetadata.cpp.

Referenced by UpdelRoll::initializeUnsetMetadata().

518  {
519  ChunkMetadataMap metadata_map;
520  for (const auto& [column_id, chunk_metadata] : chunkMetadataMap) {
521  metadata_map[column_id] = std::make_shared<ChunkMetadata>(*chunk_metadata);
522  }
523  return metadata_map;
524 }
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 526 of file InputMetadata.cpp.

References CHECK_EQ.

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

526  {
527  std::unique_ptr<std::lock_guard<std::mutex>> lock;
528  if (resultSetMutex) {
529  lock.reset(new std::lock_guard<std::mutex>(*resultSetMutex));
530  }
533  numTuples = resultSet->rowCount();
535  }
536  return numTuples;
537 }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
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: