Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CacheS Class Reference

#include <CacheS.H>

List of all members.

Public Member Functions

 CacheS (CacheIntf::DebugLevel debug=CacheIntf::None, bool noHits=false) throw ()
int Version () throw ()
CacheIntf::DebugLevel DebugLevel () const throw ()
void FreeVariables (const FP::Tag &pk, VPKFile *&vf) throw ()
CacheIntf::LookupRes Lookup (const FP::Tag &pk, FV::Epoch id, const FP::List &fps, CacheEntry::Index &ci, const VestaVal::T *&value) throw ()
CacheIntf::AddEntryRes AddEntry (FP::Tag *pk, FV::List *names, FP::List *fps, VestaVal::T *value, Model::T model, CacheEntry::Indices *kids, const Text &sourceFunc, CacheEntry::Index &ci) throw ()
void Checkpoint (const FP::Tag &pkgVersion, Model::T model, CacheEntry::Indices *cis, bool done) throw ()
void FlushAll () throw ()
void GetCacheId (CacheId &id) throw ()
void GetCacheState (CacheState &state) throw ()
const FP::TagGetCacheInstance () const throw ()
bool RenewLeases (CacheEntry::Indices *cis) throw ()
bool WeederRecovering (SRPC *srpc, bool doneMarking) throw ()
BitVectorStartMark (int &newLogVer) throw ()
void SetHitFilter (const BitVector &cis) throw ()
BitVectorGetLeases () throw ()
void ResumeLeaseExp () throw ()
int EndMark (const BitVector &cis, const PKPrefix::List &pfxs) throw ()
bool CommitChkpt (const Text &chkptFileName) throw ()

Private Types

typedef Table< FP::Tag, VPKFile
* >::Default 
CacheMap
typedef Table< FP::Tag, VPKFile
* >::Iterator 
CacheMapIter
typedef Table< PKPrefix::T,
VMultiPKFile * >::Default 
MPKMap
typedef Table< PKPrefix::T,
VMultiPKFile * >::Iterator 
MPKIter
typedef Table< FP::Tag, FV::Epoch
>::Default 
NamesEpochTbl
typedef Table< FP::Tag, FV::Epoch
>::Iterator 
NamesEpochIter

Private Member Functions

void RecoverDeleting () throw (FS::Failure)
void SetStableDeleting (bool del) throw ()
void RecoverHitFilter () throw (FS::Failure)
void WriteHitFilter () throw ()
void ClearStableHitFilter () throw ()
void SetStableHitFilter (const BitVector &hf) throw ()
void SetMPKsToWeed (const PKPrefix::List &pfxs) throw ()
void RecoverMPKsToWeed () throw (FS::Failure)
void ResetWeededMPKs () throw ()
void AddToWeededMPKs (int num) throw ()
void RecoverWeededMPKs () throw (VestaLog::Eof, VestaLog::Error)
bool FindVPKFile (const FP::Tag &pk, VPKFile *&vpk) throw ()
PKFile::Epoch PKFileEpoch (const FP::Tag &pk) throw ()
bool GetVPKFile (const FP::Tag &pk, VPKFile *&vpk) throw ()
void VToSCache (const PKPrefix::T &pfx, const BitVector *toDelete=NULL) throw ()
void AddEntryToMPKFile (const PKPrefix::T &pfx, const char *reason) throw ()
void FlushMPKFile (const PKPrefix::T &pfx, const char *reason, bool block=false) throw ()
FlushWorkerNewFlushWorker (bool block=false) throw ()
void RegisterIdleFlushWorker (FlushWorker *fw) throw ()
void DoCheckpoint (const FP::Tag &pkgVersion, Model::T model, CacheEntry::Indices *cis, bool done) throw ()
ChkptWorkerQueueChkpt (const FP::Tag &pkgVersion, Model::T model, CacheEntry::Indices *cis, bool done) throw ()
void FinishChkpt (ChkptWorker *cw) throw ()
void Recover () throw (VestaLog::Error, VestaLog::Eof, FS::Failure)
void LogCacheEntry (const Text &sourceFunc, FP::Tag *pk, PKFile::Epoch pkEpoch, CacheEntry::Index ci, VestaVal::T *value, Model::T model, CacheEntry::Indices *kids, FV::List *names, FP::List *fps) throw ()
void FlushCacheLog () throw (VestaLog::Error)
void CleanCacheLog () throw (VestaLog::Error, VestaLog::Eof, FS::Failure)
CleanWorkerNewCleanWorker () throw ()
void RegisterIdleCleanWorker (CleanWorker *cw) throw ()
void CleanCacheLogEntries (RecoveryReader &rd, std::fstream &ofs, EmptyPKLog::PKEpochTbl &pkEpochTbl, int &oldCnt, int &newCnt) throw (VestaLog::Error, VestaLog::Eof, FS::Failure)
void TryCleanCacheLog (int upper_bound, const char *reason) throw ()
void RecoverEmptyPKLog (bool &empty) throw (VestaLog::Error, VestaLog::Eof)
void RecoverCacheLogEntries (RecoveryReader &rd, EmptyPKLog::PKEpochTbl &pkEpochTbl, bool &empty) throw (VestaLog::Error, VestaLog::Eof)
void RecoverCacheLog () throw (VestaLog::Error, VestaLog::Eof, FS::Failure)
void LogGraphNode (CacheEntry::Index ci, FP::Tag *loc, Model::T model, CacheEntry::Indices *kids, Derived::Indices *refs) throw ()
void FlushGraphLog () throw (VestaLog::Error)
int ChkptGraphLog () throw (FS::Failure, VestaLog::Error)
void AbortGraphLogChkpt () throw (VestaLog::Error)
void RecoverGraphLog () throw (VestaLog::Error, VestaLog::Eof, FS::Failure)
void LogCI (Intvl::Op op, CacheEntry::Index ci) throw ()
void FlushUsedCIs () throw (VestaLog::Error)
Intvl::ListFlushUsedCIsList (Intvl::List *vLog, int &numFlushed) throw (VestaLog::Error)
void ChkptUsedCIs (const BitVector &del) throw (VestaLog::Error, FS::Failure)
void RecoverCILog () throw (VestaLog::Error, VestaLog::Eof, FS::Failure)
 CacheS (const CacheS &)

Private Attributes

CacheIntf::DebugLevel debug
bool noHits
Basics::mutex mu
Leasesleases
CacheMapcache
MPKMapmpkTbl
BitVector usedCIs
EmptyPKLogemptyPKLog
bool deleting
SRPCweederSRPC
Basics::cond doDeleting
Basics::cond notDeleting
BitVector hitFilter
PKPrefix::List mpksToWeed
int nextMPKToWeed
int graphLogChkptVer
VestaLogweededMPKsLog
FlushQueuecacheLogFlushQ
CacheLog::EntryvCacheLog
CacheLog::EntryvCacheLogTail
CacheLog::EntryvCacheAvail
FlushQueuegraphLogFlushQ
GraphLog::NodevGraphLog
GraphLog::NodevGraphLogTail
GraphLog::NodevGraphNodeAvail
int vGraphNodeAvailLen
FlushQueueciLogFlushQ
Intvl::ListvCILog
Intvl::ListvCIAvail
NamesEpochTbl evictedNamesEpochs
int freeMPKFileEpoch
time_t startTime
int entryCnt
MethodCnts cnt
EntryState state
FP::Tag instanceFp
FlushWorkerListidleFlushWorkers
Basics::cond availFlushWorker
int numActiveFlushWorkers
Basics::cond allFlushWorkersDone
Basics::thread chkptTh
Basics::mutex chkptMu
ChkptWorkeravailChkptWorkers
ChkptWorkerqueuedChkptWorkers
Basics::cond waitingChkptWorker
Basics::mutex cacheLogMu
int cacheLogLen
CleanWorkeridleCleanWorker
Basics::cond availCleanWorker
VestaLogcacheLog
Basics::mutex graphLogMu
VestaLoggraphLog
Basics::mutex ciLogMu
VestaLogciLog

Friends

class ChkptWorker
void * CacheS_DoFreeMPKFiles (void *arg) throw ()
void * CacheS_FlushWorker (void *arg) throw ()
void * CacheS_DoDeletions (void *cacheS) throw ()
void * CacheS_CleanCacheLogWorker (void *arg) throw ()

Classes

struct  FlushWorkerList


Member Typedef Documentation

typedef Table<FP::Tag,VPKFile*>::Default CacheS::CacheMap [private]
 

Definition at line 249 of file CacheS.H.

typedef Table<FP::Tag,VPKFile*>::Iterator CacheS::CacheMapIter [private]
 

Definition at line 250 of file CacheS.H.

typedef Table<PKPrefix::T,VMultiPKFile*>::Iterator CacheS::MPKIter [private]
 

Definition at line 252 of file CacheS.H.

typedef Table<PKPrefix::T,VMultiPKFile*>::Default CacheS::MPKMap [private]
 

Definition at line 251 of file CacheS.H.

typedef Table<FP::Tag,FV::Epoch>::Iterator CacheS::NamesEpochIter [private]
 

Definition at line 254 of file CacheS.H.

typedef Table<FP::Tag,FV::Epoch>::Default CacheS::NamesEpochTbl [private]
 

Definition at line 253 of file CacheS.H.


Constructor & Destructor Documentation

CacheS::CacheS CacheIntf::DebugLevel  debug = CacheIntf::None,
bool  noHits = false
throw ()
 

Definition at line 79 of file CacheS.C.

References CacheS_DoDeletions(), CacheS_DoFreeMPKFiles(), Config_FlushWorkerCnt, Config_LeaseTimeoutSecs, Basics::thread::fork_and_detach(), CacheIntf::LeaseExp, Debug::Lock(), Basics::mutex::lock(), ChkptWorker::MainLoop(), VestaLog::Error::msg, mu, NEW_ARRAY, NEW_CONSTR, NEW_PTRFREE, VestaLog::Error::r, Recover(), CacheIntf::StatusMsgs, Debug::Timestamp(), UniqueId(), Debug::Unlock(), and Basics::mutex::unlock().

CacheS::CacheS const CacheS  )  [private]
 


Member Function Documentation

void CacheS::AbortGraphLogChkpt  )  throw (VestaLog::Error) [private]
 

Definition at line 2770 of file CacheS.C.

References VestaLog::checkpointAbort(), graphLog, graphLogMu, Basics::mutex::lock(), and Basics::mutex::unlock().

CacheIntf::AddEntryRes CacheS::AddEntry FP::Tag pk,
FV::List names,
FP::List fps,
VestaVal::T value,
Model::T  model,
CacheEntry::Indices kids,
const Text sourceFunc,
CacheEntry::Index ci
throw ()
 

Definition at line 387 of file CacheS.C.

References Intvl::Add, VPKFile::AddEntry(), CacheIntf::BadAddEntryArgs, CacheIntf::EntryAdded, VPKFile::Evicted(), Basics::mutex::lock(), VPKFile::mu, mu, NEW_CONSTR, VPKFile::NewEntry(), CacheIntf::NoLease, SPKFile::PKEpoch(), Basics::mutex::unlock(), VPKFile::UpdateFreeEpoch(), and CE::T::Value().

void CacheS::AddEntryToMPKFile const PKPrefix::T pfx,
const char *  reason
throw () [private]
 

Definition at line 495 of file CacheS.C.

References VMultiPKFile::IncEntries(), VMultiPKFile::IsFull(), Basics::mutex::lock(), mu, Basics::mutex::unlock(), and VMultiPKFile::UpdateEpoch().

void CacheS::AddToWeededMPKs int  num  )  throw () [private]
 

Definition at line 2052 of file CacheS.C.

Referenced by CacheS_DoDeletions().

void CacheS::Checkpoint const FP::Tag pkgVersion,
Model::T  model,
CacheEntry::Indices cis,
bool  done
throw ()
 

Definition at line 1270 of file CacheS.C.

References ChkptWorker::WaitUntilDone().

int CacheS::ChkptGraphLog  )  throw (FS::Failure, VestaLog::Error) [private]
 

Definition at line 2755 of file CacheS.C.

References VestaLog::checkpointBegin(), FS::Close(), graphLog, graphLogMu, Basics::mutex::lock(), VestaLog::logVersion(), and Basics::mutex::unlock().

void CacheS::ChkptUsedCIs const BitVector del  )  throw (VestaLog::Error, FS::Failure) [private]
 

Definition at line 2936 of file CacheS.C.

References FS::Close(), Basics::mutex::lock(), Debug::Lock(), CacheIntf::LogFlush, mu, NEW_CONSTR, Intvl::List::next, Debug::Timestamp(), Basics::mutex::unlock(), Debug::Unlock(), and BitVector::Write().

Referenced by CacheS_DoDeletions().

void CacheS::CleanCacheLog  )  throw (VestaLog::Error, VestaLog::Eof, FS::Failure) [private]
 

Definition at line 2273 of file CacheS.C.

References Text::chars(), FS::Close(), VestaLogSeq::Close(), Config_CacheLogPath, Debug::Lock(), CacheIntf::LogFlush, VestaLogSeq::Next(), VestaLogSeq::Open(), Debug::Timestamp(), and Debug::Unlock().

Referenced by CacheS_CleanCacheLogWorker().

void CacheS::CleanCacheLogEntries RecoveryReader rd,
std::fstream &  ofs,
EmptyPKLog::PKEpochTbl pkEpochTbl,
int &  oldCnt,
int &  newCnt
throw (VestaLog::Error, VestaLog::Eof, FS::Failure) [private]
 

Definition at line 2237 of file CacheS.C.

References Basics::mutex::lock(), mu, CacheLog::Entry::pk, CacheLog::Entry::pkEpoch, Basics::mutex::unlock(), and CacheLog::Entry::Write().

void CacheS::ClearStableHitFilter  )  throw () [private]
 

Definition at line 1921 of file CacheS.C.

References hitFilter, BitVector::ResetAll(), and WriteHitFilter().

Referenced by CacheS_DoDeletions().

bool CacheS::CommitChkpt const Text chkptFileName  )  throw ()
 

Definition at line 1058 of file CacheS.C.

References Text::cchars(), Config_GraphLogPath, FS::Delete(), FS::Exists(), Text::Length(), Basics::mutex::lock(), VestaLog::Error::msg, mu, VestaLog::Error::r, Text::Sub(), and Basics::mutex::unlock().

CacheIntf::DebugLevel CacheS::DebugLevel  )  const throw () [inline]
 

Definition at line 84 of file CacheS.H.

References debug.

void CacheS::DoCheckpoint const FP::Tag pkgVersion,
Model::T  model,
CacheEntry::Indices cis,
bool  done
throw () [private]
 

Definition at line 1376 of file CacheS.C.

References GraphLog::Root::Debug(), GraphLog::Root::DebugFull(), Debug::Lock(), Basics::mutex::lock(), GraphLog::Root::Log(), CacheIntf::LogFlush, VestaLog::Error::msg, mu, VestaLog::Error::r, Debug::Timestamp(), Debug::Unlock(), and Basics::mutex::unlock().

Referenced by ChkptWorker::MainLoop().

int CacheS::EndMark const BitVector cis,
const PKPrefix::List pfxs
throw ()
 

Definition at line 998 of file CacheS.C.

References Basics::mutex::lock(), VestaLog::Error::msg, mu, VestaLog::Error::r, and Basics::mutex::unlock().

bool CacheS::FindVPKFile const FP::Tag pk,
VPKFile *&  vpk
throw () [private]
 

Definition at line 189 of file CacheS.C.

References NEW_CONSTR.

void CacheS::FinishChkpt ChkptWorker cw  )  throw () [private]
 

Definition at line 1318 of file CacheS.C.

Referenced by ChkptWorker::MainLoop().

void CacheS::FlushAll  )  throw ()
 

Definition at line 1479 of file CacheS.C.

References allFlushWorkersDone, cacheLogMu, FlushMPKFile(), Basics::mutex::lock(), mpkTbl, mu, NEW_PTRFREE_ARRAY, Table< K, V >::Iterator::Next(), Table< K, V >::Default::Size(), TryCleanCacheLog(), Basics::mutex::unlock(), and Basics::cond::wait().

void CacheS::FlushCacheLog  )  throw (VestaLog::Error) [private]
 

Definition at line 2148 of file CacheS.C.

References Config_MaxCacheLogCnt, CacheLog::Entry::Debug(), Debug::Lock(), Basics::mutex::lock(), CacheLog::Entry::Log(), CacheIntf::LogFlush, CacheIntf::LogFlushEntries, mu, CacheLog::Entry::next, CacheLog::Entry::Reset(), Debug::Timestamp(), Debug::Unlock(), and Basics::mutex::unlock().

void CacheS::FlushGraphLog  )  throw (VestaLog::Error) [private]
 

Definition at line 2672 of file CacheS.C.

References Debug::Lock(), Basics::mutex::lock(), CacheIntf::LogFlush, CacheIntf::LogFlushEntries, mu, GraphLog::Node::next, Debug::Timestamp(), Debug::Unlock(), and Basics::mutex::unlock().

void CacheS::FlushMPKFile const PKPrefix::T pfx,
const char *  reason,
bool  block = false
throw () [private]
 

Definition at line 512 of file CacheS.C.

References FlushWorker::Start().

Referenced by CacheS_DoFreeMPKFiles(), and FlushAll().

void CacheS::FlushUsedCIs  )  throw (VestaLog::Error) [private]
 

Definition at line 2852 of file CacheS.C.

References ciLogFlushQ, ciLogMu, FlushQueue::Dequeue(), FlushQueue::Enqueue(), FlushUsedCIsList(), Debug::Lock(), Basics::mutex::lock(), CacheIntf::LogFlush, mu, Intvl::List::next, Debug::Timestamp(), Debug::Unlock(), Basics::mutex::unlock(), vCIAvail, and vCILog.

Intvl::List * CacheS::FlushUsedCIsList Intvl::List vLog,
int &  numFlushed
throw (VestaLog::Error) [private]
 

Definition at line 2907 of file CacheS.C.

References Intvl::T::Debug(), Intvl::List::i, Debug::Lock(), Intvl::T::Log(), CacheIntf::LogFlushEntries, Intvl::List::next, and Debug::Unlock().

Referenced by FlushUsedCIs().

void CacheS::FreeVariables const FP::Tag pk,
VPKFile *&  vf
throw ()
 

Definition at line 244 of file CacheS.C.

References Basics::mutex::lock(), mu, and Basics::mutex::unlock().

void CacheS::GetCacheId CacheId id  )  throw ()
 

Definition at line 1527 of file CacheS.C.

References Config_Port, Config_SCachePath, Basics::mutex::lock(), mu, Basics::mutex::unlock(), VCacheVersion, and CacheIntf::Version.

const FP::Tag & CacheS::GetCacheInstance  )  const throw ()
 

Definition at line 1567 of file CacheS.C.

References instanceFp.

void CacheS::GetCacheState CacheState state  )  throw ()
 

Definition at line 1542 of file CacheS.C.

References OS::GetProcessSize(), Basics::mutex::lock(), mu, and Basics::mutex::unlock().

BitVector * CacheS::GetLeases  )  throw ()
 

Definition at line 976 of file CacheS.C.

References leases, Leases::LeaseSet(), Basics::mutex::lock(), mu, and Basics::mutex::unlock().

bool CacheS::GetVPKFile const FP::Tag pk,
VPKFile *&  vpk
throw () [private]
 

Definition at line 221 of file CacheS.C.

References NEW_CONSTR, and VMultiPKFile::Put().

void CacheS::LogCacheEntry const Text sourceFunc,
FP::Tag pk,
PKFile::Epoch  pkEpoch,
CacheEntry::Index  ci,
VestaVal::T value,
Model::T  model,
CacheEntry::Indices kids,
FV::List names,
FP::List fps
throw () [private]
 

Definition at line 2117 of file CacheS.C.

References CacheLog::Entry::Init(), NEW_CONSTR, and CacheLog::Entry::next.

void CacheS::LogCI Intvl::Op  op,
CacheEntry::Index  ci
throw () [private]
 

Definition at line 2828 of file CacheS.C.

References Intvl::T::hi, Intvl::List::i, Intvl::T::lo, NEW, Intvl::List::next, and Intvl::T::op.

void CacheS::LogGraphNode CacheEntry::Index  ci,
FP::Tag loc,
Model::T  model,
CacheEntry::Indices kids,
Derived::Indices refs
throw () [private]
 

Definition at line 2647 of file CacheS.C.

References GraphLog::Node::Init(), GraphLog::Entry::kind, NEW_CONSTR, GraphLog::Node::next, and GraphLog::NodeKind.

CacheIntf::LookupRes CacheS::Lookup const FP::Tag pk,
FV::Epoch  id,
const FP::List fps,
CacheEntry::Index ci,
const VestaVal::T *&  value
throw ()
 

Definition at line 287 of file CacheS.C.

References CacheIntf::DiskHits, VPKFile::Evicted(), CacheIntf::Hit, Debug::Lock(), Basics::mutex::lock(), VPKFile::Lookup(), CacheIntf::Miss, VPKFile::mu, mu, Debug::Timestamp(), Debug::Unlock(), Basics::mutex::unlock(), and VPKFile::UpdateFreeEpoch().

CleanWorker * CacheS::NewCleanWorker  )  throw () [private]
 

Definition at line 2393 of file CacheS.C.

References availCleanWorker, idleCleanWorker, and Basics::cond::wait().

FlushWorker * CacheS::NewFlushWorker bool  block = false  )  throw () [private]
 

Definition at line 520 of file CacheS.C.

References NEW_CONSTR.

PKFile::Epoch CacheS::PKFileEpoch const FP::Tag pk  )  throw () [private]
 

Definition at line 213 of file CacheS.C.

References SPKFile::PKEpoch().

ChkptWorker * CacheS::QueueChkpt const FP::Tag pkgVersion,
Model::T  model,
CacheEntry::Indices cis,
bool  done
throw () [private]
 

Definition at line 1284 of file CacheS.C.

References ChkptWorker::Init(), NEW_CONSTR, and ChkptWorker::next.

void CacheS::Recover  )  throw (VestaLog::Error, VestaLog::Eof, FS::Failure) [private]
 

Definition at line 1774 of file CacheS.C.

References deleting, Basics::mutex::lock(), mu, RecoverCacheLog(), RecoverCILog(), RecoverDeleting(), RecoverGraphLog(), RecoverHitFilter(), RecoverMPKsToWeed(), RecoverWeededMPKs(), and Basics::mutex::unlock().

void CacheS::RecoverCacheLog  )  throw (VestaLog::Error, VestaLog::Eof, FS::Failure) [private]
 

Definition at line 2562 of file CacheS.C.

References cacheLog, cacheLogFlushQ, cacheLogMu, Text::chars(), FS::Close(), Config_CacheLogPath, emptyPKLog, EmptyPKLog::EndRecovery(), Basics::mutex::lock(), Debug::Lock(), VestaLog::loggingBegin(), CacheIntf::LogRecover, mu, NEW, NEW_CONSTR, VestaLog::open(), VestaLog::openCheckpoint(), RecoverCacheLogEntries(), RecoverEmptyPKLog(), Debug::Timestamp(), Basics::mutex::unlock(), Debug::Unlock(), vCacheAvail, vCacheLog, and vCacheLogTail.

Referenced by Recover().

void CacheS::RecoverCacheLogEntries RecoveryReader rd,
EmptyPKLog::PKEpochTbl pkEpochTbl,
bool &  empty
throw (VestaLog::Error, VestaLog::Eof) [private]
 

Definition at line 2447 of file CacheS.C.

References VPKFile::AddEntry(), CacheLog::Entry::ci, CacheLog::Entry::Debug(), CacheLog::Entry::fps, CacheLog::Entry::kids, VestaVal::T::len, Debug::Lock(), Basics::mutex::lock(), CacheIntf::LogRecover, CacheLog::Entry::model, VPKFile::mu, mu, CacheLog::Entry::names, NEW_CONSTR, VPKFile::NewEntry(), CacheLog::Entry::pk, CacheLog::Entry::pkEpoch, CacheLog::Entry::sourceFunc, Debug::Timestamp(), Debug::Unlock(), Basics::mutex::unlock(), VPKFile::UpdateFreeEpoch(), and CacheLog::Entry::value.

Referenced by RecoverCacheLog().

void CacheS::RecoverCILog  )  throw (VestaLog::Error, VestaLog::Eof, FS::Failure) [private]
 

Definition at line 3041 of file CacheS.C.

References Intvl::Add, BitVector::Cardinality(), Text::chars(), ciLog, ciLogFlushQ, ciLogMu, FS::Close(), Config_CILogPath, Intvl::T::Debug(), entryCnt, RecoveryReader::eof(), Intvl::T::hi, Intvl::T::lo, Basics::mutex::lock(), Debug::Lock(), VestaLog::loggingBegin(), CacheIntf::LogRecover, mu, NEW, NEW_CONSTR, Intvl::T::op, VestaLog::open(), VestaLog::openCheckpoint(), BitVector::Recover(), BitVector::ResetAll(), Debug::Timestamp(), Basics::mutex::unlock(), Debug::Unlock(), usedCIs, vCIAvail, vCILog, and BitVector::WriteInterval().

Referenced by Recover().

void CacheS::RecoverDeleting  )  throw (FS::Failure) [private]
 

Definition at line 1796 of file CacheS.C.

References BoolName, FS::Close(), Config_DeletingFile, deleting, Debug::Lock(), Basics::mutex::lock(), CacheIntf::LogRecover, mu, FS::OpenReadOnly(), FS::Read(), Debug::Timestamp(), Debug::Unlock(), and Basics::mutex::unlock().

Referenced by Recover().

void CacheS::RecoverEmptyPKLog bool &  empty  )  throw (VestaLog::Error, VestaLog::Eof) [private]
 

Definition at line 2426 of file CacheS.C.

References Debug::Lock(), CacheIntf::LogRecover, and Debug::Unlock().

Referenced by RecoverCacheLog().

void CacheS::RecoverGraphLog  )  throw (VestaLog::Error, VestaLog::Eof, FS::Failure) [private]
 

