OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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

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 31 of file ForeignStorageCache.cpp.

33  {
34  ChunkKey upper_prefix(chunk_prefix);
35  upper_prefix.push_back(std::numeric_limits<int>::max());
36  auto end_it = chunk_collection.upper_bound(static_cast<const ChunkKey>(upper_prefix));
37  for (auto chunk_it = chunk_collection.lower_bound(chunk_prefix); chunk_it != end_it;
38  ++chunk_it) {
39  func(*chunk_it);
40  }
41 }
std::vector< int > ChunkKey
Definition: types.h:36
void foreign_storage::anonymous_namespace{ForeignStorageCache.cpp}::set_metadata_for_buffer ( AbstractBuffer buffer,
ChunkMetadata meta 
)

Definition at line 43 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().

43  {
44  buffer->initEncoder(meta->sqlType);
45  buffer->setSize(meta->numBytes);
46  buffer->getEncoder()->setNumElems(meta->numElements);
47  buffer->getEncoder()->resetChunkStats(meta->chunkStats);
48  buffer->setUpdated();
49 }
void initEncoder(const SQLTypeInfo &tmp_sql_type)
void setNumElems(const size_t num_elems)
Definition: Encoder.h:285
ChunkStats chunkStats
Definition: ChunkMetadata.h:37
virtual bool resetChunkStats(const ChunkStats &)
: Reset chunk level stats (min, max, nulls) using new values from the argument.
Definition: Encoder.h:274
void setSize(const size_t size)
SQLTypeInfo sqlType
Definition: ChunkMetadata.h:34
size_t numElements
Definition: ChunkMetadata.h:36

+ Here is the call graph for this function:

+ Here is the caller graph for this function: