20 #include <glog/logging.h>
40 for (
soc::SocId node = 0; node < soc_count; ++node) {
91 LOG(ERROR) <<
"Incorrect use of pre_register(): "
96 LOG(ERROR) <<
"Incorrect use of pre_register(): "
111 LOG(ERROR) <<
"Incorrect use of local_register(): "
116 LOG(ERROR) <<
"Incorrect use of local_register(): "
122 LOG(ERROR) <<
"A procedure of this name is already registered in this engine: "
123 << proc_and_name.first;
126 LOG(INFO) <<
"local-registered a user procedure: " << proc_and_name.first;
131 LOG(ERROR) <<
"Incorrect use of emulated_register(): "
138 LOG(ERROR) <<
"Incorrect use of emulated_register(): "
142 LOG(INFO) <<
"emulated-registered a user procedure: " << proc_and_name.first;
151 if (shared_data->
procs_[i].first == name) {
166 shared_data->
procs_[new_id] = proc_and_name;
174 return "<Master engine has no proc>";
176 std::stringstream str;
183 str <<
"(" << data->
procs_[i].first <<
"," << data->
procs_[i].second <<
")";
ErrorStack uninitialize_once() override
LocalProcId * name_sort_
IDs sorted by name for quick lookup.
std::string describe_short() const
std::vector< SharedData > all_soc_procs_
Shared data of all SOCs.
ErrorStack local_register(const ProcAndName &proc_and_name)
ProcManagerControlBlock * control_block_
#define ERROR_STACK(e)
Instantiates ErrorStack with the given foedus::error_code, creating an error stack with the current f...
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
static LocalProcId find_by_name(const ProcName &name, SharedData *shared_data)
proc::LocalProcId * proc_name_sort_memory_
This memory stores the ID of procedures sorted by their names.
0x0D02 : "PROC : Post-register can be called only after engine initialization." ...
0x0D04 : "PROC : This registration type can be invoked only at master engine." .
Brings error stacktrace information as return value of functions.
soc::SharedMutex lock_
Mutex to protect data.
EngineType soc_type_
How to launch SOC engine instances.
Same as GlobalMemoryAnchors except this is for node_memories_.
0x0D03 : "PROC : This registration type cannot be used for this SOC type." .
NodeMemoryAnchors * get_node_memory_anchors(SocId node)
All shared data in this module.
const EngineOptions & get_options() const
bool is_master() const
Returns if this engine object is a master instance.
proc::ProcManagerControlBlock * proc_manager_memory_
ProcManagers's status and its synchronization mechanism on this node.
ErrorStack initialize_once() override
ErrorStack pre_register(const ProcAndName &proc_and_name)
Batches zero or more ErrorStack objects to represent in one ErrorStack.
0x0D07 : "PROC : The specified procedure name already exists in this engine." . ...
std::string describe_registered_procs() const
Auto-lock scope object for SharedMutex.
0x0D01 : "PROC : Pre-register can be called only before engine initialization." ...
std::pair< ProcName, Proc > ProcAndName
0x0D05 : "PROC : This registration type can be invoked only at child engine." . ...
EngineType
Type of an engine instance of how to launch it.
ErrorStack get_proc(const ProcName &name, Proc *out)
const LocalProcId kLocalProcInvalid
A child SOC instance launched via fork().
SharedData * get_local_data()
uint16_t group_count_
Number of ThreadGroup in the engine.
Repository of all shared memory in one FOEDUS instance.
ErrorStack emulated_register(const ProcAndName &proc_and_name)
#define SUMMARIZE_ERROR_BATCH(x)
This macro calls ErrorStackBatch::summarize() with automatically provided parameters.
uint16_t SocId
Represents an ID of an SOC, or NUMA node.
thread::ThreadOptions thread_
ProcAndName * procs_
The procedure list maintained in this module is an array of ProcName.
proc::ProcAndName * proc_memory_
Procedure list on this node.
const ErrorStack kRetOk
Normal return value for no-error case.
soc::SocManager * get_soc_manager() const
See SOC and IPC.
const char * get_error_message(ErrorCode code)
Returns the error messages corresponding to ErrorCode enum defined in error_code.xmacro.
Atomic fence methods and load/store with fences that work for both C++11/non-C++11 code...
0x0D06 : "PROC : The specified procedure name is not found in this engine." .
#define ERROR_STACK_MSG(e, m)
Overload of ERROR_STACK(e) to receive a custom error message.
void memory_fence_acquire()
Equivalent to std::atomic_thread_fence(std::memory_order_acquire).
soc::SocId get_soc_id() const
If this is a child instance, returns its SOC ID (NUMA node).
uint32_t LocalProcId
Represents a locally-unique ID of a procedure in one SOC.
ErrorStack(* Proc)(const ProcArguments &args)
A function pointer of a user/system stored procedure.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
const CHAR * c_str() const
Convert to a C string.
static LocalProcId insert(const ProcAndName &proc_and_name, SharedData *shared_data)
bool is_initialized() const override final
Returns whether the object has been already initialized or not.
std::vector< ProcAndName > pre_registered_procs_
SharedMemoryRepo * get_shared_memory_repo()
Returns the shared memories maintained across SOCs.
A child SOC instance launched just as a thread in the same process as master.