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

SMultiPKFile Class Reference

#include <SMultiPKFile.H>

List of all members.

Public Types

typedef Table< FP::Tag, VPKFile
* >::Default 
VPKFileMap
typedef Table< FP::Tag, VPKFile
* >::Iterator 
VPKFileIter
typedef Table< FP::Tag, VPKFileChkPt
* >::Default 
ChkPtTbl
typedef Table< FP::Tag, VPKFileChkPt
* >::Iterator 
ChkPtIter

Static Public Member Functions

static void OpenRead (const PKPrefix::T &pfx, std::ifstream &ifs) throw (SMultiPKFileRep::NotFound, FS::Failure)
static std::streampos SeekToPKFile (std::ifstream &ifs, const FP::Tag &pk, int &version) throw (SMultiPKFileRep::NotFound, FS::Failure)
static bool ChkptForRewrite (VPKFileMap &vpkFiles, const BitVector *toDelete, ChkPtTbl &vpkChkptTbl) throw ()
static bool PrepareForRewrite (const PKPrefix::T &pfx, std::ifstream &ifs, SMultiPKFileRep::Header *&hdr) throw (FS::Failure, FS::EndOfFile)
static void Rewrite (const PKPrefix::T &pfx, bool mpkFileExists, std::ifstream &ifs, SMultiPKFileRep::Header *hdr, VPKFileMap &vpkFiles, ChkPtTbl &vpkChkptTbl, const BitVector *toDelete, EmptyPKLog *emptyPKLog, EntryState &state) throw (FS::Failure, FS::EndOfFile, VestaLog::Error)

Static Private Member Functions

static std::streampos SeekInListV1 (std::ifstream &ifs, SMultiPKFileRep::UShort numEntries, const FP::Tag &pk) throw (SMultiPKFileRep::NotFound, FS::EndOfFile, FS::Failure)
static std::streampos SeekInSortedListV1 (std::ifstream &ifs, SMultiPKFileRep::UShort numEntries, const FP::Tag &pk) throw (SMultiPKFileRep::NotFound, FS::EndOfFile, FS::Failure)
static SMultiPKFileRep::HeaderReadHeader (const PKPrefix::T &pfx, bool readEntries, std::ifstream &ifs) throw (FS::Failure, FS::EndOfFile)
static Text Name (const PKPrefix::T &pfx, int granBits) throw ()
static Text FullName (const PKPrefix::T &pfx) throw ()
static void OpenAtomicWrite (const PKPrefix::T &pfx, AtomicFile &ofs) throw (FS::Failure)
static void DeleteFile (const PKPrefix::T &pfx) throw (FS::Failure)
static void MakeDirs (const Text &name) throw (FS::Failure)
static void PauseDeletionThread () throw ()


Member Typedef Documentation

typedef Table<FP::Tag,VPKFileChkPt*>::Iterator SMultiPKFile::ChkPtIter
 

Definition at line 72 of file SMultiPKFile.H.

typedef Table<FP::Tag,VPKFileChkPt*>::Default SMultiPKFile::ChkPtTbl
 

Definition at line 71 of file SMultiPKFile.H.

typedef Table<FP::Tag,VPKFile*>::Iterator SMultiPKFile::VPKFileIter
 

Definition at line 68 of file SMultiPKFile.H.

typedef Table<FP::Tag,VPKFile*>::Default SMultiPKFile::VPKFileMap
 

Definition at line 67 of file SMultiPKFile.H.


Member Function Documentation

bool SMultiPKFile::ChkptForRewrite VPKFileMap vpkFiles,
const BitVector toDelete,
ChkPtTbl vpkChkptTbl
throw () [static]
 

Definition at line 195 of file SMultiPKFile.C.

References VPKFile::CheckPoint(), VPKFile::HasNewEntries(), Basics::mutex::lock(), VPKFile::mu, Table< K, V >::Iterator::Next(), Table< K, V >::Iterator::Reset(), and Basics::mutex::unlock().

Referenced by VMultiPKFile::ChkptForWrite().

void SMultiPKFile::DeleteFile const PKPrefix::T pfx  )  throw (FS::Failure) [static, private]
 

Definition at line 758 of file SMultiPKFile.C.

References Config_SCachePath, FS::Delete(), FS::DeleteDir(), Text::FindCharR(), Text::Length(), and Text::Sub().

Text SMultiPKFile::FullName const PKPrefix::T pfx  )  throw () [static, private]
 

Definition at line 688 of file SMultiPKFile.C.

References Config_SCachePath, and PKPrefix::Granularity().

void SMultiPKFile::MakeDirs const Text name  )  throw (FS::Failure) [static, private]
 

Definition at line 721 of file SMultiPKFile.C.

References Text::cchars(), Text::Length(), and PathnameSep.

Text SMultiPKFile::Name const PKPrefix::T pfx,
int  granBits
throw () [static, private]
 

Definition at line 678 of file SMultiPKFile.C.

void SMultiPKFile::OpenAtomicWrite const PKPrefix::T pfx,
AtomicFile ofs
throw (FS::Failure) [static, private]
 

Definition at line 695 of file SMultiPKFile.C.

References Text::chars().

void SMultiPKFile::OpenRead const PKPrefix::T pfx,
std::ifstream &  ifs
throw (SMultiPKFileRep::NotFound, FS::Failure) [static]
 

Definition at line 83 of file SMultiPKFile.C.

References FS::OpenReadOnly().

Referenced by VPKFile::Lookup(), and VPKFile::ReadPKFHeaderTail().

void SMultiPKFile::PauseDeletionThread  )  throw () [static, private]
 

Definition at line 774 of file SMultiPKFile.C.

References Config_WeedPauseDur, Debug::Lock(), Basics::thread::pause(), Debug::Timestamp(), and Debug::Unlock().

bool SMultiPKFile::PrepareForRewrite const PKPrefix::T pfx,
std::ifstream &  ifs,
SMultiPKFileRep::Header *&  hdr
throw (FS::Failure, FS::EndOfFile) [static]
 

Definition at line 247 of file SMultiPKFile.C.

References FS::Close(), NEW, and ReadHeader().

Referenced by CacheS::VToSCache().

SMultiPKFileRep::Header * SMultiPKFile::ReadHeader const PKPrefix::T pfx,
bool  readEntries,
std::ifstream &  ifs
throw (FS::Failure, FS::EndOfFile) [static, private]
 

Definition at line 661 of file SMultiPKFile.C.

References NEW_CONSTR, and SMultiPKFileRep::Header::ReadEntries().

Referenced by PrepareForRewrite().

void SMultiPKFile::Rewrite const PKPrefix::T pfx,
bool  mpkFileExists,
std::ifstream &  ifs,
SMultiPKFileRep::Header hdr,
VPKFileMap vpkFiles,
ChkPtTbl vpkChkptTbl,
const BitVector toDelete,
EmptyPKLog emptyPKLog,
EntryState state
throw (FS::Failure, FS::EndOfFile, VestaLog::Error) [static]
 

Definition at line 293 of file SMultiPKFile.C.

References SPKFileRep::Header::BackPatch(), SMultiPKFileRep::HeaderEntry::becameEmpty, FS::Close(), SPKFile::CommonNames(), Config_ReadImmutable, Config_WeedPauseDur, FS::Copy(), VPKFile::DecrPKEpoch(), VPKFile::Evicted(), SMultiPKFileRep::HeaderEntry::exCommonNames, SMultiPKFileRep::HeaderEntry::exUncommonNames, VPKFile::HasNewEntries(), VPKFileChkPt::hasNewEntries, SPKFileRep::LastVersion, Basics::mutex::lock(), Debug::Lock(), MISTRUST_PKLEN, VPKFile::mu, NEW_CONSTR, Table< K, V >::Iterator::Next(), SMultiPKFileRep::HeaderEntry::offset, SMultiPKFileRep::HeaderEntry::packMask, SMultiPKFileRep::HeaderEntry::pk, VPKFileChkPt::pkEpoch, SPKFile::PKEpoch(), SMultiPKFileRep::HeaderEntry::pkfile, SMultiPKFileRep::HeaderEntry::pkfileModified, SMultiPKFileRep::HeaderEntry::pkhdr, SMultiPKFileRep::HeaderEntry::pkLen, FS::Posn(), SMultiPKFileRep::HeaderEntry::reMap, Table< K, V >::Iterator::Reset(), FS::Seek(), SMultiPKFileRep::HeaderEntry::SPKFileExists(), Debug::Timestamp(), Basics::mutex::unlock(), Debug::Unlock(), VPKFile::Update(), SPKFile::Update(), and SPKFile::Write().

Referenced by VMultiPKFile::ToSCache().

streampos SMultiPKFile::SeekInListV1 std::ifstream &  ifs,
SMultiPKFileRep::UShort  numEntries,
const FP::Tag pk
throw (SMultiPKFileRep::NotFound, FS::EndOfFile, FS::Failure) [static, private]
 

Definition at line 147 of file SMultiPKFile.C.

References SMultiPKFileRep::HeaderEntry::offset, and SMultiPKFileRep::HeaderEntry::pk.

streampos SMultiPKFile::SeekInSortedListV1 std::ifstream &  ifs,
SMultiPKFileRep::UShort  numEntries,
const FP::Tag pk
throw (SMultiPKFileRep::NotFound, FS::EndOfFile, FS::Failure) [static, private]
 

Definition at line 159 of file SMultiPKFile.C.

References Compare(), SMultiPKFileRep::HeaderEntry::offset, SMultiPKFileRep::HeaderEntry::pk, FS::Posn(), FS::Seek(), and SMultiPKFileRep::HeaderEntry::Size().

streampos SMultiPKFile::SeekToPKFile std::ifstream &  ifs,
const FP::Tag pk,
int &  version
throw (SMultiPKFileRep::NotFound, FS::Failure) [static]
 

Definition at line 96 of file SMultiPKFile.C.

References SMultiPKFileRep::HT_HashTable, SMultiPKFileRep::HT_List, SMultiPKFileRep::HT_SortedList, SMultiPKFileRep::Header::num, FS::Seek(), SPKFileRep::SourceFuncVersion, SMultiPKFileRep::Header::type, VestaSourceSRPC::version, and SMultiPKFileRep::Header::version.

Referenced by VPKFile::Lookup(), and VPKFile::ReadPKFHeaderTail().


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