#include <RebuildState.h>

Collaboration diagram for Fs::Ufs::RebuildState:

Classes

struct  Flags
 

Public Member Functions

 RebuildState (RefCount< UFSSwapDir > sd)
 
virtual ~RebuildState ()
 
virtual bool error () const
 
virtual bool isDone () const
 

Public Attributes

RefCount< UFSSwapDirsd
 
int n_read
 
Fs::Ufs::UFSSwapLogParserLogParser
 
int curlvl1
 
int curlvl2
 
struct Fs::Ufs::RebuildState::Flags flags
 
int in_dir
 
int done
 
int fn
 
dirent_tentry
 
DIR * td
 
char fullpath [MAXPATHLEN]
 
char fullfilename [MAXPATHLEN *2]
 
StoreRebuildData counts
 

Static Public Attributes

static EVH RebuildStep
 

Private Member Functions

 CBDATA_CLASS (RebuildState)
 
void rebuildFromDirectory ()
 process one cache file More...
 
void rebuildFromSwapLog ()
 process one swap log entry More...
 
void rebuildStep ()
 load entries from swap.state or files until we run out of entries or time More...
 
void addIfFresh (const cache_key *key, sfileno file_number, uint64_t swap_file_sz, time_t expires, time_t timestamp, time_t lastref, time_t lastmod, uint32_t refcount, uint16_t flags)
 if the loaded entry metadata is still relevant, indexes the entry More...
 
bool evictStaleAndContinue (const cache_key *candidateKey, const time_t maxRef, int &staleCount)
 
int getNextFile (sfileno *, int *size)
 
void() callback (void *cbdata)
 

Private Attributes

bool fromLog
 
bool _done
 
void * cbdata
 

Detailed Description

Definition at line 24 of file RebuildState.h.

Constructor & Destructor Documentation

Fs::Ufs::RebuildState::~RebuildState ( )
virtual

Definition at line 81 of file RebuildState.cc.

Member Function Documentation

void Fs::Ufs::RebuildState::addIfFresh ( const cache_key key,
sfileno  file_number,
uint64_t  swap_file_sz,
time_t  expires,
time_t  timestamp,
time_t  lastref,
time_t  lastmod,
uint32_t  refcount,
uint16_t  flags 
)
private
void() Fs::Ufs::RebuildState::callback ( void *  cbdata)
private
Bug:
(callback) should be hidden behind a proper human readable name
Fs::Ufs::RebuildState::CBDATA_CLASS ( RebuildState  )
private
bool Fs::Ufs::RebuildState::error ( ) const
virtual

Definition at line 467 of file RebuildState.cc.

bool Fs::Ufs::RebuildState::evictStaleAndContinue ( const cache_key candidateKey,
const time_t  maxRef,
int staleCount 
)
private

Evicts a matching entry if it was last touched before caller's maxRef.

Returns
false only if the matching entry was touched at or after maxRef, indicating that the caller has supplied outdated maxRef.

Definition at line 252 of file RebuildState.cc.

References StoreRebuildData::clashcount, counts, and Store::Root().

int Fs::Ufs::RebuildState::getNextFile ( sfileno filn_p,
int size 
)
private
bool Fs::Ufs::RebuildState::isDone ( ) const
virtual

Definition at line 473 of file RebuildState.cc.

void Fs::Ufs::RebuildState::rebuildStep ( )
private

Member Data Documentation

bool Fs::Ufs::RebuildState::_done
private

Definition at line 77 of file RebuildState.h.

void* Fs::Ufs::RebuildState::cbdata
private

Definition at line 80 of file RebuildState.h.

StoreRebuildData Fs::Ufs::RebuildState::counts

Definition at line 59 of file RebuildState.h.

int Fs::Ufs::RebuildState::curlvl1

Definition at line 41 of file RebuildState.h.

int Fs::Ufs::RebuildState::curlvl2

Definition at line 42 of file RebuildState.h.

int Fs::Ufs::RebuildState::done

Definition at line 51 of file RebuildState.h.

dirent_t* Fs::Ufs::RebuildState::entry

Definition at line 54 of file RebuildState.h.

struct Fs::Ufs::RebuildState::Flags Fs::Ufs::RebuildState::flags

Referenced by RebuildState().

int Fs::Ufs::RebuildState::fn

Definition at line 52 of file RebuildState.h.

bool Fs::Ufs::RebuildState::fromLog
private

Definition at line 76 of file RebuildState.h.

Referenced by RebuildState().

char Fs::Ufs::RebuildState::fullfilename[MAXPATHLEN *2]

Definition at line 57 of file RebuildState.h.

Referenced by RebuildState().

char Fs::Ufs::RebuildState::fullpath[MAXPATHLEN]

Definition at line 56 of file RebuildState.h.

Referenced by RebuildState().

int Fs::Ufs::RebuildState::in_dir

Definition at line 50 of file RebuildState.h.

Fs::Ufs::UFSSwapLogParser* Fs::Ufs::RebuildState::LogParser

Definition at line 40 of file RebuildState.h.

Referenced by RebuildState().

int Fs::Ufs::RebuildState::n_read

Definition at line 38 of file RebuildState.h.

void Fs::Ufs::RebuildState::RebuildStep
static

Definition at line 29 of file RebuildState.h.

Referenced by Fs::Ufs::UFSSwapDir::rebuild().

RefCount<UFSSwapDir> Fs::Ufs::RebuildState::sd

Definition at line 37 of file RebuildState.h.

Referenced by RebuildState().

DIR* Fs::Ufs::RebuildState::td

Definition at line 55 of file RebuildState.h.


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors