OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBHandler::DeferredCopyFromSessions Struct Reference

Public Member Functions

std::optional
< DeferredCopyFromState
operator() (const std::string &session_id)
 
void add (const std::string &session_id, const DeferredCopyFromState &state)
 
void remove (const std::string &session_id)
 

Public Attributes

std::unordered_map
< std::string,
DeferredCopyFromState
was_deferred_copy_from
 
std::mutex deferred_copy_from_mutex
 

Detailed Description

Definition at line 970 of file DBHandler.h.

Member Function Documentation

void DBHandler::DeferredCopyFromSessions::add ( const std::string &  session_id,
const DeferredCopyFromState state 
)
inline

Definition at line 983 of file DBHandler.h.

References CHECK.

Referenced by DBHandler::sql_execute_impl().

983  {
984  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
985  const auto ret = was_deferred_copy_from.insert(std::make_pair(session_id, state));
986  CHECK(ret.second);
987  }
std::unordered_map< std::string, DeferredCopyFromState > was_deferred_copy_from
Definition: DBHandler.h:971
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the caller graph for this function:

std::optional<DeferredCopyFromState> DBHandler::DeferredCopyFromSessions::operator() ( const std::string &  session_id)
inline

Definition at line 974 of file DBHandler.h.

974  {
975  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
976  auto itr = was_deferred_copy_from.find(session_id);
977  if (itr == was_deferred_copy_from.end()) {
978  return std::nullopt;
979  }
980  return itr->second;
981  }
std::unordered_map< std::string, DeferredCopyFromState > was_deferred_copy_from
Definition: DBHandler.h:971
void DBHandler::DeferredCopyFromSessions::remove ( const std::string &  session_id)
inline

Definition at line 989 of file DBHandler.h.

Referenced by DBHandler::process_deferred_copy_from(), and DBHandler::sql_execute().

989  {
990  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
991  was_deferred_copy_from.erase(session_id);
992  }
std::unordered_map< std::string, DeferredCopyFromState > was_deferred_copy_from
Definition: DBHandler.h:971

+ Here is the caller graph for this function:

Member Data Documentation

std::mutex DBHandler::DeferredCopyFromSessions::deferred_copy_from_mutex

Definition at line 972 of file DBHandler.h.

std::unordered_map<std::string, DeferredCopyFromState> DBHandler::DeferredCopyFromSessions::was_deferred_copy_from

Definition at line 971 of file DBHandler.h.


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