CUBRID Engine
latest
Main Page
Namespaces
Classes
Files
File List
File Members
log_postpone_cache.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
* log_postpone_cache.hpp - log postpone cache module
21
*/
22
23
#ifndef _LOG_POSTPONE_CACHE_HPP_
24
#define _LOG_POSTPONE_CACHE_HPP_
25
26
#include "
log_lsa.hpp
"
27
#include "
log_record.hpp
"
28
#include "
mem_block.hpp
"
29
#include "
storage_common.h
"
30
31
#include <array>
32
33
// forward declarations
34
struct
log_tdes
;
35
struct
log_prior_node
;
36
37
namespace
cubthread
38
{
39
class
entry;
40
}
41
46
class
log_postpone_cache
47
{
48
public
:
49
log_postpone_cache
()
50
: m_redo_data_buf ()
51
, m_redo_data_offset (0)
52
, m_is_redo_data_buf_full (false)
53
, m_cursor (0)
54
, m_cache_entries ()
55
{
56
}
57
58
log_postpone_cache
(
log_postpone_cache
&&other) =
delete
;
59
log_postpone_cache
(
const
log_postpone_cache
&other) =
delete
;
60
61
log_postpone_cache
&operator= (
log_postpone_cache
&&other) =
delete
;
62
log_postpone_cache
&operator= (
const
log_postpone_cache
&other) =
delete
;
63
64
~
log_postpone_cache
() =
default
;
65
66
void
reset ();
67
68
void
add_redo_data (
const
log_prior_node
&node);
69
void
add_lsa (
const
log_lsa
&lsa);
70
bool
do_postpone (
cubthread::entry
&thread_ref,
const
log_lsa
&start_postpone_lsa);
71
72
private
:
73
static
const
std::size_t MAX_CACHE_ENTRIES = 512;
74
static
const
std::size_t REDO_DATA_MAX_SIZE = 100 * 1024;
// 100k
75
static
const
std::size_t BUFFER_RESET_SIZE = 1024;
76
77
class
cache_entry
78
{
79
public
:
80
cache_entry
()
81
: m_lsa ()
82
, m_offset (0)
83
{
84
m_lsa.set_null ();
85
}
86
87
log_lsa
m_lsa
;
88
std::size_t
m_offset
;
89
};
90
91
cubmem::extensible_block
m_redo_data_buf
;
92
std::size_t
m_redo_data_offset
;
93
bool
m_is_redo_data_buf_full
;
94
95
std::size_t
m_cursor
;
96
std::array<cache_entry, MAX_CACHE_ENTRIES>
m_cache_entries
;
97
98
bool
is_full ()
const
;
99
};
100
101
#endif
/* _LOG_POSTPONE_CACHE_HPP_ */
log_postpone_cache::m_redo_data_offset
std::size_t m_redo_data_offset
Definition:
log_postpone_cache.hpp:92
log_tdes
Definition:
log_impl.h:460
log_prior_node
Definition:
log_append.hpp:90
cubthread
Definition:
memory_private_allocator.hpp:30
log_lsa
Definition:
log_lsa.hpp:34
log_postpone_cache::cache_entry::cache_entry
cache_entry()
Definition:
log_postpone_cache.hpp:80
storage_common.h
cubmem::extensible_block
Definition:
mem_block.hpp:159
log_postpone_cache::m_is_redo_data_buf_full
bool m_is_redo_data_buf_full
Definition:
log_postpone_cache.hpp:93
log_postpone_cache::m_cache_entries
std::array< cache_entry, MAX_CACHE_ENTRIES > m_cache_entries
Definition:
log_postpone_cache.hpp:96
log_postpone_cache::m_cursor
std::size_t m_cursor
Definition:
log_postpone_cache.hpp:95
cubthread::entry
Definition:
thread_entry.hpp:189
log_postpone_cache::cache_entry::m_lsa
log_lsa m_lsa
Definition:
log_postpone_cache.hpp:87
log_postpone_cache::log_postpone_cache
log_postpone_cache()
Definition:
log_postpone_cache.hpp:49
log_postpone_cache::cache_entry::m_offset
std::size_t m_offset
Definition:
log_postpone_cache.hpp:88
mem_block.hpp
log_postpone_cache
Definition:
log_postpone_cache.hpp:46
log_postpone_cache::m_redo_data_buf
cubmem::extensible_block m_redo_data_buf
Definition:
log_postpone_cache.hpp:91
log_lsa.hpp
log_postpone_cache::cache_entry
Definition:
log_postpone_cache.hpp:77
log_record.hpp
src
transaction
log_postpone_cache.hpp
Generated by
1.8.11