OmniSciDB  49c0524acb
 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 175 of file QueryState.h.

Member Typedef Documentation

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

Definition at line 176 of file QueryState.h.

Member Function Documentation

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

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

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

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

Referenced by create().

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

Definition at line 179 of file QueryState.h.

Referenced by create().


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