0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CellStoreTrailerV7.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
26 
27 #ifndef HYPERTABLE_CELLSTORETRAILERV7_H
28 #define HYPERTABLE_CELLSTORETRAILERV7_H
29 
31 
32 #include <boost/any.hpp>
33 
34 namespace Hypertable {
35 
38 
41  public:
43  virtual ~CellStoreTrailerV7() { return; }
44  virtual void clear();
45  virtual size_t size() { return 198; }
46  virtual void serialize(uint8_t *buf);
47  virtual void deserialize(const uint8_t *buf);
48  virtual void display(std::ostream &os);
49  virtual void display_multiline(std::ostream &os);
50 
54  int64_t filter_offset;
56  int64_t index_entries;
57  int64_t total_entries;
58  int64_t filter_length;
63  int64_t blocksize;
64  int64_t revision;
65  int64_t timestamp_min;
66  int64_t timestamp_max;
67  int64_t expiration_time;
68  int64_t create_time;
69  int64_t expirable_data;
70  int64_t delete_count;
71  int64_t key_bytes;
72  int64_t value_bytes;
73  uint32_t table_id;
74  uint32_t table_generation;
75  uint32_t flags;
76  uint32_t alignment;
77  union {
80  };
81  uint16_t compression_type;
86  uint16_t version;
87 
88  enum Flags { INDEX_64BIT = 1,
90  SPLIT = 4
91  };
92 
93  boost::any get(const String& prop) {
94  if (prop == "version") return version;
95  else if (prop == "trailer_checksum") return trailer_checksum;
96  else if (prop == "fix_index_offset") return fix_index_offset;
97  else if (prop == "var_index_offset") return var_index_offset;
98  else if (prop == "filter_offset") return filter_offset;
99  else if (prop == "replaced_files_offset") return replaced_files_offset;
100  else if (prop == "index_entries") return index_entries;
101  else if (prop == "total_entries") return total_entries;
102  else if (prop == "filter_length") return filter_length;
103  else if (prop == "filter_items_estimate") return filter_items_estimate;
104  else if (prop == "filter_items_actual") return filter_items_actual;
105  else if (prop == "replaced_files_length") return replaced_files_length;
106  else if (prop == "replaced_files_entries") return replaced_files_entries;
107  else if (prop == "blocksize") return blocksize;
108  else if (prop == "revision") return revision;
109  else if (prop == "timestamp_min") return timestamp_min;
110  else if (prop == "timestamp_max") return timestamp_max;
111  else if (prop == "expiration_time") return expiration_time;
112  else if (prop == "create_time") return create_time;
113  else if (prop == "expirable_data") return expirable_data;
114  else if (prop == "delete_count") return delete_count;
115  else if (prop == "key_bytes") return key_bytes;
116  else if (prop == "value_bytes") return value_bytes;
117  else if (prop == "table_id") return table_id;
118  else if (prop == "table_generation") return table_generation;
119  else if (prop == "flags") return flags;
120  else if (prop == "alignment") return alignment;
121  else if (prop == "compression_ratio") return compression_ratio;
122  else if (prop == "compression_type") return compression_type;
123  else if (prop == "block_header_version") return block_header_version;
124  else if (prop == "bloom_filter_mode") return bloom_filter_mode;
125  else if (prop == "bloom_filter_hash_count") return bloom_filter_hash_count;
126  else return boost::any();
127  }
128 
129  };
130 
132 
133 }
134 
135 #endif // HYPERTABLE_CELLSTORETRAILERV7_H
virtual void clear()
Clears the contents of this trailer;.
Abstract base class for cell store trailer.
virtual void display(std::ostream &os)
Prints the trailer to the given ostream.
virtual void display_multiline(std::ostream &os)
Prints the trailer, one member per line, to the given ostream.
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
virtual void deserialize(const uint8_t *buf)
Deserializes the trailer from the given buffer.
virtual void serialize(uint8_t *buf)
Serializes this trailer to the given buffer;.
Hypertable definitions
Represents the trailer for CellStore version 7.
virtual size_t size()
Returns the serialized size of the trailer.