stub_store_rebuild.cc
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 /* DEBUG: section 84 Helper process maintenance */
10 
11 #include "squid.h"
12 #include "MemBuf.h"
13 #include "store/Controller.h"
14 #include "store_rebuild.h"
15 
16 #include <cstring>
17 
18 #define STUB_API "stub_store_rebuild.cc"
19 #include "tests/STUB.h"
20 
21 void storeRebuildProgress(int sd_index, int total, int sofar) STUB
24 
25 void storeRebuildComplete(StoreRebuildData *)
26 {
28 }
29 
30 bool
31 storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, StoreRebuildData &)
32 {
33  if (fd < 0)
34  return false;
35 
36  assert(buf.hasSpace()); // caller must allocate
37  // this stub simulates reading an empty entry
38  memset(buf.space(), 0, buf.spaceSize());
39  buf.appended(buf.spaceSize());
40  return true;
41 }
42 
bool hasSpace() const
Definition: MemBuf.h:72
static int store_dirs_rebuilding
the number of cache_dirs being rebuilt; TODO: move to Disks::Rebuilding
Definition: Controller.h:90
#define assert(EX)
Definition: assert.h:17
mb_size_t spaceSize() const
Definition: MemBuf.cc:167
void storeRebuildComplete(StoreRebuildData *dc)
bool storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key, StoreRebuildData &stats, uint64_t expectedSize)
parses entry buffer and validates entry metadata; fills e on success
unsigned char cache_key
Store key.
Definition: forward.h:29
void const cache_key StoreRebuildData &counts STUB_RETVAL(false) bool storeRebuildParseEntry(MemBuf &
bool storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key, StoreRebuildData &stats)
checks whether the loaded entry should be kept; updates counters
char * space()
returns buffer after data; does not check space existence
Definition: MemBuf.h:57
static StoreRebuildData counts
#define STUB
macro to stub a void function.
Definition: STUB.h:33
void appended(mb_size_t sz)
updates content size after external append
Definition: MemBuf.cc:244
void const char * buf
Definition: stub_helper.cc:16
Definition: MemBuf.h:23
void const cache_key * key
bool storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, StoreRebuildData &)
loads entry from disk; fills supplied memory buffer on success
void storeRebuildProgress(int sd_index, int total, int sofar) STUB bool storeRebuildKeepEntry(const StoreEntry &tmpe
#define false
Definition: GnuRegex.c:233

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors