libfoedus-core
FOEDUS Core Library
log_id.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_LOG_LOG_ID_HPP_
19 #define FOEDUS_LOG_LOG_ID_HPP_
20 #include <stdint.h>
26 namespace foedus {
27 namespace log {
36 typedef uint16_t LoggerId;
37 
46 typedef uint32_t LogFileOrdinal;
47 
52 struct LogRange {
53  LogFileOrdinal begin_file_ordinal;
54  LogFileOrdinal end_file_ordinal;
55  uint64_t begin_offset;
56  uint64_t end_offset;
57  bool is_empty() const {
58  return begin_file_ordinal == end_file_ordinal && begin_offset == end_offset;
59  }
60 };
61 
62 } // namespace log
63 } // namespace foedus
64 #endif // FOEDUS_LOG_LOG_ID_HPP_
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition: assert_nd.hpp:44
a contiguous range of log entries that might span multiple files.
Definition: log_id.hpp:52
uint64_t end_offset
Definition: log_id.hpp:56
uint32_t LogFileOrdinal
Ordinal of log files (eg "log.0", "log.1").
Definition: log_id.hpp:46
LogFileOrdinal begin_file_ordinal
Definition: log_id.hpp:53
uint64_t begin_offset
Definition: log_id.hpp:55
bool is_empty() const
Definition: log_id.hpp:57
LogFileOrdinal end_file_ordinal
Definition: log_id.hpp:54
uint16_t LoggerId
Typedef for an ID of Logger.
Definition: log_id.hpp:36