libfoedus-core
FOEDUS Core Library
log_options.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2015, Hewlett-Packard Development Company, LP.
3  * This program is free software; you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by the Free
5  * Software Foundation; either version 2 of the License, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11  * more details. You should have received a copy of the GNU General Public
12  * License along with this program; if not, write to the Free Software
13  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14  *
15  * HP designates this particular file as subject to the "Classpath" exception
16  * as provided by HP in the LICENSE.txt file that accompanied this code.
17  */
18 #ifndef FOEDUS_LOG_LOG_OPTIONS_HPP_
19 #define FOEDUS_LOG_LOG_OPTIONS_HPP_
20 #include <stdint.h>
21 
22 #include <string>
23 #include <vector>
24 
25 #include "foedus/cxx11.hpp"
28 #include "foedus/fs/filesystem.hpp"
29 #include "foedus/log/log_id.hpp"
30 
31 namespace foedus {
32 namespace log {
41  enum Constants {
43  kDefaultLogBufferKb = (1 << 16),
45  kDefaultLogSizeMb = (1 << 14),
46  };
50  LogOptions();
51 
71 
81 
83  uint32_t log_buffer_kb_;
84 
93 
102 
105 
107  std::string convert_folder_path_pattern(int node, int logger) const;
109  std::string construct_suffixed_log_path(int node, int logger, LogFileOrdinal ordinal) const;
111  std::string construct_meta_log_path() const;
112 
114 };
115 } // namespace log
116 } // namespace foedus
117 #endif // FOEDUS_LOG_LOG_OPTIONS_HPP_
std::string convert_folder_path_pattern(int node, int logger) const
converts folder_path_pattern_ into a string with the given IDs.
Definition: log_options.cpp:36
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)
Definition: log_options.cpp:41
Represents an object that can be written to and read from files/bytes in XML format.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition: assert_nd.hpp:44
Set of options for log manager.
Definition: log_options.hpp:39
bool flush_at_shutdown_
Whether to flush transaction logs and take savepoint when uninitialize() is called.
#define EXTERNALIZABLE(clazz)
Macro to declare/define essential methods for an externalizable class.
fs::FixedPath folder_path_pattern_
String pattern of path of log folders in each NUMA node.
Definition: log_options.hpp:70
Typedefs of ID types used in log package.
LogOptions()
Constructs option values with default values.
Definition: log_options.cpp:28
uint32_t LogFileOrdinal
Ordinal of log files (eg "log.0", "log.1").
Definition: log_id.hpp:46
uint32_t log_buffer_kb_
Size in KB of log buffer for each worker thread.
Definition: log_options.hpp:83
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
Definition: cxx11.hpp:131
Default value for log_file_size_mb_.
Definition: log_options.hpp:45
Default value for log_buffer_kb_.
Definition: log_options.hpp:43
std::string construct_meta_log_path() const
metadata log file is placed in node-0/logger-0 folder
Definition: log_options.cpp:51
Set of configurations to emulate slower devices for some experiments.
foedus::fs::DeviceEmulationOptions emulation_
Settings to emulate slower logging device.
uint32_t log_file_size_mb_
Size in MB of each file loggers write out.
Definition: log_options.hpp:92
Constants
Constant values.
Definition: log_options.hpp:41
uint16_t loggers_per_node_
Number of loggers per NUMA node.
Definition: log_options.hpp:80