OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 186 of file QueryState.h.

Member Typedef Documentation

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

Definition at line 187 of file QueryState.h.

Member Function Documentation

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

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

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

+ 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 189 of file QueryState.h.

Referenced by create().

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

Definition at line 190 of file QueryState.h.

Referenced by create().


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