OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
query_state::QueryStates Class Reference

#include <QueryState.h>

Public Member Functions

template<typename... ARGS>
CircleBuffer::value_type create (ARGS &&...args)
 

Private Types

using CircleBuffer = boost::circular_buffer< std::shared_ptr< QueryState >>
 

Private Attributes

CircleBuffer circle_buffer_ {128}
 
std::mutex circle_mutex_
 

Detailed Description

Definition at line 177 of file QueryState.h.

Member Typedef Documentation

using query_state::QueryStates::CircleBuffer = boost::circular_buffer<std::shared_ptr<QueryState>>
private

Definition at line 178 of file QueryState.h.

Member Function Documentation

template<typename... ARGS>
CircleBuffer::value_type query_state::QueryStates::create ( ARGS &&...  args)
inline

Definition at line 185 of file QueryState.h.

References run_benchmark_import::args, circle_buffer_, circle_mutex_, and query_state::QueryState::create().

Referenced by QueryRunner::QueryRunner::create_query_state().

185  {
186  std::lock_guard<std::mutex> lock(circle_mutex_);
187  /* Logic for ensuring QueryState objects are logged before deleting them.
188  if (circle_buffer_.full() && !circle_buffer_.front()->isLogged()) {
189  constexpr size_t MAX_SIZE_BEFORE_OVERWRITE = 128;
190  if (circle_buffer_.size() < MAX_SIZE_BEFORE_OVERWRITE) {
191  circle_buffer_.set_capacity(2 * circle_buffer_.capacity());
192  } else {
193  LOG(ERROR) << "QueryStates is holding " << circle_buffer_.size()
194  << " queries but the oldest query_state has not completed
195  logging.";
196  }
197  }
198  */
199  circle_buffer_.push_back(QueryState::create(std::forward<ARGS>(args)...));
200  return circle_buffer_.back();
201  }
static std::shared_ptr< QueryState > create(ARGS &&...args)
Definition: QueryState.h:140
CircleBuffer circle_buffer_
Definition: QueryState.h:180

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

CircleBuffer query_state::QueryStates::circle_buffer_ {128}
private

Definition at line 180 of file QueryState.h.

Referenced by create().

std::mutex query_state::QueryStates::circle_mutex_
private

Definition at line 181 of file QueryState.h.

Referenced by create().


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