#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

◆ RebuildState()

◆ ~RebuildState()

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

Member Function Documentation

◆ addIfFresh()

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

◆ callback()

void() Fs::Ufs::RebuildState::callback ( void *  cbdata)
private
Bug:
(callback) should be hidden behind a proper human readable name

◆ CBDATA_CLASS()

Fs::Ufs::RebuildState::CBDATA_CLASS ( RebuildState  )
private

◆ error()

bool Fs::Ufs::RebuildState::error ( ) const
virtual

Definition at line 467 of file RebuildState.cc.

◆ evictStaleAndContinue()

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().

Referenced by addIfFresh(), and rebuildFromSwapLog().

◆ getNextFile()

◆ isDone()

bool Fs::Ufs::RebuildState::isDone ( ) const
virtual

Definition at line 473 of file RebuildState.cc.

References _done.

Referenced by rebuildStep(), and ~RebuildState().

◆ rebuildFromDirectory()

◆ rebuildFromSwapLog()

◆ rebuildStep()

Member Data Documentation

◆ _done

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

Definition at line 77 of file RebuildState.h.

Referenced by isDone(), rebuildFromDirectory(), and rebuildFromSwapLog().

◆ cbdata

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

Definition at line 80 of file RebuildState.h.

◆ counts

StoreRebuildData Fs::Ufs::RebuildState::counts

◆ curlvl1

int Fs::Ufs::RebuildState::curlvl1

Definition at line 41 of file RebuildState.h.

Referenced by getNextFile().

◆ curlvl2

int Fs::Ufs::RebuildState::curlvl2

Definition at line 42 of file RebuildState.h.

Referenced by getNextFile().

◆ done

int Fs::Ufs::RebuildState::done

Definition at line 51 of file RebuildState.h.

Referenced by getNextFile().

◆ entry

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

Definition at line 54 of file RebuildState.h.

Referenced by getNextFile().

◆ flags

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

Referenced by getNextFile(), and RebuildState().

◆ fn

int Fs::Ufs::RebuildState::fn

Definition at line 52 of file RebuildState.h.

Referenced by getNextFile().

◆ fromLog

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

Definition at line 76 of file RebuildState.h.

Referenced by RebuildState(), and rebuildStep().

◆ fullfilename

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

Definition at line 57 of file RebuildState.h.

Referenced by getNextFile(), and RebuildState().

◆ fullpath

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

Definition at line 56 of file RebuildState.h.

Referenced by getNextFile(), and RebuildState().

◆ in_dir

int Fs::Ufs::RebuildState::in_dir

Definition at line 50 of file RebuildState.h.

Referenced by getNextFile().

◆ LogParser

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

Definition at line 40 of file RebuildState.h.

Referenced by rebuildFromSwapLog(), RebuildState(), rebuildStep(), and ~RebuildState().

◆ n_read

int Fs::Ufs::RebuildState::n_read

Definition at line 38 of file RebuildState.h.

Referenced by rebuildFromDirectory(), rebuildFromSwapLog(), and rebuildStep().

◆ RebuildStep

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

Definition at line 29 of file RebuildState.h.

Referenced by Fs::Ufs::UFSSwapDir::rebuild(), and ~RebuildState().

◆ sd

◆ td

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

Definition at line 55 of file RebuildState.h.

Referenced by getNextFile().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors