OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
heavyai::RequestInfo Class Reference

#include <RequestInfo.h>

+ Collaboration diagram for heavyai::RequestInfo:

Public Member Functions

 RequestInfo (std::string const &session_id_or_json)
 
 RequestInfo (std::string session_id, logger::RequestId const request_id)
 
std::string json () const
 
logger::RequestId requestId () const
 
std::string const & sessionId () const
 
void setRequestId (logger::RequestId const request_id)
 

Private Attributes

std::string session_id_
 
logger::RequestId request_id_
 

Detailed Description

Definition at line 28 of file RequestInfo.h.

Constructor & Destructor Documentation

heavyai::RequestInfo::RequestInfo ( std::string const &  session_id_or_json)

Definition at line 9 of file RequestInfo.cpp.

References request_id_, and session_id_.

9  {
10  if (!session_id_or_json.empty() && session_id_or_json[0] == '{') {
11  std::istringstream iss(session_id_or_json);
12  boost::property_tree::ptree ptree;
13  boost::property_tree::read_json(iss, ptree);
14  session_id_ = ptree.get<std::string>("session_id");
15  request_id_ = ptree.get<logger::RequestId>("request_id");
16  } else {
17  session_id_ = session_id_or_json;
18  request_id_ = 0; // Valid request_ids are always positive.
19  }
20 }
logger::RequestId request_id_
Definition: RequestInfo.h:30
std::string session_id_
Definition: RequestInfo.h:29
uint64_t RequestId
Definition: Logger.h:131
heavyai::RequestInfo::RequestInfo ( std::string  session_id,
logger::RequestId const  request_id 
)
inline

Definition at line 36 of file RequestInfo.h.

37  : session_id_(std::move(session_id)), request_id_(request_id) {}
logger::RequestId request_id_
Definition: RequestInfo.h:30
std::string session_id_
Definition: RequestInfo.h:29
RequestId request_id()
Definition: Logger.cpp:876

Member Function Documentation

std::string heavyai::RequestInfo::json ( ) const

Definition at line 22 of file RequestInfo.cpp.

References request_id_, and session_id_.

Referenced by DBHandler::create_table(), DBHandler::processCalciteRequest(), and DBHandler::sql_execute_gdf().

22  {
23  boost::property_tree::ptree ptree;
24  std::ostringstream oss;
25  ptree.put("session_id", session_id_);
26  ptree.put("request_id", request_id_);
27  constexpr bool pretty_print = false;
28  boost::property_tree::write_json(oss, ptree, pretty_print);
29  return oss.str();
30 }
logger::RequestId request_id_
Definition: RequestInfo.h:30
std::string session_id_
Definition: RequestInfo.h:29

+ Here is the caller graph for this function:

logger::RequestId heavyai::RequestInfo::requestId ( ) const
inline

Definition at line 39 of file RequestInfo.h.

References request_id_.

Referenced by DBHandler::check_table_consistency(), DBHandler::checkpoint(), DBHandler::clear_cpu_memory(), DBHandler::clear_gpu_memory(), DBHandler::clearRenderMemory(), DBHandler::clone_session(), DBHandler::create_custom_expression(), DBHandler::create_dashboard(), DBHandler::create_link(), DBHandler::create_table(), DBHandler::deallocate_df(), DBHandler::delete_custom_expressions(), DBHandler::delete_dashboards(), DBHandler::detect_column_types(), DBHandler::disconnect(), DBHandler::get_all_effective_roles_for_user(), DBHandler::get_all_files_in_archive(), DBHandler::get_all_roles_for_user(), DBHandler::get_completion_hints(), DBHandler::get_custom_expressions(), DBHandler::get_dashboard(), DBHandler::get_dashboard_grantees(), DBHandler::get_dashboards(), DBHandler::get_databases(), DBHandler::get_db_object_privs(), DBHandler::get_db_objects_for_grantee(), DBHandler::get_device_parameters(), DBHandler::get_first_geo_file_in_archive(), DBHandler::get_hardware_info(), DBHandler::get_heap_profile(), DBHandler::get_internal_table_details(), DBHandler::get_internal_table_details_for_database(), DBHandler::get_layers_in_geo_file(), DBHandler::get_license_claims(), DBHandler::get_link_view(), DBHandler::get_memory(), DBHandler::get_physical_tables(), DBHandler::get_queries_info(), DBHandler::get_result_row_for_pixel(), DBHandler::get_roles(), DBHandler::get_server_status(), DBHandler::get_session_info(), DBHandler::get_status(), DBHandler::get_table_details(), DBHandler::get_table_details_for_database(), DBHandler::get_table_epoch(), DBHandler::get_table_epoch_by_name(), DBHandler::get_table_epochs(), DBHandler::get_tables(), DBHandler::get_tables_for_database(), DBHandler::get_tables_meta(), DBHandler::get_users(), DBHandler::get_valid_groups(), DBHandler::get_views(), DBHandler::has_object_privilege(), DBHandler::has_role(), DBHandler::import_geo_table(), DBHandler::import_table(), DBHandler::import_table_status(), DBHandler::insert_chunks(), DBHandler::insert_data(), DBHandler::interrupt(), DBHandler::invalidate_cur_session(), DBHandler::load_table(), DBHandler::load_table_binary(), DBHandler::load_table_binary_arrow(), DBHandler::load_table_binary_columnar(), DBHandler::query_get_outer_fragment_count(), DBHandler::register_runtime_extension_functions(), DBHandler::render_vega(), DBHandler::replace_dashboard(), DBHandler::set_cur_session(), DBHandler::set_execution_mode(), DBHandler::set_license_key(), DBHandler::set_table_epoch(), DBHandler::set_table_epoch_by_name(), DBHandler::set_table_epochs(), DBHandler::share_dashboards(), DBHandler::sql_execute(), DBHandler::sql_execute_df(), DBHandler::sql_execute_gdf(), DBHandler::sql_validate(), DBHandler::start_heap_profile(), DBHandler::start_query(), DBHandler::start_render_query(), DBHandler::stop_heap_profile(), DBHandler::switch_database(), DBHandler::unshare_dashboards(), and DBHandler::update_custom_expression().

39 { return request_id_; }
logger::RequestId request_id_
Definition: RequestInfo.h:30
std::string const& heavyai::RequestInfo::sessionId ( ) const
inline

Definition at line 40 of file RequestInfo.h.

References session_id_.

Referenced by DBHandler::check_table_consistency(), DBHandler::checkpoint(), DBHandler::clear_cpu_memory(), DBHandler::clear_gpu_memory(), DBHandler::clearRenderMemory(), DBHandler::clone_session(), DBHandler::create_custom_expression(), DBHandler::create_dashboard(), DBHandler::create_link(), DBHandler::deallocate_df(), DBHandler::delete_custom_expressions(), DBHandler::delete_dashboards(), DBHandler::detect_column_types(), DBHandler::disconnect(), DBHandler::get_all_effective_roles_for_user(), DBHandler::get_all_files_in_archive(), DBHandler::get_all_roles_for_user(), DBHandler::get_completion_hints(), DBHandler::get_custom_expressions(), DBHandler::get_dashboard(), DBHandler::get_dashboard_grantees(), DBHandler::get_dashboards(), DBHandler::get_databases(), DBHandler::get_db_object_privs(), DBHandler::get_db_objects_for_grantee(), DBHandler::get_device_parameters(), DBHandler::get_first_geo_file_in_archive(), DBHandler::get_hardware_info(), DBHandler::get_heap_profile(), DBHandler::get_internal_table_details(), DBHandler::get_internal_table_details_for_database(), DBHandler::get_layers_in_geo_file(), DBHandler::get_license_claims(), DBHandler::get_link_view(), DBHandler::get_memory(), DBHandler::get_physical_tables(), DBHandler::get_queries_info(), DBHandler::get_result_row_for_pixel(), DBHandler::get_roles(), DBHandler::get_server_status(), DBHandler::get_session_info(), DBHandler::get_status(), DBHandler::get_table_details(), DBHandler::get_table_details_for_database(), DBHandler::get_table_epoch(), DBHandler::get_table_epoch_by_name(), DBHandler::get_table_epochs(), DBHandler::get_tables(), DBHandler::get_tables_for_database(), DBHandler::get_tables_meta(), DBHandler::get_users(), DBHandler::get_valid_groups(), DBHandler::get_views(), DBHandler::has_object_privilege(), DBHandler::has_role(), DBHandler::import_geo_table(), DBHandler::import_table(), DBHandler::import_table_status(), DBHandler::insert_chunks(), DBHandler::insert_data(), DBHandler::interrupt(), DBHandler::invalidate_cur_session(), DBHandler::load_table(), DBHandler::load_table_binary(), DBHandler::load_table_binary_arrow(), DBHandler::load_table_binary_columnar(), DBHandler::processCalciteRequest(), DBHandler::query_get_outer_fragment_count(), DBHandler::register_runtime_extension_functions(), DBHandler::render_vega(), DBHandler::replace_dashboard(), DBHandler::set_cur_session(), DBHandler::set_execution_mode(), DBHandler::set_table_epoch(), DBHandler::set_table_epoch_by_name(), DBHandler::set_table_epochs(), DBHandler::share_dashboards(), DBHandler::sql_execute(), DBHandler::sql_execute_df(), DBHandler::sql_execute_gdf(), DBHandler::sql_validate(), DBHandler::start_heap_profile(), DBHandler::start_query(), DBHandler::start_render_query(), DBHandler::stop_heap_profile(), DBHandler::switch_database(), DBHandler::unshare_dashboards(), and DBHandler::update_custom_expression().

40 { return session_id_; }
std::string session_id_
Definition: RequestInfo.h:29
void heavyai::RequestInfo::setRequestId ( logger::RequestId const  request_id)
inline

Definition at line 42 of file RequestInfo.h.

References logger::request_id(), and request_id_.

Referenced by DBHandler::create_table(), and DBHandler::sql_execute_gdf().

logger::RequestId request_id_
Definition: RequestInfo.h:30
RequestId request_id()
Definition: Logger.cpp:876

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

logger::RequestId heavyai::RequestInfo::request_id_
private

Definition at line 30 of file RequestInfo.h.

Referenced by json(), requestId(), RequestInfo(), and setRequestId().

std::string heavyai::RequestInfo::session_id_
private

Definition at line 29 of file RequestInfo.h.

Referenced by json(), RequestInfo(), and sessionId().


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