0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CellStoreTrailerV1.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, or any later version.
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 
22 #ifndef HYPERTABLE_CELLSTORETRAILERV1_H
23 #define HYPERTABLE_CELLSTORETRAILERV1_H
24 
25 #include <boost/any.hpp>
26 
27 #include "Hypertable/Lib/Schema.h"
28 
29 #include "CellStoreTrailer.h"
30 
31 namespace Hypertable {
32 
34  public:
36  virtual ~CellStoreTrailerV1() { return; }
37  virtual void clear();
38  virtual size_t size() { return 112; }
39  virtual void serialize(uint8_t *buf);
40  virtual void deserialize(const uint8_t *buf);
41  virtual void display(std::ostream &os);
42  virtual void display_multiline(std::ostream &os);
43 
46  int64_t filter_offset;
47  int64_t index_entries;
48  int64_t total_entries;
50  union {
53  };
54  int64_t blocksize;
55  int64_t revision;
56  int64_t timestamp_min;
57  int64_t timestamp_max;
58  int64_t create_time;
59  uint32_t table_id;
60  uint32_t table_generation;
61  uint32_t flags;
62  union {
65  };
66  uint16_t compression_type;
67  uint16_t version;
68 
69  enum Flags { INDEX_64BIT = 0x00000001 };
70 
71  boost::any get(const String& prop) {
72  if (prop == "version") return version;
73  else if (prop == "fix_index_offset") return fix_index_offset;
74  else if (prop == "var_index_offset") return var_index_offset;
75  else if (prop == "filter_offset") return filter_offset;
76  else if (prop == "index_entries") return index_entries;
77  else if (prop == "total_entries") return total_entries;
78  else if (prop == "num_filter_items") return num_filter_items;
79  else if (prop == "filter_false_positive_prob")
81  else if (prop == "blocksize") return blocksize;
82  else if (prop == "revision") return revision;
83  else if (prop == "timestamp_min") return timestamp_min;
84  else if (prop == "timestamp_max") return timestamp_max;
85  else if (prop == "create_time") return create_time;
86  else if (prop == "table_id") return table_id;
87  else if (prop == "table_generation") return table_generation;
88  else if (prop == "flags") return flags;
89  else if (prop == "compression_ratio") return compression_ratio;
90  else if (prop == "compression_type") return compression_type;
91  else if (prop == "bloom_filter_mode") return BLOOM_FILTER_DISABLED;
92  else return boost::any();
93  }
94 
95  };
96 
97 }
98 
99 #endif // HYPERTABLE_CELLSTORETRAILERV1_H
Abstract base class for cell store trailer.
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
virtual void display_multiline(std::ostream &os)
Prints the trailer, one member per line, to the given ostream.
virtual void serialize(uint8_t *buf)
Serializes this trailer to the given buffer;.
Declarations for Schema.
virtual size_t size()
Returns the serialized size of the trailer.
virtual void clear()
Clears the contents of this trailer;.
Hypertable definitions
virtual void deserialize(const uint8_t *buf)
Deserializes the trailer from the given buffer.
virtual void display(std::ostream &os)
Prints the trailer to the given ostream.