OmniSciDB  72c90bc290
 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 507 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().

507  {
509  bool need_to_compute_metadata = true;
510  // we disable chunk metadata recycler when filter pushdown is enabled
511  // since re-executing the query invalidates the cached metdata
512  // todo(yoonmin): relax this
513  bool enable_chunk_metadata_cache = g_enable_data_recycler &&
517  if (enable_chunk_metadata_cache) {
518  std::optional<ChunkMetadataMap> cached =
519  executor->getResultSetRecyclerHolder().getCachedChunkMetadata(
520  resultSet->getQueryPlanHash());
521  if (cached) {
522  chunkMetadataMap = *cached;
523  need_to_compute_metadata = false;
524  }
525  }
526  if (need_to_compute_metadata) {
528  if (enable_chunk_metadata_cache && !chunkMetadataMap.empty()) {
529  executor->getResultSetRecyclerHolder().putChunkMetadataToCache(
530  resultSet->getQueryPlanHash(),
531  resultSet->getInputTableKeys(),
533  }
534  }
536  }
537  return chunkMetadataMap;
538 }
ChunkMetadataMap synthesize_metadata(const ResultSet *rows)
bool g_enable_data_recycler
Definition: Execute.cpp:154
bool g_use_chunk_metadata_cache
Definition: Execute.cpp:157
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:509
bool g_enable_filter_push_down
Definition: Execute.cpp:98
static constexpr ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:423

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

Referenced by UpdelRoll::initializeUnsetMetadata().

541  {
542  ChunkMetadataMap metadata_map;
543  for (const auto& [column_id, chunk_metadata] : chunkMetadataMap) {
544  metadata_map[column_id] = std::make_shared<ChunkMetadata>(*chunk_metadata);
545  }
546  return metadata_map;
547 }
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 549 of file InputMetadata.cpp.

References CHECK_EQ.

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

549  {
550  std::unique_ptr<std::lock_guard<std::mutex>> lock;
551  if (resultSetMutex) {
552  lock.reset(new std::lock_guard<std::mutex>(*resultSetMutex));
553  }
556  numTuples = resultSet->rowCount();
558  }
559  return numTuples;
560 }
#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: