OmniSciDB  340b00dbf6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SharedKernelContext Class Reference

#include <ExecutionKernel.h>

Public Member Functions

 SharedKernelContext (const std::vector< InputTableInfo > &query_infos)
 
const std::vector< uint64_t > & getFragOffsets ()
 
void addDeviceResults (ResultSetPtr &&device_results, std::vector< size_t > outer_table_fragment_ids)
 
std::vector< std::pair
< ResultSetPtr, std::vector
< size_t > > > & 
getFragmentResults ()
 
const std::vector
< InputTableInfo > & 
getQueryInfos () const
 

Public Attributes

std::atomic_flag dynamic_watchdog_set = ATOMIC_FLAG_INIT
 

Private Attributes

std::mutex reduce_mutex_
 
std::vector< std::pair
< ResultSetPtr, std::vector
< size_t > > > 
all_fragment_results_
 
std::vector< uint64_t > all_frag_row_offsets_
 
std::mutex all_frag_row_offsets_mutex_
 
const std::vector
< InputTableInfo > & 
query_infos_
 

Detailed Description

Definition at line 23 of file ExecutionKernel.h.

Constructor & Destructor Documentation

SharedKernelContext::SharedKernelContext ( const std::vector< InputTableInfo > &  query_infos)
inline

Definition at line 25 of file ExecutionKernel.h.

26  : query_infos_(query_infos) {}
const std::vector< InputTableInfo > & query_infos_

Member Function Documentation

void SharedKernelContext::addDeviceResults ( ResultSetPtr &&  device_results,
std::vector< size_t >  outer_table_fragment_ids 
)

Definition at line 76 of file ExecutionKernel.cpp.

References all_fragment_results_, anonymous_namespace{ExecutionKernel.cpp}::needs_skip_result(), and reduce_mutex_.

Referenced by ExecutionKernel::runImpl().

77  {
78  std::lock_guard<std::mutex> lock(reduce_mutex_);
79  if (!needs_skip_result(device_results)) {
80  all_fragment_results_.emplace_back(std::move(device_results),
81  outer_table_fragment_ids);
82  }
83 }
bool needs_skip_result(const ResultSetPtr &res)
std::vector< std::pair< ResultSetPtr, std::vector< size_t > > > all_fragment_results_
std::mutex reduce_mutex_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector< std::pair< ResultSetPtr, std::vector< size_t > > > & SharedKernelContext::getFragmentResults ( )

Definition at line 86 of file ExecutionKernel.cpp.

References all_fragment_results_.

Referenced by Executor::collectAllDeviceResults(), Executor::collectAllDeviceShardedTopResults(), Executor::executeUpdate(), Executor::executeWorkUnitPerFragment(), and Executor::resultsUnion().

86  {
87  return all_fragment_results_;
88 }
std::vector< std::pair< ResultSetPtr, std::vector< size_t > > > all_fragment_results_

+ Here is the caller graph for this function:

const std::vector< uint64_t > & SharedKernelContext::getFragOffsets ( )

Definition at line 63 of file ExecutionKernel.cpp.

References all_frag_row_offsets_, all_frag_row_offsets_mutex_, and query_infos_.

Referenced by Executor::createKernels(), and ExecutionKernel::runImpl().

63  {
64  std::lock_guard<std::mutex> lock(all_frag_row_offsets_mutex_);
65  if (all_frag_row_offsets_.empty()) {
66  all_frag_row_offsets_.resize(query_infos_.front().info.fragments.size() + 1);
67  for (size_t i = 1; i <= query_infos_.front().info.fragments.size(); ++i) {
69  all_frag_row_offsets_[i - 1] +
70  query_infos_.front().info.fragments[i - 1].getNumTuples();
71  }
72  }
73  return all_frag_row_offsets_;
74 }
std::vector< uint64_t > all_frag_row_offsets_
std::mutex all_frag_row_offsets_mutex_
const std::vector< InputTableInfo > & query_infos_

+ Here is the caller graph for this function:

const std::vector<InputTableInfo>& SharedKernelContext::getQueryInfos ( ) const
inline

Definition at line 35 of file ExecutionKernel.h.

References query_infos_.

Referenced by ExecutionKernel::runImpl().

35 { return query_infos_; }
const std::vector< InputTableInfo > & query_infos_

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<uint64_t> SharedKernelContext::all_frag_row_offsets_
private

Definition at line 43 of file ExecutionKernel.h.

Referenced by getFragOffsets().

std::mutex SharedKernelContext::all_frag_row_offsets_mutex_
private

Definition at line 44 of file ExecutionKernel.h.

Referenced by getFragOffsets().

std::vector<std::pair<ResultSetPtr, std::vector<size_t> > > SharedKernelContext::all_fragment_results_
private

Definition at line 41 of file ExecutionKernel.h.

Referenced by addDeviceResults(), and getFragmentResults().

std::atomic_flag SharedKernelContext::dynamic_watchdog_set = ATOMIC_FLAG_INIT

Definition at line 37 of file ExecutionKernel.h.

Referenced by ExecutionKernel::runImpl().

const std::vector<InputTableInfo>& SharedKernelContext::query_infos_
private

Definition at line 45 of file ExecutionKernel.h.

Referenced by getFragOffsets(), and getQueryInfos().

std::mutex SharedKernelContext::reduce_mutex_
private

Definition at line 40 of file ExecutionKernel.h.

Referenced by addDeviceResults().


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