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

VPKFile Class Reference

#include <VPKFile.H>

Inheritance diagram for VPKFile:

SPKFile List of all members.

Public Member Functions

 VPKFile (const FP::Tag &pk, PKFile::Epoch newPKEpoch=0, FV::Epoch newNamesEpoch=0) throw (FS::Failure)
bool IsEmpty () throw ()
bool IsStableEmpty () const throw ()
bool HasNewEntries () const throw ()
void SendAllNames (SRPC *srpc, bool debug) throw (SRPC::failure, PrefixTbl::Overflow)
CacheIntf::LookupRes Lookup (FV::Epoch id, const FP::List &fps, CacheEntry::Index &ci, const VestaVal::T *&value, CacheIntf::LookupOutcome &outcome) throw (FS::Failure)
CE::T * NewEntry (CacheEntry::Index ci, FV::List *names, FP::List *fps, VestaVal::T *value, Model::T model, CacheEntry::Indices *kids, FP::Tag *&commonFP) throw (DuplicateNames)
void AddEntry (const Text *sourceFunc, CE::T *ce, FP::Tag *commonFP, PKFile::Epoch newPKEpoch=-1) throw ()
FP::Tag * CommonFP (const CE::T &entry) throw ()
VPKFileChkPt * CheckPoint () throw ()
void DecrPKEpoch () throw ()
void Update (const SPKFile &pf, const VPKFileChkPt &chkpt, const BitVector *toDelete, const BitVector *exCommonNames, const BitVector *exUncommonNames, BitVector *packMask, IntIntTblLR *reMap, bool becameEmpty, EntryState &state) throw ()
void UpdateFreeEpoch (int currentEpoch) throw ()
int GetFreeEpoch () throw ()
void DeleteOldEntries (int sizeHint, EntryState &state) throw ()
void Evict () throw ()
bool Evicted () const throw ()
bool ReadyForPurgeWarm (int latestEpoch) const throw ()
bool ReadyForEviction (int latestEpoch) const throw ()

Public Attributes

Basics::mutex mu

Private Types

typedef Table< FV::T, int
>::Default 
NameMap
typedef Table< FV::T, int
>::Iterator 
NameMapIter

Private Member Functions

void ReadPKFHeaderTail (const FP::Tag &pk) throw (FS::Failure, SMultiPKFileRep::NotFound)
bool IsCommon (const BitVector &nms) throw ()
void PutCommonEntry (CFPEntryMap &tbl, const FP::Tag &commonFP, CE::T *ce) throw ()
CE::T * LookupInList (const CE::List *entries, const FP::List &fps) throw ()
void DeleteCheckpointedEntries (const VPKFileChkPt &chkpt, EntryState &state) throw ()
void MoveCommonToUncommon (const BitVector &oldCommon) throw ()
void MoveCommonListToUncommon (CE::List *head, const BitVector &oldCommon) throw ()
void UpdateUncommonList (const Text *sourceFunc, BitVector *packMask, IntIntTblLR *reMap, bool unlazyTag) throw ()
void RecordCIsFromList (const CE::List *ents, IntIntTbl &keep) const throw ()
void RecordCIsFromTbl (const CFPEntryMap &tbl, IntIntTbl &keep) const throw ()
void CopyByCIs (const CFPEntryMap &source, IntIntTbl &cis, EntryState &state) throw ()
void CycleDeletedNamesInList (CE::List *curr, BitVector &packMask, IntIntTblLR &reMap) throw ()
 VPKFile (const VPKFile &)

Private Attributes

NameMap nameMap
CE::List * newUncommon
CFPEntryMap newCommon
bool isEmpty
int freePKFileEpoch
bool evicted

Member Typedef Documentation

typedef Table<FV::T,int>::Default VPKFile::NameMap [private]
 

Definition at line 237 of file VPKFile.H.

typedef Table<FV::T,int>::Iterator VPKFile::NameMapIter [private]
 

Definition at line 238 of file VPKFile.H.


Constructor & Destructor Documentation

VPKFile::VPKFile (  const FP::Tag &  pk,
PKFile::Epoch  newPKEpoch = 0,
FV::Epoch  newNamesEpoch = 0
)  throw (FS::Failure)
 

Definition at line 63 of file VPKFile.C.

VPKFile::VPKFile (  const VPKFile &   )  [private]
 


Member Function Documentation

void VPKFile::AddEntry (  const Text *  sourceFunc,
CE::T *  ce,
FP::Tag *  commonFP,
PKFile::Epoch  newPKEpoch = -1
)  throw ()
 

Definition at line 339 of file VPKFile.C.

References NEW_CONSTR.

Referenced by CacheS::AddEntry(), and CacheS::RecoverCacheLogEntries().

VPKFileChkPt * VPKFile::CheckPoint (   )  throw () [virtual]
 

!const

Reimplemented from SPKFile.

Definition at line 390 of file VPKFile.C.

References SPKFile::CheckPoint(), HasNewEntries(), VPKFileChkPt::hasNewEntries, Basics::mutex::lock(), mu, newCommon, VPKFileChkPt::newCommon, VPKFileChkPt::newCommonHeads, newUncommon, VPKFileChkPt::newUncommon, VPKFileChkPt::newUncommonHead, SPKFile::pkEpoch, and Basics::mutex::unlock().

Referenced by SMultiPKFile::ChkptForRewrite().

FP::Tag* VPKFile::CommonFP (  const CE::T &  entry  )  throw () [inline]
 

Definition at line 173 of file VPKFile.H.

References SPKFile::commonNames.

void VPKFile::CopyByCIs (  const CFPEntryMap &  source,
IntIntTbl &  cis,
EntryState &  state
)  throw () [private]
 

Definition at line 800 of file VPKFile.C.

References CE::T::CI(), CE::List::Head(), CE::List::Tail(), and CE::T::Value().

void VPKFile::CycleDeletedNamesInList (  CE::List *  curr,
BitVector &  packMask,
IntIntTblLR &  reMap
)  throw () [private]
 

Definition at line 828 of file VPKFile.C.

References CE::T::CycleNames(), IntIntTblLR::Get(), CE::List::Head(), BitVector::IsEmpty(), BVIter::Next(), IntIntTblLR::Put(), CE::List::Tail(), and CE::T::UncommonNames().

void VPKFile::DecrPKEpoch (   )  throw () [inline]
 

Definition at line 186 of file VPKFile.H.

References SPKFile::pkEpoch.

Referenced by SMultiPKFile::Rewrite().

void VPKFile::DeleteCheckpointedEntries (  const VPKFileChkPt &  chkpt,
EntryState &  state
)  throw () [private]
 

Definition at line 662 of file VPKFile.C.

void VPKFile::DeleteOldEntries (  int  sizeHint,
EntryState &  state
)  throw ()
 

Definition at line 691 of file VPKFile.C.

References CE::List::Head(), and CE::List::Tail().

Referenced by CacheS_DoFreeMPKFiles().

void VPKFile::Evict (   )  throw () [inline]
 

Definition at line 214 of file VPKFile.H.

References evicted.

Referenced by CacheS_DoFreeMPKFiles().

bool VPKFile::Evicted (   )  const throw () [inline]
 

Definition at line 222 of file VPKFile.H.

References evicted.

Referenced by CacheS::AddEntry(), CacheS::Lookup(), and SMultiPKFile::Rewrite().

int VPKFile::GetFreeEpoch (   )  throw () [inline]
 

Definition at line 205 of file VPKFile.H.

References freePKFileEpoch.

bool VPKFile::HasNewEntries (   )  const throw () [inline]
 

Definition at line 101 of file VPKFile.H.

References newCommon, and newUncommon.

Referenced by CheckPoint(), SMultiPKFile::ChkptForRewrite(), and SMultiPKFile::Rewrite().

bool VPKFile::IsCommon (  const BitVector &  nms  )  throw () [inline, private]
 

Definition at line 281 of file VPKFile.H.

References SPKFile::commonNames.

bool VPKFile::IsEmpty (   )  throw ()
 

Definition at line 115 of file VPKFile.C.

References Basics::mutex::lock(), mu, newCommon, newUncommon, SPKFile::oldEntries, and Basics::mutex::unlock().

bool VPKFile::IsStableEmpty (   )  const throw () [inline]
 

Definition at line 95 of file VPKFile.H.

References isEmpty.

Referenced by CacheS_DoFreeMPKFiles().

CacheIntf::LookupRes VPKFile::Lookup (  FV::Epoch  id,
const FP::List &  fps,
CacheEntry::Index &  ci,
const VestaVal::T *&  value,
CacheIntf::LookupOutcome &  outcome
)  throw (FS::Failure)
 

Definition at line 170 of file VPKFile.C.

References CacheIntf::AllMisses, CacheIntf::BadLookupArgs, CE::T::CI(), FS::Close(), CacheIntf::DiskHits, CacheIntf::FVMismatch, CacheIntf::Hit, SPKFile::Lookup(), CacheIntf::Miss, CacheIntf::NewHits, CacheIntf::NoOutcome, SMultiPKFile::OpenRead(), SMultiPKFile::SeekToPKFile(), CE::T::Value(), VestaSourceSRPC::version, and CacheIntf::WarmHits.

Referenced by CacheS::Lookup().

CE::T * VPKFile::LookupInList (  const CE::List *  entries,
const FP::List &  fps
)  throw () [private]
 

Definition at line 259 of file VPKFile.C.

References CE::T::FPMatch().

void VPKFile::MoveCommonListToUncommon (  CE::List *  head,
const BitVector &  oldCommon
)  throw () [private]
 

Definition at line 724 of file VPKFile.C.

References CE::List::Head(), CE::List::SetTail(), CE::List::Tail(), and CE::T::XorUncommonNames().

void VPKFile::MoveCommonToUncommon (  const BitVector &  oldCommon  )  throw () [private]
 

Definition at line 709 of file VPKFile.C.

References Table< K, V >::Iterator::Next().

CE::T * VPKFile::NewEntry (  CacheEntry::Index  ci,
FV::List *  names,
FP::List *  fps,
VestaVal::T *  value,
Model::T  model,
CacheEntry::Indices *  kids,
FP::Tag *&  commonFP
)  throw (DuplicateNames)
 

Definition at line 272 of file VPKFile.C.

References NEW_CONSTR, NEW_PTRFREE_CONSTR, IntIntTblLR::Put(), and BitVector::Set().

Referenced by CacheS::AddEntry(), and CacheS::RecoverCacheLogEntries().

void VPKFile::PutCommonEntry (  CFPEntryMap &  tbl,
const FP::Tag &  commonFP,
CE::T *  ce
)  throw () [private]
 

void VPKFile::ReadPKFHeaderTail (  const FP::Tag &  pk  )  throw (FS::Failure, SMultiPKFileRep::NotFound) [private]
 

Definition at line 87 of file VPKFile.C.

References FS::Close(), SMultiPKFile::OpenRead(), VestaSourceSRPC::Read, SMultiPKFile::SeekToPKFile(), and VestaSourceSRPC::version.

bool VPKFile::ReadyForEviction (  int  latestEpoch  )  const throw ()
 

Definition at line 890 of file VPKFile.C.

References Config_EvictPeriodCnt.

Referenced by CacheS_DoFreeMPKFiles().

bool VPKFile::ReadyForPurgeWarm (  int  latestEpoch  )  const throw ()
 

Definition at line 873 of file VPKFile.C.

References Config_PurgeWarmPeriodCnt.

Referenced by CacheS_DoFreeMPKFiles().

void VPKFile::RecordCIsFromList (  const CE::List *  ents,
IntIntTbl &  keep
)  const throw () [private]
 

Definition at line 778 of file VPKFile.C.

References CE::List::Head(), and CE::List::Tail().

void VPKFile::RecordCIsFromTbl (  const CFPEntryMap &  tbl,
IntIntTbl &  keep
)  const throw () [private]
 

Definition at line 788 of file VPKFile.C.

void VPKFile::SendAllNames (  SRPC *  srpc,
bool  debug
)  throw (SRPC::failure, PrefixTbl::Overflow)
 

Definition at line 133 of file VPKFile.C.

References BoolName, Debug::Lock(), Basics::mutex::lock(), mu, Debug::Timestamp(), Basics::mutex::unlock(), and Debug::Unlock().

Referenced by ExpCache::FreeVars().

void VPKFile::Update (  const SPKFile &  pf,
const VPKFileChkPt &  chkpt,
const BitVector *  toDelete,
const BitVector *  exCommonNames,
const BitVector *  exUncommonNames,
BitVector *  packMask,
IntIntTblLR *  reMap,
bool  becameEmpty,
EntryState &  state
)  throw ()
 

STEP 1

STEP 2

STEP 3

STEP 4

STEP 5

Definition at line 415 of file VPKFile.C.

References Config_KeepNewOnFlush, Config_KeepOldOnFlush, BitVector::IsEmpty(), max(), and Table< K, V >::Default::Size().

Referenced by SMultiPKFile::Rewrite().

void VPKFile::UpdateFreeEpoch (  int  currentEpoch  )  throw () [inline]
 

Definition at line 201 of file VPKFile.H.

References freePKFileEpoch.

Referenced by CacheS::AddEntry(), CacheS::Lookup(), and CacheS::RecoverCacheLogEntries().

void VPKFile::UpdateUncommonList (  const Text *  sourceFunc,
BitVector *  packMask,
IntIntTblLR *  reMap,
bool  unlazyTag
)  throw () [private]
 

Definition at line 740 of file VPKFile.C.

References AddEntry(), CE::List::Head(), CE::T::Pack(), CE::List::Tail(), CE::T::UncommonNames(), CE::T::UnlazyUncommonFP(), and CE::T::XorUncommonNames().


Member Data Documentation

bool VPKFile::evicted [private]
 

Definition at line 269 of file VPKFile.H.

Referenced by Evict(), and Evicted().

int VPKFile::freePKFileEpoch [private]
 

Definition at line 267 of file VPKFile.H.

Referenced by GetFreeEpoch(), and UpdateFreeEpoch().

bool VPKFile::isEmpty [private]
 

Definition at line 265 of file VPKFile.H.

Referenced by IsStableEmpty().

Basics::mutex VPKFile::mu
 

Definition at line 73 of file VPKFile.H.

Referenced by CacheS::AddEntry(), CacheS_DoFreeMPKFiles(), CheckPoint(), SMultiPKFile::ChkptForRewrite(), IsEmpty(), CacheS::Lookup(), CacheS::RecoverCacheLogEntries(), and SMultiPKFile::Rewrite().

NameMap VPKFile::nameMap [private]
 

Definition at line 241 of file VPKFile.H.

CFPEntryMap VPKFile::newCommon [private]
 

Definition at line 243 of file VPKFile.H.

Referenced by CheckPoint(), HasNewEntries(), and IsEmpty().

CE::List* VPKFile::newUncommon [private]
 

Definition at line 242 of file VPKFile.H.

Referenced by CheckPoint(), HasNewEntries(), and IsEmpty().


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