43 CellStoreTrailerV5::CellStoreTrailerV5() {
44 assert(
sizeof(
float) == 4);
51 void CellStoreTrailerV5::clear() {
55 replaced_files_offset = 0;
59 filter_items_estimate = 0;
60 filter_items_actual = 0;
61 replaced_files_length = 0;
62 replaced_files_entries = 0;
73 table_id = 0xffffffff;
77 compression_ratio = 0.0;
79 key_compression_scheme = 0;
81 bloom_filter_hash_count = 0;
89 void CellStoreTrailerV5::serialize(uint8_t *buf) {
120 encode_i8(&buf, bloom_filter_hash_count);
122 assert(version == 5);
123 assert((buf-base) == (
int)CellStoreTrailerV5::size());
131 void CellStoreTrailerV5::deserialize(
const uint8_t *buf) {
132 HT_TRY(
"deserializing cellstore trailer",
133 size_t remaining = CellStoreTrailerV5::size();
134 fix_index_offset =
decode_i64(&buf, &remaining);
135 var_index_offset =
decode_i64(&buf, &remaining);
137 replaced_files_offset =
decode_i64(&buf, &remaining);
141 filter_items_estimate =
decode_i64(&buf, &remaining);
142 filter_items_actual =
decode_i64(&buf, &remaining);
143 replaced_files_length =
decode_i64(&buf, &remaining);
144 replaced_files_entries =
decode_i32(&buf, &remaining);
149 expiration_time =
decode_i64(&buf, &remaining);
151 expirable_data =
decode_i64(&buf, &remaining);
156 table_generation =
decode_i32(&buf, &remaining);
159 compression_ratio_i32 =
decode_i32(&buf, &remaining);
160 compression_type =
decode_i16(&buf, &remaining);
161 key_compression_scheme =
decode_i16(&buf, &remaining);
162 bloom_filter_mode =
decode_i8(&buf, &remaining);
163 bloom_filter_hash_count =
decode_i8(&buf, &remaining);
171 void CellStoreTrailerV5::display(std::ostream &os) {
172 os <<
"{CellStoreTrailerV5: ";
173 os <<
"fix_index_offset=" << fix_index_offset;
174 os <<
", var_index_offset=" << var_index_offset;
175 os <<
", filter_offset=" << filter_offset;
176 os <<
", replaced_files_offset=" << replaced_files_offset;
177 os <<
", index_entries=" << index_entries;
178 os <<
", total_entries=" << total_entries;
179 os <<
", filter_length = " << filter_length;
180 os <<
", filter_items_estimate = " << filter_items_estimate;
181 os <<
", filter_items_actual = " << filter_items_actual;
182 os <<
", replaced_files_length=" << replaced_files_length;
183 os <<
", replaced_files_entries=" << replaced_files_entries;
184 os <<
", blocksize=" << blocksize;
185 os <<
", revision=" << revision;
186 os <<
", timestamp_min=" << timestamp_min;
187 os <<
", timestamp_max=" << timestamp_max;
188 os <<
", expiration_time=" << expiration_time;
189 os <<
", create_time=" << create_time;
190 os <<
", expirable_data=" << expirable_data;
191 os <<
", delete_count=" << delete_count;
192 os <<
", key_bytes=" << key_bytes;
193 os <<
", value_bytes=" << value_bytes;
194 os <<
", table_id=" << table_id;
195 os <<
", table_generation=" << table_generation;
196 os <<
", flags=" << flags <<
" (";
197 if (flags & INDEX_64BIT)
198 os <<
" 64BIT_INDEX";
199 if (flags & MAJOR_COMPACTION)
200 os <<
" MAJOR_COMPACTION";
202 os <<
", alignment=" << alignment;
203 os <<
", compression_ratio=" << compression_ratio;
204 os <<
", compression_type=" << compression_type;
205 os <<
", key_compression_scheme=" << key_compression_scheme;
207 os <<
", bloom_filter_mode=DISABLED";
209 os <<
", bloom_filter_mode=ROWS";
211 os <<
", bloom_filter_mode=ROWS_COLS";
213 os <<
", bloom_filter_mode=?(" << bloom_filter_mode <<
")";
214 os <<
", bloom_filter_hash_count=" << bloom_filter_hash_count;
215 os <<
", version=" << version <<
"}";
220 void CellStoreTrailerV5::display_multiline(std::ostream &os) {
221 os <<
"[CellStoreTrailerV5]\n";
222 os <<
" fix_index_offset: " << fix_index_offset <<
"\n";
223 os <<
" var_index_offset: " << var_index_offset <<
"\n";
224 os <<
" filter_offset: " << filter_offset <<
"\n";
225 os <<
" replaced_files_offset: " << replaced_files_offset <<
"\n";
226 os <<
" index_entries: " << index_entries <<
"\n";
227 os <<
" total_entries: " << total_entries <<
"\n";
228 os <<
" filter_length: " << filter_length <<
"\n";
229 os <<
" filter_items_estimate: " << filter_items_estimate <<
"\n";
230 os <<
" filter_items_actual: " << filter_items_actual <<
"\n";
231 os <<
" replaced_files_length: " << replaced_files_length <<
"\n";
232 os <<
" replaced_files_entries: " << replaced_files_entries <<
"\n";
233 os <<
" blocksize: " << blocksize <<
"\n";
234 os <<
" revision: " << revision <<
"\n";
235 os <<
" timestamp_min: " << timestamp_min <<
"\n";
236 os <<
" timestamp_max: " << timestamp_max <<
"\n";
237 os <<
" expiration_time: " << expiration_time <<
"\n";
238 os <<
" create_time: " << create_time <<
"\n";
239 os <<
" expirable_data: " << expirable_data <<
"\n";
240 os <<
" delete_count: " << delete_count <<
"\n";
241 os <<
" key_bytes: " << key_bytes <<
"\n";
242 os <<
" value_bytes: " << value_bytes <<
"\n";
243 os <<
" table_id: " << table_id <<
"\n";
244 os <<
" table_generation: " << table_generation <<
"\n";
245 if (flags & INDEX_64BIT)
246 os <<
" flags: 64BIT_INDEX\n";
248 os <<
" flags=" << flags <<
"\n";
249 os <<
" alignment=" << alignment <<
"\n";
250 os <<
" compression_ratio: " << compression_ratio <<
"\n";
251 os <<
" compression_type: " << compression_type <<
"\n";
252 os <<
" key_compression_scheme: " << key_compression_scheme <<
"\n";
254 os <<
" bloom_filter_mode=DISABLED\n";
256 os <<
" bloom_filter_mode=ROWS\n";
258 os <<
" bloom_filter_mode=ROWS_COLS\n";
260 os <<
" bloom_filter_mode=?(" << bloom_filter_mode <<
")\n";
261 os <<
" bloom_filter_hash_count=" << (int)bloom_filter_hash_count <<
"\n";
262 os <<
" version: " << version << std::endl;
Abstract base class for a filesystem.
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
uint8_t decode_i8(const uint8_t **bufp, size_t *remainp)
Decode a 8-bit integer (a byte/character)
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.
static const int64_t TIMESTAMP_NULL
static const int64_t TIMESTAMP_MAX
#define HT_TRY(_s_, _code_)
void encode_i8(uint8_t **bufp, uint8_t val)
Encodes a byte into the given buffer.
#define HT_DIRECT_IO_ALIGNMENT