OmniSciDB  2e3a973ef4
foreign_storage::anonymous_namespace{ForeignStorageCache.cpp} Namespace Reference

Functions

template<typename Func , typename T >
void iterate_over_matching_prefix (Func func, T &chunk_collection, const ChunkKey &chunk_prefix)
 
void set_metadata_for_buffer (AbstractBuffer *buffer, ChunkMetadata *meta)
 

Function Documentation

◆ iterate_over_matching_prefix()

template<typename Func , typename T >
void foreign_storage::anonymous_namespace{ForeignStorageCache.cpp}::iterate_over_matching_prefix ( Func  func,
T &  chunk_collection,
const ChunkKey chunk_prefix 
)

Definition at line 33 of file ForeignStorageCache.cpp.

Referenced by foreign_storage::ForeignStorageCache::getCachedChunksForKeyPrefix(), and foreign_storage::ForeignStorageCache::getCachedMetadataVecForKeyPrefix().

35  {
36  ChunkKey upper_prefix(chunk_prefix);
37  upper_prefix.push_back(std::numeric_limits<int>::max());
38  auto end_it = chunk_collection.upper_bound(static_cast<const ChunkKey>(upper_prefix));
39  for (auto chunk_it = chunk_collection.lower_bound(chunk_prefix); chunk_it != end_it;
40  ++chunk_it) {
41  func(*chunk_it);
42  }
43 }
std::vector< int > ChunkKey
Definition: types.h:37
+ Here is the caller graph for this function:

◆ set_metadata_for_buffer()

void foreign_storage::anonymous_namespace{ForeignStorageCache.cpp}::set_metadata_for_buffer ( AbstractBuffer buffer,
ChunkMetadata meta 
)

Definition at line 45 of file ForeignStorageCache.cpp.

References ChunkMetadata::chunkStats, Data_Namespace::AbstractBuffer::getEncoder(), Data_Namespace::AbstractBuffer::initEncoder(), ChunkMetadata::numBytes, ChunkMetadata::numElements, Encoder::resetChunkStats(), Encoder::setNumElems(), Data_Namespace::AbstractBuffer::setSize(), Data_Namespace::AbstractBuffer::setUpdated(), and ChunkMetadata::sqlType.

Referenced by foreign_storage::ForeignStorageCache::cacheMetadataVec().

45  {
46  buffer->initEncoder(meta->sqlType);
47  buffer->setSize(meta->numBytes);
48  buffer->getEncoder()->setNumElems(meta->numElements);
49  buffer->getEncoder()->resetChunkStats(meta->chunkStats);
50  buffer->setUpdated();
51 }
void initEncoder(const SQLTypeInfo &tmp_sql_type)
void setNumElems(const size_t num_elems)
Definition: Encoder.h:215
ChunkStats chunkStats
Definition: ChunkMetadata.h:35
virtual bool resetChunkStats(const ChunkStats &)
: Reset chunk level stats (min, max, nulls) using new values from the argument.
Definition: Encoder.h:212
void setSize(const size_t size)
SQLTypeInfo sqlType
Definition: ChunkMetadata.h:32
size_t numElements
Definition: ChunkMetadata.h:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function: