]>
Commit | Line | Data |
---|---|---|
687f5275 | 1 | /* |
4ac4a490 | 2 | * Copyright (C) 1996-2017 The Squid Software Foundation and contributors |
687f5275 | 3 | * |
bbc27441 AJ |
4 | * Squid software is distributed under GPLv2+ license and includes |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
687f5275 | 7 | */ |
001d55dc | 8 | |
bbc27441 AJ |
9 | /* DEBUG: section 20 Store Rebuild Routines */ |
10 | ||
11 | #ifndef SQUID_STORE_REBUILD_H_ | |
12 | #define SQUID_STORE_REBUILD_H_ | |
13 | ||
e1ba42a4 FC |
14 | #include "store_key_md5.h" |
15 | ||
1b2f0924 FC |
16 | class StoreRebuildData |
17 | { | |
211e9ce2 | 18 | public: |
b8053b3f FC |
19 | StoreRebuildData() : |
20 | objcount(0), expcount(0), scancount(0), clashcount(0), | |
21 | dupcount(0), cancelcount(0), invalid(0), badflags(0), | |
22 | bad_log_op(0), zero_object_sz(0) | |
23 | {} | |
24 | ||
211e9ce2 FC |
25 | int objcount; /* # objects successfully reloaded */ |
26 | int expcount; /* # objects expired */ | |
27 | int scancount; /* # entries scanned or read from state file */ | |
28 | int clashcount; /* # swapfile clashes avoided */ | |
29 | int dupcount; /* # duplicates purged */ | |
30 | int cancelcount; /* # SWAP_LOG_DEL objects purged */ | |
31 | int invalid; /* # bad lines */ | |
32 | int badflags; /* # bad e->flags */ | |
33 | int bad_log_op; | |
34 | int zero_object_sz; | |
35 | }; | |
687f5275 | 36 | |
8a648e8d FC |
37 | void storeRebuildStart(void); |
38 | void storeRebuildComplete(StoreRebuildData *); | |
39 | void storeRebuildProgress(int sd_index, int total, int sofar); | |
687f5275 FC |
40 | |
41 | /// loads entry from disk; fills supplied memory buffer on success | |
8a648e8d | 42 | bool storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, StoreRebuildData &counts); |
687f5275 | 43 | /// parses entry buffer and validates entry metadata; fills e on success |
8a648e8d | 44 | bool storeRebuildParseEntry(MemBuf &buf, StoreEntry &e, cache_key *key, StoreRebuildData &counts, uint64_t expectedSize); |
687f5275 | 45 | /// checks whether the loaded entry should be kept; updates counters |
8a648e8d | 46 | bool storeRebuildKeepEntry(const StoreEntry &e, const cache_key *key, StoreRebuildData &counts); |
687f5275 | 47 | |
687f5275 | 48 | #endif /* SQUID_STORE_REBUILD_H_ */ |
f53969cc | 49 |