46 std::stringstream path_str;
47 path_str << folder <<
"/" << logger <<
"_" << ordinal <<
".log";
48 return path_str.str();
69 "String pattern of path of log folders in each NUMA node.\n"
70 " This specifies the path of the folder to contain log file written out in each NUMA node."
71 " Two special placeholders can be used; $NODE$ and $LOGGER$."
72 " $NODE$ is replaced with the NUMA node number."
73 " $LOGGER$ is replaced with the logger index in the node (0 to loggers_per_node_ - 1)."
75 " /log/node_$NODE$/logger_$LOGGER$ becomes /log/node_1/logger_0 on node-1 and logger-0."
76 " /log/logger_$INDEX$ becomes /log/logger_1 on any node and logger-1."
77 " Both are optional. You can specify a fixed path without the patterns, which means you"
78 " will use the same folder for multiple loggers and nodes. Even in that case, log file"
79 " names include node/logger number, so it wouldn't cause any data corruption."
80 " It just makes things harder for poor sysadmins.");
82 "This value must be at least 1 (which is also default)."
83 " A larger value might be able to employ more CPU power if you have succient # of cores."
84 " For the best performance, the number of loggers in each NUMA node must be"
85 " a submultiple of the number of cores in the node (s.t. logger assignment is balanced).");
89 "Whether to flush transaction logs and take savepoint when uninitialize() is called");
91 "[Experiments-only] Settings to emulate slower logging device",
emulation_));
std::string convert_folder_path_pattern(int node, int logger) const
converts folder_path_pattern_ into a string with the given IDs.
#define EXTERNALIZE_LOAD_ELEMENT(element, attribute)
Reads a child xml element to load a member variable of this object.
static ErrorStack get_child_element(tinyxml2::XMLElement *parent, const std::string &tag, Externalizable *child, bool optional=false)
child Externalizable version
std::string construct_suffixed_log_path(int node, int logger, LogFileOrdinal ordinal) const
construct full path of individual log file (log_folder/LOGGERID_ORDINAL.log)
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
static ErrorStack add_child_element(tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, const Externalizable &child)
child Externalizable version
bool flush_at_shutdown_
Whether to flush transaction logs and take savepoint when uninitialize() is called.
Brings error stacktrace information as return value of functions.
static ErrorStack insert_comment(tinyxml2::XMLElement *element, const std::string &comment)
fs::FixedPath folder_path_pattern_
String pattern of path of log folders in each NUMA node.
ErrorStack save(tinyxml2::XMLElement *element) const override
Writes the content of this object to the given XML element.
LogOptions()
Constructs option values with default values.
uint32_t LogFileOrdinal
Ordinal of log files (eg "log.0", "log.1").
uint32_t log_buffer_kb_
Size in KB of log buffer for each worker thread.
std::string replace_all(const std::string &target, const std::string &search, const std::string &replacement)
target.replaceAll(search, replacement).
ErrorStack load(tinyxml2::XMLElement *element) override
Reads the content of this object from the given XML element.
Default value for log_file_size_mb_.
std::basic_string< CHAR > str() const
Convert to a std::string object.
Default value for log_buffer_kb_.
std::string construct_meta_log_path() const
metadata log file is placed in node-0/logger-0 folder
#define CHECK_ERROR(x)
This macro calls x and checks its returned value.
foedus::fs::DeviceEmulationOptions emulation_
Settings to emulate slower logging device.
const ErrorStack kRetOk
Normal return value for no-error case.
#define EXTERNALIZE_SAVE_ELEMENT(element, attribute, comment)
Adds an xml element to represent a member variable of this object.
uint32_t log_file_size_mb_
Size in MB of each file loggers write out.
uint16_t loggers_per_node_
Number of loggers per NUMA node.