CUBRID Engine  latest
log_system_tran.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 //
20 // System transactions - can make changes to storage without modifying the database view; it requires logging.
21 //
22 
23 #ifndef _LOG_SYSTEM_TRAN_HPP_
24 #define _LOG_SYSTEM_TRAN_HPP_
25 
26 #include "storage_common.h" // TRANID
27 
28 #include <functional>
29 
30 struct log_tdes;
31 struct log_lsa;
32 
34 {
35  public:
36  log_system_tdes ();
37  log_system_tdes (log_tdes *tdes);
38  log_system_tdes (const log_system_tdes &o) = delete;
39 
41 
42  log_tdes *get_tdes ();
43 
44  void on_sysop_start ();
45  void on_sysop_end ();
46 
47  static void init_system_transations ();
48  static void destroy_system_transactions ();
49 
50  using map_func = std::function<void (log_tdes &)>;
51  using rv_delete_if_func = std::function<bool (const log_tdes &)>;
52 
53  static log_tdes *rv_get_or_alloc_tdes (TRANID trid);
54  static log_tdes *rv_get_tdes (TRANID trid);
55  static void map_all_tdes (const map_func &func);
56 
57  static void rv_delete_all_tdes_if (const rv_delete_if_func &func);
58  static void rv_delete_tdes (TRANID trid);
59  static void rv_simulate_system_tdes (TRANID trid);
60  static void rv_end_simulation ();
61  static void rv_final ();
62 
63  private:
65 };
66 
67 #endif // _LOG_SYSTEM_TRAN_HPP_
static void rv_delete_all_tdes_if(const rv_delete_if_func &func)
log_tdes * get_tdes()
int TRANID
static void rv_final()
static void init_system_transations()
static void destroy_system_transactions()
static void rv_end_simulation()
static log_tdes * rv_get_or_alloc_tdes(TRANID trid)
static void rv_simulate_system_tdes(TRANID trid)
static void rv_delete_tdes(TRANID trid)
std::function< void(log_tdes &)> map_func
static log_tdes * rv_get_tdes(TRANID trid)
std::function< bool(const log_tdes &)> rv_delete_if_func
static void map_all_tdes(const map_func &func)