libfoedus-core
FOEDUS Core Library
engine_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_ENGINE_OPTIONS_HPP_
19 #define FOEDUS_ENGINE_OPTIONS_HPP_
20 
21 #include <iosfwd>
22 
23 // rather than forward declarations of option classes for each module, we include them here.
24 // these are anyway very small header files, and demanding user code to include each of them
25 // won't fly. further, just holding instances, rather than pointers, makes (de)allocation simpler.
26 #include "foedus/cxx11.hpp"
27 #include "foedus/error_stack.hpp"
41 namespace foedus {
79  EngineOptions();
80  EngineOptions(const EngineOptions& other);
81  EngineOptions& operator=(const EngineOptions& other);
82 
89  void calculate_required_memory(uint64_t* shared_bytes, uint64_t* local_bytes) const;
90 
107  ErrorStack prescreen(std::ostream* details_out) const;
108 
110  void prescreen_ulimits(
111  uint64_t required_total_safe_bytes,
112  bool* has_any_error,
113  std::ostream* details_out) const;
114 
116  void prescreen_sysctl(
117  uint64_t required_shared_safe_bytes,
118  bool* has_any_error,
119  std::ostream* details_out) const;
120 
127  static uint64_t read_int_from_proc_fs(const char* path, std::ostream* details_out);
133  static uint64_t get_available_hugepage_memory(std::ostream* details_out);
134 
135  // options for each module
148 
149  EXTERNALIZABLE(EngineOptions);
150 };
151 } // namespace foedus
152 #endif // FOEDUS_ENGINE_OPTIONS_HPP_
Set of options about threads and thread-groups.
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
void prescreen_ulimits(uint64_t required_total_safe_bytes, bool *has_any_error, std::ostream *details_out) const
Subroutine of prescreen to check ulimit values.
Set of options for log manager.
Definition: log_options.hpp:39
#define EXTERNALIZABLE(clazz)
Macro to declare/define essential methods for an externalizable class.
debugging::DebuggingOptions debugging_
Brings error stacktrace information as return value of functions.
Definition: error_stack.hpp:81
EngineOptions()
Constructs option values with default values.
proc::ProcOptions proc_
ErrorStack prescreen(std::ostream *details_out) const
Checks the machine environment and raises as many errors as possible before the engine starts up...
Set of options for xct manager.
Definition: xct_options.hpp:35
memory::MemoryOptions memory_
storage::StorageOptions storage_
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
Definition: cxx11.hpp:131
void prescreen_sysctl(uint64_t required_shared_safe_bytes, bool *has_any_error, std::ostream *details_out) const
Subroutine of prescreen to check sysctl values.
snapshot::SnapshotOptions snapshot_
savepoint::SavepointOptions savepoint_
restart::RestartOptions restart_
Set of options for memory manager.
static uint64_t get_available_hugepage_memory(std::ostream *details_out)
A utility method to check how much hugepage memory is currently available.
Set of option values given to the engine at start-up.
Set of options for snapshot cache manager.
Set of options for storage manager.
Set of options for snapshot manager.
static uint64_t read_int_from_proc_fs(const char *path, std::ostream *details_out)
A utility method to read /proc/ value in linux.
thread::ThreadOptions thread_
void calculate_required_memory(uint64_t *shared_bytes, uint64_t *local_bytes) const
Set of options for loading system/user procedures.
Set of options for SOC manager.
Definition: soc_options.hpp:38
Set of options for savepoint manager.
Set of options for restart manager.
Set of options for debugging support.
EngineOptions & operator=(const EngineOptions &other)
cache::CacheOptions cache_