0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CellStoreTrailerV0.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_CELLSTORETRAILERV0_H
23 #define HYPERTABLE_CELLSTORETRAILERV0_H
24 
25 #include "Hypertable/Lib/Schema.h"
26 
27 #include "CellStoreTrailer.h"
28 
29 namespace Hypertable {
30 
32  public:
34  virtual ~CellStoreTrailerV0() { return; }
35  virtual void clear();
36  virtual size_t size() { return 56; }
37  virtual void serialize(uint8_t *buf);
38  virtual void deserialize(const uint8_t *buf);
39  virtual void display(std::ostream &os);
40  virtual void display_multiline(std::ostream &os);
41 
42  uint32_t fix_index_offset;
43  uint32_t var_index_offset;
44  uint32_t filter_offset;
45  uint32_t index_entries;
46  uint32_t total_entries;
47  uint32_t num_filter_items;
48  union {
51  };
52  uint32_t blocksize;
53  int64_t revision;
54  uint32_t table_id;
55  uint32_t table_generation;
56  union {
59  };
60  uint16_t compression_type;
61  uint16_t version;
62 
63  boost::any get(const String& prop) {
64  if (prop == "version") return version;
65  else if (prop == "fix_index_offset") return fix_index_offset;
66  else if (prop == "var_index_offset") return var_index_offset;
67  else if (prop == "filter_offset") return filter_offset;
68  else if (prop == "index_entries") return index_entries;
69  else if (prop == "total_entries") return total_entries;
70  else if (prop == "num_filter_items") return num_filter_items;
71  else if (prop == "filter_false_positive_prob")
73  else if (prop == "blocksize") return blocksize;
74  else if (prop == "revision") return revision;
75  else if (prop == "table_id") return table_id;
76  else if (prop == "table_generation") return table_generation;
77  else if (prop == "compression_ratio") return compression_ratio;
78  else if (prop == "compression_type") return compression_type;
79  else if (prop == "bloom_filter_mode") return BLOOM_FILTER_DISABLED;
80  else return boost::any();
81  }
82 
83  };
84 
85 }
86 
87 #endif // HYPERTABLE_CELLSTORETRAILERV0_H
Abstract base class for cell store trailer.
virtual void serialize(uint8_t *buf)
Serializes this trailer to the given buffer;.
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
Declarations for Schema.
virtual size_t size()
Returns the serialized size of the trailer.
virtual void display_multiline(std::ostream &os)
Prints the trailer, one member per line, to the given ostream.
virtual void clear()
Clears the contents of this trailer;.
Hypertable definitions
virtual void display(std::ostream &os)
Prints the trailer to the given ostream.
virtual void deserialize(const uint8_t *buf)
Deserializes the trailer from the given buffer.