libfoedus-core
FOEDUS Core Library
xct_manager.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 {
22 XctManager::XctManager(Engine* engine) : pimpl_(nullptr) {
23  pimpl_ = new XctManagerPimpl(engine);
24 }
26  delete pimpl_;
27  pimpl_ = nullptr;
28 }
29 
31 bool XctManager::is_initialized() const { return pimpl_->is_initialized(); }
35 void XctManager::wait_for_current_global_epoch(Epoch target_epoch, int64_t wait_microseconds) {
36  pimpl_->wait_for_current_global_epoch(target_epoch, wait_microseconds);
37 }
38 
39 
40 } // namespace xct
41 } // namespace foedus
void resume_accepting_xct()
Make sure you call this after pause_accepting_xct().
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition: assert_nd.hpp:44
bool is_initialized() const override
Returns whether the object has been already initialized or not.
Definition: xct_manager.cpp:31
void resume_accepting_xct()
Make sure you call this after pause_accepting_xct().
Definition: xct_manager.cpp:34
ErrorStack uninitialize() override final
Typical implementation of Initializable::uninitialize() that provides uninitialize-once semantics...
Brings error stacktrace information as return value of functions.
Definition: error_stack.hpp:81
Represents a time epoch.
Definition: epoch.hpp:61
void pause_accepting_xct()
Pause all begin_xct until you call resume_accepting_xct()
Definition: xct_manager.cpp:33
ErrorStack initialize() override
Acquires resources in this object, usually called right after constructor.
Definition: xct_manager.cpp:30
void wait_for_current_global_epoch(Epoch target_epoch, int64_t wait_microseconds)
ErrorStack initialize() override final
Typical implementation of Initializable::initialize() that provides initialize-once semantics...
Database engine object that holds all resources and provides APIs.
Definition: engine.hpp:109
ErrorStack uninitialize() override
An idempotent method to release all resources of this object, if any.
Definition: xct_manager.cpp:32
void wait_for_current_global_epoch(Epoch target_epoch, int64_t wait_microseconds=-1)
Passively wait until the current global epoch becomes the given value.
Definition: xct_manager.cpp:35
Pimpl object of XctManager.
void pause_accepting_xct()
Pause all begin_xct until you call resume_accepting_xct()
bool is_initialized() const override final
Returns whether the object has been already initialized or not.