#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

Definition at line 83 of file RebuildState.cc.

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 468 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 253 of file RebuildState.cc.

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

◆ getNextFile()

int Fs::Ufs::RebuildState::getNextFile ( sfileno filn_p,
int size 
)
private

◆ isDone()

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

Definition at line 474 of file RebuildState.cc.

◆ rebuildFromDirectory()

◆ rebuildFromSwapLog()

◆ rebuildStep()

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

Member Data Documentation

◆ _done

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

Definition at line 77 of file RebuildState.h.

◆ cbdata

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

Definition at line 80 of file RebuildState.h.

◆ counts

StoreRebuildData Fs::Ufs::RebuildState::counts

Definition at line 59 of file RebuildState.h.

Referenced by RebuildState().

◆ curlvl1

int Fs::Ufs::RebuildState::curlvl1

Definition at line 41 of file RebuildState.h.

◆ curlvl2

int Fs::Ufs::RebuildState::curlvl2

Definition at line 42 of file RebuildState.h.

◆ done

int Fs::Ufs::RebuildState::done

Definition at line 51 of file RebuildState.h.

◆ entry

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

Definition at line 54 of file RebuildState.h.

◆ flags

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

Referenced by RebuildState().

◆ fn

int Fs::Ufs::RebuildState::fn

Definition at line 52 of file RebuildState.h.

◆ fromLog

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

Definition at line 76 of file RebuildState.h.

Referenced by RebuildState().

◆ fullfilename

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

Definition at line 57 of file RebuildState.h.

Referenced by RebuildState().

◆ fullpath

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

Definition at line 56 of file RebuildState.h.

Referenced by RebuildState().

◆ in_dir

int Fs::Ufs::RebuildState::in_dir

Definition at line 50 of file RebuildState.h.

◆ LogParser

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

Definition at line 40 of file RebuildState.h.

Referenced by RebuildState().

◆ n_read

int Fs::Ufs::RebuildState::n_read

Definition at line 38 of file RebuildState.h.

◆ RebuildStep

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

Definition at line 29 of file RebuildState.h.

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

◆ sd

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

Definition at line 37 of file RebuildState.h.

Referenced by RebuildState().

◆ td

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