Definition at line 2780 of file CacheS.C.

References Text::chars(), VestaLog::checkpointResume(), FS::Close(), Config_GraphLogPath, VestaLog::get(), graphLog, graphLogChkptVer, graphLogFlushQ, graphLogMu, Basics::mutex::lock(), VestaLog::loggingBegin(), VestaLog::logVersion(), mu, NEW, NEW_CONSTR, VestaLog::open(), Basics::mutex::unlock(), vGraphLog, vGraphLogTail, vGraphNodeAvail, and vGraphNodeAvailLen.

Referenced by Recover().

void CacheS::RecoverHitFilter  )  throw (FS::Failure) [private]
 

Definition at line 1859 of file CacheS.C.

References FS::Close(), Config_HitFilterFile, hitFilter, Debug::Lock(), Basics::mutex::lock(), CacheIntf::LogRecover, mu, FS::OpenReadOnly(), BitVector::Read(), Debug::Timestamp(), Debug::Unlock(), and Basics::mutex::unlock().

Referenced by Recover().

void CacheS::RecoverMPKsToWeed  )  throw (FS::Failure) [private]
 

Definition at line 1959 of file CacheS.C.

References FS::Close(), Config_MPKsToWeedFile, PKPrefix::List::len, Debug::Lock(), Basics::mutex::lock(), CacheIntf::LogRecover, mpksToWeed, mu, FS::OpenReadOnly(), PKPrefix::List::pfx, PKPrefix::List::Read(), Debug::Timestamp(), Debug::Unlock(), and Basics::mutex::unlock().

Referenced by Recover().

void CacheS::RecoverWeededMPKs  )  throw (VestaLog::Eof, VestaLog::Error) [private]
 

Definition at line 2073 of file CacheS.C.

References Text::chars(), Config_WeededLogPath, Debug::Lock(), Basics::mutex::lock(), VestaLog::loggingBegin(), CacheIntf::LogRecover, mu, NEW, nextMPKToWeed, VestaLog::open(), VestaLog::readAll(), Debug::Timestamp(), Debug::Unlock(), Basics::mutex::unlock(), and weededMPKsLog.

Referenced by Recover().

void CacheS::RegisterIdleCleanWorker CleanWorker cw  )  throw () [private]
 

Definition at line 2405 of file CacheS.C.

Referenced by CacheS_CleanCacheLogWorker().

void CacheS::RegisterIdleFlushWorker FlushWorker fw  )  throw () [private]
 

Definition at line 540 of file CacheS.C.

References Basics::mutex::lock(), mu, NEW, CacheS::FlushWorkerList::next, Basics::mutex::unlock(), and CacheS::FlushWorkerList::worker.

Referenced by CacheS_FlushWorker().

bool CacheS::RenewLeases CacheEntry::Indices cis  )  throw ()
 

Definition at line 1576 of file CacheS.C.

References Basics::mutex::lock(), mu, and Basics::mutex::unlock().

void CacheS::ResetWeededMPKs  )  throw () [private]
 

Definition at line 2021 of file CacheS.C.

References VestaLog::checkpointBegin(), VestaLog::checkpointEnd(), FS::Close(), VestaLog::Error::msg, nextMPKToWeed, VestaLog::prune(), VestaLog::Error::r, and weededMPKsLog.

void CacheS::ResumeLeaseExp  )  throw ()
 

Definition at line 988 of file CacheS.C.

References Leases::EnableExpiration(), leases, Basics::mutex::lock(), mu, and Basics::mutex::unlock().

void CacheS::SetHitFilter const BitVector cis  )  throw ()
 

Definition at line 965 of file CacheS.C.

References Basics::mutex::lock(), mu, and Basics::mutex::unlock().

void CacheS::SetMPKsToWeed const PKPrefix::List pfxs  )  throw () [private]
 

Definition at line 1935 of file CacheS.C.

References Text::chars(), FS::Close(), Config_MPKsToWeedFile, and AtomicFile::open().

void CacheS::SetStableDeleting bool  del  )  throw () [private]
 

Definition at line 1835 of file CacheS.C.

References Text::chars(), FS::Close(), Config_DeletingFile, AtomicFile::open(), and FS::Write().

Referenced by CacheS_DoDeletions().

void CacheS::SetStableHitFilter const BitVector hf  )  throw () [private]
 

Definition at line 1928 of file CacheS.C.

BitVector * CacheS::StartMark int &  newLogVer  )  throw ()
 

Definition at line 913 of file CacheS.C.

References Basics::mutex::lock(), VestaLog::Error::msg, mu, NEW_CONSTR, VestaLog::Error::r, and Basics::mutex::unlock().

void CacheS::TryCleanCacheLog int  upper_bound,
const char *  reason
throw () [private]
 

Definition at line 2415 of file CacheS.C.

References CacheWorker::Start().

Referenced by CacheS_DoDeletions(), CacheS_DoFreeMPKFiles(), and FlushAll().

int CacheS::Version  )  throw () [inline]
 

Definition at line 80 of file CacheS.H.

References CacheIntf::Version.

void CacheS::VToSCache const PKPrefix::T pfx,
const BitVector toDelete = NULL
throw () [private]
 

Definition at line 1599 of file CacheS.C.

References VMultiPKFile::ChkptForWrite(), FS::Close(), Debug::Lock(), Basics::mutex::lock(), VMultiPKFile::LockForWrite(), CacheIntf::MPKFileFlush, VestaLog::Error::msg, mu, NEW_CONSTR, SMultiPKFileRep::Header::pkSeq, VMultiPKFile::Prefix(), SMultiPKFile::PrepareForRewrite(), VMultiPKFile::Put(), VestaLog::Error::r, VMultiPKFile::ReleaseWriteLock(), Debug::Timestamp(), VMultiPKFile::ToSCache(), Debug::Unlock(), and Basics::mutex::unlock().

Referenced by CacheS_DoDeletions(), and CacheS_FlushWorker().

bool CacheS::WeederRecovering SRPC srpc,
bool  doneMarking
throw ()
 

Definition at line 882 of file CacheS.C.

References Basics::mutex::lock(), mu, and Basics::mutex::unlock().

void CacheS::WriteHitFilter  )  throw () [private]
 

Definition at line 1899 of file CacheS.C.

References Text::chars(), FS::Close(), Config_HitFilterFile, hitFilter, AtomicFile::open(), and BitVector::Write().

Referenced by ClearStableHitFilter().


Friends And Related Function Documentation

void* CacheS_CleanCacheLogWorker void *  arg  )  throw () [friend]
 

Definition at line 2348 of file CacheS.C.

void* CacheS_DoDeletions void *  cacheS  )  throw () [friend]
 

Definition at line 1178 of file CacheS.C.

void* CacheS_DoFreeMPKFiles void *  arg  )  throw () [friend]
 

Definition at line 556 of file CacheS.C.

void* CacheS_FlushWorker void *  arg  )  throw () [friend]
 

Definition at line 3165 of file CacheS.C.

friend class ChkptWorker [friend]
 

Definition at line 504 of file CacheS.H.


Member Data Documentation

Basics::cond CacheS::allFlushWorkersDone [private]
 

Definition at line 317 of file CacheS.H.

Referenced by CacheS_DoFreeMPKFiles(), and FlushAll().

ChkptWorker* CacheS::availChkptWorkers [private]
 

Definition at line 322 of file CacheS.H.

Referenced by ChkptWorker::MainLoop().

Basics::cond CacheS::availCleanWorker [private]
 

Definition at line 348 of file CacheS.H.

Referenced by NewCleanWorker().

Basics::cond CacheS::availFlushWorker [private]
 

Definition at line 315 of file CacheS.H.

CacheMap* CacheS::cache [private]
 

Definition at line 265 of file CacheS.H.

Referenced by CacheS_DoFreeMPKFiles().

VestaLog* CacheS::cacheLog [private]
 

Definition at line 349 of file CacheS.H.

Referenced by RecoverCacheLog().

FlushQueue* CacheS::cacheLogFlushQ [private]
 

Definition at line 278 of file CacheS.H.

Referenced by RecoverCacheLog().

int CacheS::cacheLogLen [private]
 

Definition at line 346 of file CacheS.H.

Basics::mutex CacheS::cacheLogMu [private]
 

Definition at line 345 of file CacheS.H.

Referenced by CacheS_DoDeletions(), CacheS_DoFreeMPKFiles(), FlushAll(), and RecoverCacheLog().

Basics::mutex CacheS::chkptMu [private]
 

Definition at line 321 of file CacheS.H.

Referenced by ChkptWorker::MainLoop().

Basics::thread CacheS::chkptTh [private]
 

Definition at line 320 of file CacheS.H.

VestaLog* CacheS::ciLog [private]
 

Definition at line 353 of file CacheS.H.

Referenced by RecoverCILog().

FlushQueue* CacheS::ciLogFlushQ [private]
 

Definition at line 287 of file CacheS.H.

Referenced by FlushUsedCIs(), and RecoverCILog().

Basics::mutex CacheS::ciLogMu [private]
 

Definition at line 352 of file CacheS.H.

Referenced by FlushUsedCIs(), and RecoverCILog().

MethodCnts CacheS::cnt [private]
 

Definition at line 301 of file CacheS.H.

Referenced by CacheS_DoFreeMPKFiles().

CacheIntf::DebugLevel CacheS::debug [private]
 

Definition at line 259 of file CacheS.H.

Referenced by CacheS_DoDeletions(), CacheS_DoFreeMPKFiles(), and DebugLevel().

bool CacheS::deleting [private]
 

Definition at line 269 of file CacheS.H.

Referenced by CacheS_DoDeletions(), Recover(), and RecoverDeleting().

Basics::cond CacheS::doDeleting [private]
 

Definition at line 271 of file CacheS.H.

Referenced by CacheS_DoDeletions().

EmptyPKLog* CacheS::emptyPKLog [private]
 

Definition at line 268 of file CacheS.H.

Referenced by RecoverCacheLog().

int CacheS::entryCnt [private]
 

Definition at line 300 of file CacheS.H.

Referenced by RecoverCILog().

NamesEpochTbl CacheS::evictedNamesEpochs [private]
 

Definition at line 289 of file CacheS.H.

Referenced by CacheS_DoFreeMPKFiles().

int CacheS::freeMPKFileEpoch [private]
 

Definition at line 296 of file CacheS.H.

Referenced by CacheS_DoFreeMPKFiles().

VestaLog* CacheS::graphLog [private]
 

Definition at line 351 of file CacheS.H.

