RebuildState.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3  *
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.
7  */
8 
9 #ifndef SQUID_FS_UFS_REBUILDSTATE_H
10 #define SQUID_FS_UFS_REBUILDSTATE_H
11 
12 #include "base/RefCount.h"
13 #include "store_rebuild.h"
14 #include "UFSSwapDir.h"
15 #include "UFSSwapLogParser.h"
16 
17 class StoreEntry;
18 
19 namespace Fs
20 {
21 namespace Ufs
22 {
23 
25 {
27 
28 public:
29  static EVH RebuildStep;
30 
32  virtual ~RebuildState();
33 
34  virtual bool error() const;
35  virtual bool isDone() const;
36  virtual StoreEntry *currentItem();
37 
39  int n_read;
40  /* FILE *log;*/
42  int curlvl1;
43  int curlvl2;
44 
45  struct Flags {
48  bool clean;
49  bool init;
50  } flags;
51  int in_dir;
52  int done;
53  int fn;
54 
56  DIR *td;
59 
61 
62 private:
63  void rebuildFromDirectory();
64  void rebuildFromSwapLog();
65  void rebuildStep();
66  void undoAdd();
67  int getNextFile(sfileno *, int *size);
68  StoreEntry *currentEntry() const;
69  void currentEntry(StoreEntry *);
71  bool fromLog;
72  bool _done;
74  void (callback)(void *cbdata);
75  void *cbdata;
76 };
77 
78 } /* namespace Ufs */
79 } /* namespace Fs */
80 
81 #endif /* SQUID_FS_UFS_REBUILDSTATE_H */
82 
void rebuildStep()
load entries from swap.state or files until we run out of entries or time
RebuildState(RefCount< UFSSwapDir > sd)
Definition: RebuildState.cc:32
virtual bool isDone() const
#define MAXPATHLEN
Definition: stdio.h:62
CBDATA_CLASS(RebuildState)
virtual StoreEntry * currentItem()
void rebuildFromDirectory()
process one cache file
char fullfilename[MAXPATHLEN *2]
Definition: RebuildState.h:58
void EVH(void *)
Definition: event.h:19
static EVH RebuildStep
Definition: RebuildState.h:29
StoreRebuildData counts
Definition: RebuildState.h:60
int getNextFile(sfileno *, int *size)
signed_int32_t sfileno
Definition: forward.h:22
void undoAdd()
undo the effects of adding an entry in rebuildFromSwapLog()
void() callback(void *cbdata)
virtual bool error() const
#define dirent_t
Definition: compat_shared.h:71
RefCount< UFSSwapDir > sd
Definition: RebuildState.h:38
Fs::Ufs::UFSSwapLogParser * LogParser
Definition: RebuildState.h:41
char fullpath[MAXPATHLEN]
Definition: RebuildState.h:57
StoreEntry * currentEntry() const
void rebuildFromSwapLog()
process one swap log entry
int size
Definition: ModDevPoll.cc:77
#define false
Definition: GnuRegex.c:233
struct Fs::Ufs::RebuildState::Flags flags

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors