libfoedus-core
FOEDUS Core Library
xct_options.cpp
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  */
20 namespace foedus {
21 namespace xct {
29  enable_retrospective_lock_list_ = false; // TODO(Hideaki) tentative!
31  force_canonical_xlocks_in_precommit_ = true; // TODO(Hideaki) tentative!
33 }
34 
35 ErrorStack XctOptions::load(tinyxml2::XMLElement* element) {
46  return kRetOk;
47 }
48 
49 ErrorStack XctOptions::save(tinyxml2::XMLElement* element) const {
50  CHECK_ERROR(insert_comment(element, "Set of options for xct manager"));
51 
53  "The maximum number of read-set one transaction can have. Default is 64K records.\n"
54  " We pre-allocate this much memory for each NumaCoreMemory. So, don't make it too large.");
56  "The maximum number of write-set one transaction can have. Default is 16K records.\n"
57  " We pre-allocate this much memory for each NumaCoreMemory. So, don't make it too large.");
59  "The maximum number of lock-free read-set one transaction can have.\n"
60  " Default is very small (256) because this is the number of sequential storages\n"
61  " a xct accesses, not the number of records.");
63  "The maximum number of lock-free write-set one transaction can have. Default is 8K records.\n"
64  " We pre-allocate this much memory for each NumaCoreMemory. So, don't make it too large.");
66  "Local work memory is used for various purposes during a transaction."
67  " We avoid allocating such temporary memory for each transaction and pre-allocate this"
68  " size at start up.");
70  "Intervals in milliseconds between epoch advancements. Default is 20 ms\n"
71  " Too frequent epoch advancement might become bottleneck because we synchronously write.\n"
72  " out savepoint file for each non-empty epoch. However, too infrequent epoch advancement\n"
73  " would increase the latency of queries because transactions are not deemed as commit"
74  " until the epoch advances.");
76  "When enabled, we remember read/write-sets on abort and use it as RLL on next run.");
78  "When we construct Retrospective Lock List (RLL) after aborts, we add"
79  " read-locks on records whose hotness exceeds this value.");
81  "Whether precommit always releases all locks that violate canonical mode before"
82  " taking X-locks.");
84  "Defines which implementation of MCS locks to use for RW locks."
85  " So far we allow kMcsImplementationTypeSimple and kMcsImplementationTypeExtended.");
86  return kRetOk;
87 }
88 
89 
90 } // namespace xct
91 } // namespace foedus
#define EXTERNALIZE_LOAD_ELEMENT(element, attribute)
Reads a child xml element to load a member variable of this object.
uint32_t max_lock_free_read_set_size_
The maximum number of lock-free read-set one transaction can have.
Definition: xct_options.hpp:84
bool enable_retrospective_lock_list_
Whether to use Retrospective Lock List (RLL) after aborts.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition: assert_nd.hpp:44
Default value for max_read_set_size_.
Definition: xct_options.hpp:39
Brings error stacktrace information as return value of functions.
Definition: error_stack.hpp:81
static ErrorStack insert_comment(tinyxml2::XMLElement *element, const std::string &comment)
ErrorStack save(tinyxml2::XMLElement *element) const override
Writes the content of this object to the given XML element.
Definition: xct_options.cpp:49
uint32_t epoch_advance_interval_ms_
Intervals in milliseconds between epoch advancements.
uint32_t max_lock_free_write_set_size_
The maximum number of lock-free write-set one transaction can have.
Definition: xct_options.hpp:92
uint16_t hot_threshold_for_retrospective_lock_list_
When we construct Retrospective Lock List (RLL) after aborts, we add read-locks on records whose hotn...
uint32_t max_write_set_size_
The maximum number of write-set one transaction can have.
Definition: xct_options.hpp:76
Default value for max_lock_free_read_set_size_.
Definition: xct_options.hpp:43
Default value for max_lock_free_write_set_size_.
Definition: xct_options.hpp:45
bool force_canonical_xlocks_in_precommit_
Whether precommit always releases all locks that violate canonical mode before taking X-locks...
#define CHECK_ERROR(x)
This macro calls x and checks its returned value.
XctOptions()
Constructs option values with default values.
Definition: xct_options.cpp:22
const ErrorStack kRetOk
Normal return value for no-error case.
uint16_t mcs_implementation_type_
Defines which implementation of MCS locks to use for RW locks.
ErrorStack load(tinyxml2::XMLElement *element) override
Reads the content of this object from the given XML element.
Definition: xct_options.cpp:35
#define EXTERNALIZE_SAVE_ELEMENT(element, attribute, comment)
Adds an xml element to represent a member variable of this object.
uint32_t max_read_set_size_
The maximum number of read-set one transaction can have.
Definition: xct_options.hpp:60
uint32_t local_work_memory_size_mb_
Size of local and temporary work memory one transaction can use during transaction.
Default value for local_work_memory_size_mb_.
Definition: xct_options.hpp:47
Default value for max_write_set_size_.
Definition: xct_options.hpp:41
Default value for epoch_advance_interval_ms_.
Definition: xct_options.hpp:49