41 CellStoreTrailerV0::CellStoreTrailerV0() {
42 assert(
sizeof(
float) == 4);
49 void CellStoreTrailerV0::clear() {
56 filter_false_positive_prob = 0.0;
59 table_id = 0xffffffff;
61 compression_ratio = 0.0;
70 void CellStoreTrailerV0::serialize(uint8_t *buf) {
78 encode_i32(&buf, filter_false_positive_prob_i32);
86 assert((buf-base) == (
int)CellStoreTrailerV0::size());
94 void CellStoreTrailerV0::deserialize(
const uint8_t *buf) {
95 HT_TRY(
"deserializing cellstore trailer",
96 size_t remaining = CellStoreTrailerV0::size();
97 fix_index_offset =
decode_i32(&buf, &remaining);
98 var_index_offset =
decode_i32(&buf, &remaining);
102 num_filter_items =
decode_i32(&buf, &remaining);
103 filter_false_positive_prob_i32 =
decode_i32(&buf, &remaining);
107 table_generation =
decode_i32(&buf, &remaining);
108 compression_ratio_i32 =
decode_i32(&buf, &remaining);
109 compression_type =
decode_i16(&buf, &remaining);
117 void CellStoreTrailerV0::display(std::ostream &os) {
118 os <<
"{CellStoreTrailerV0: ";
119 os <<
"fix_index_offset=" << fix_index_offset;
120 os <<
", var_index_offset=" << var_index_offset;
121 os <<
", filter_offset=" << filter_offset;
122 os <<
", index_entries=" << index_entries;
123 os <<
", total_entries=" << total_entries;
124 os <<
", num_filter_items = " << num_filter_items;
125 os <<
", filter_false_positive_prob = "
126 << filter_false_positive_prob;
127 os <<
", blocksize=" << blocksize;
128 os <<
", revision=" << revision;
129 os <<
", table_id=" << table_id;
130 os <<
", table_generation=" << table_generation;
131 os <<
", compression_ratio=" << compression_ratio;
132 os <<
", compression_type=" << compression_type;
133 os <<
", version=" << version <<
"}";
139 void CellStoreTrailerV0::display_multiline(std::ostream &os) {
140 os <<
"[CellStoreTrailerV0]\n";
141 os <<
" fix_index_offset: " << fix_index_offset <<
"\n";
142 os <<
" var_index_offset: " << var_index_offset <<
"\n";
143 os <<
" filter_offset: " << filter_offset <<
"\n";
144 os <<
" index_entries: " << index_entries <<
"\n";
145 os <<
" total_entries: " << total_entries <<
"\n";
146 os <<
" num_filter_items: " << num_filter_items <<
"\n";
147 os <<
" filter_false_positive_prob: "
148 << filter_false_positive_prob <<
"\n";
149 os <<
" blocksize: " << blocksize <<
"\n";
150 os <<
" revision: " << revision <<
"\n";
151 os <<
" table_id: " << table_id <<
"\n";
152 os <<
" table_generation: " << table_generation <<
"\n";
153 os <<
" compression_ratio: " << compression_ratio <<
"\n";
154 os <<
" compression_type: " << compression_type <<
"\n";
155 os <<
" version: " << version <<
"\n";
uint32_t decode_i32(const uint8_t **bufp, size_t *remainp)
Decode a 32-bit integer in little-endian order.
static const int64_t TIMESTAMP_MIN
uint64_t decode_i64(const uint8_t **bufp, size_t *remainp)
Decode a 64-bit integer in little-endian order.
uint16_t decode_i16(const uint8_t **bufp, size_t *remainp)
Decode a 16-bit integer in little-endian order.
Logging routines and macros.
void encode_i32(uint8_t **bufp, uint32_t val)
Encode a 32-bit integer in little-endian order.
Compatibility Macros for C/C++.
void encode_i16(uint8_t **bufp, uint16_t val)
Encode a 16-bit integer in little-endian order.
void encode_i64(uint8_t **bufp, uint64_t val)
Encode a 64-bit integer in little-endian order.
Functions to serialize/deserialize primitives to/from a memory buffer.
#define HT_TRY(_s_, _code_)