Referenced by AbortGraphLogChkpt(), ChkptGraphLog(), and RecoverGraphLog().

int CacheS::graphLogChkptVer [private]
 

Definition at line 276 of file CacheS.H.

Referenced by RecoverGraphLog().

FlushQueue* CacheS::graphLogFlushQ [private]
 

Definition at line 282 of file CacheS.H.

Referenced by RecoverGraphLog().

Basics::mutex CacheS::graphLogMu [private]
 

Definition at line 350 of file CacheS.H.

Referenced by AbortGraphLogChkpt(), ChkptGraphLog(), and RecoverGraphLog().

BitVector CacheS::hitFilter [private]
 

Definition at line 273 of file CacheS.H.

Referenced by CacheS_DoDeletions(), ClearStableHitFilter(), RecoverHitFilter(), and WriteHitFilter().

CleanWorker* CacheS::idleCleanWorker [private]
 

Definition at line 347 of file CacheS.H.

Referenced by NewCleanWorker().

FlushWorkerList* CacheS::idleFlushWorkers [private]
 

Definition at line 314 of file CacheS.H.

FP::Tag CacheS::instanceFp [private]
 

Definition at line 307 of file CacheS.H.

Referenced by GetCacheInstance().

Leases* CacheS::leases [private]
 

Definition at line 264 of file CacheS.H.

Referenced by GetLeases(), and ResumeLeaseExp().

PKPrefix::List CacheS::mpksToWeed [private]
 

Definition at line 274 of file CacheS.H.

Referenced by CacheS_DoDeletions(), and RecoverMPKsToWeed().

MPKMap* CacheS::mpkTbl [private]
 

Definition at line 266 of file CacheS.H.

Referenced by CacheS_DoFreeMPKFiles(), and FlushAll().

Basics::mutex CacheS::mu [private]
 

Definition at line 263 of file CacheS.H.

Referenced by CacheS_DoDeletions(), CacheS_DoFreeMPKFiles(), FlushAll(), FlushUsedCIs(), GetLeases(), Recover(), RecoverCacheLog(), RecoverCILog(), RecoverDeleting(), RecoverGraphLog(), RecoverHitFilter(), RecoverMPKsToWeed(), RecoverWeededMPKs(), and ResumeLeaseExp().

int CacheS::nextMPKToWeed [private]
 

Definition at line 275 of file CacheS.H.

Referenced by CacheS_DoDeletions(), RecoverWeededMPKs(), and ResetWeededMPKs().

bool CacheS::noHits [private]
 

Definition at line 260 of file CacheS.H.

Basics::cond CacheS::notDeleting [private]
 

Definition at line 272 of file CacheS.H.

Referenced by CacheS_DoDeletions().

int CacheS::numActiveFlushWorkers [private]
 

Definition at line 316 of file CacheS.H.

Referenced by CacheS_DoFreeMPKFiles().

ChkptWorker* CacheS::queuedChkptWorkers [private]
 

Definition at line 323 of file CacheS.H.

Referenced by ChkptWorker::MainLoop().

time_t CacheS::startTime [private]
 

Definition at line 299 of file CacheS.H.

EntryState CacheS::state [private]
 

Definition at line 302 of file CacheS.H.

Referenced by CacheS_DoFreeMPKFiles().

BitVector CacheS::usedCIs [private]
 

Definition at line 267 of file CacheS.H.

Referenced by RecoverCILog().

CacheLog::Entry* CacheS::vCacheAvail [private]
 

Definition at line 281 of file CacheS.H.

Referenced by RecoverCacheLog().

CacheLog::Entry* CacheS::vCacheLog [private]
 

Definition at line 279 of file CacheS.H.

Referenced by RecoverCacheLog().

CacheLog::Entry* CacheS::vCacheLogTail [private]
 

Definition at line 280 of file CacheS.H.

Referenced by RecoverCacheLog().

Intvl::List * CacheS::vCIAvail [private]
 

Definition at line 288 of file CacheS.H.

Referenced by FlushUsedCIs(), and RecoverCILog().

Intvl::List* CacheS::vCILog [private]
 

Definition at line 288 of file CacheS.H.

Referenced by FlushUsedCIs(), and RecoverCILog().

GraphLog::Node* CacheS::vGraphLog [private]
 

Definition at line 283 of file CacheS.H.

Referenced by RecoverGraphLog().

GraphLog::Node* CacheS::vGraphLogTail [private]
 

Definition at line 284 of file CacheS.H.

Referenced by RecoverGraphLog().

GraphLog::Node* CacheS::vGraphNodeAvail [private]
 

Definition at line 285 of file CacheS.H.

Referenced by RecoverGraphLog().

int CacheS::vGraphNodeAvailLen [private]
 

Definition at line 286 of file CacheS.H.

Referenced by RecoverGraphLog().

Basics::cond CacheS::waitingChkptWorker [private]
 

Definition at line 324 of file CacheS.H.

Referenced by ChkptWorker::MainLoop().

VestaLog* CacheS::weededMPKsLog [private]
 

Definition at line 277 of file CacheS.H.

Referenced by RecoverWeededMPKs(), and ResetWeededMPKs().

SRPC* CacheS::weederSRPC [private]
 

Definition at line 270 of file CacheS.H.


The documentation for this class was generated from the following files:
Generated on Mon May 8 00:49:08 2006 for Vesta by  doxygen 1.4.2