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

Weeder Class Reference

#include <Weeder.H>

List of all members.

Public Member Functions

 Weeder (CacheIntf::DebugLevel debug=CacheIntf::None) throw (SRPC::failure, FS::Failure)
bool Weed (WeedArgs &args) throw (SRPC::failure, FS::Failure, FS::DoesNotExist, VestaLog::Error, VestaLog::Eof, InputError, SysError, ReposError)

Private Member Functions

void MarkPhase () throw (SRPC::failure, FS::Failure, FS::DoesNotExist, VestaLog::Error, VestaLog::Eof, InputError, SysError, ReposError)
void MarkWork () throw (SRPC::failure, FS::Failure, VestaLog::Error, VestaLog::Eof, SourceOrDerived::Fatal, ReposError)
void CopyGLtoPending (const PkgTbl *pkgTbl) throw (FS::Failure, VestaLog::Error)
void ScanLogOnce () throw (FS::Failure)
void MarkNode (CacheEntry::Index ci) throw (FS::Failure)
void ProcessNode (const GLNode &node) throw (FS::Failure)
void PrintRoot (const PkgBuild &root, const PkgTbl &pkgTbl, bool chosenRoot, bool freshRoot) throw ()
void DeletionPhase () throw (SRPC::failure, FS::Failure, VestaLog::Error, VestaLog::Eof)
PKPrefixTblWeededPrefixes () throw (VestaLog::Error, FS::Failure)
void PruneGraphLog () throw (FS::Failure, VestaLog::Error, VestaLog::Eof)
void Recover () throw (SRPC::failure, FS::Failure)
void RecoverWeeded () throw (FS::Failure)
void WriteWeeded () throw (FS::Failure)
void RecoverMiscVars () throw (FS::Failure)
void WriteMiscVars () throw (FS::Failure)
void TimedMsg (char *msg, bool blankline=true, int level=CacheIntf::StatusMsgs) throw ()

Private Attributes

CacheIntf::DebugLevel debug
const WeedArgsargs
WeederCcache
BitVectorweeded
time_t startTime
ShortId disShortId
RootTblinstrRoots
RootTblmarkedRoots
BitVectorinitCIs
BitVectormarked
BitVectorwLeases
BitVectorglCIs
VestaLogSeq graphLogSeq
int newLogVer
Text logChkptFName
std::ofstream pendingGL
int markedCnt
int markedCntTotal
GLNodeBuffernodeBuff
FILE * disFP
time_t keepTime


Constructor & Destructor Documentation

Weeder::Weeder CacheIntf::DebugLevel  debug = CacheIntf::None  )  throw (SRPC::failure, FS::Failure)
 

Definition at line 155 of file Weeder.C.

References Config_GraphLogPath, NEW_CONSTR, and Recover().


Member Function Documentation

void Weeder::CopyGLtoPending const PkgTbl pkgTbl  )  throw (FS::Failure, VestaLog::Error) [private]
 

Definition at line 493 of file Weeder.C.

References GLNode::ci, GraphLog::Root::cis, FS::Close(), Config_PendingGLFile, GraphLog::Entry::DebugFull(), RecoveryReader::eof(), Table< K, V >::Default::Get(), CacheEntry::Indices::index, GLNode::kids, GraphLog::Entry::kind, GraphLog::Root::model, NEW_CONSTR, GraphLog::NodeKind, FS::OpenForWriting(), GraphLog::Root::pkgVersion, Table< K, V >::Default::Put(), GraphLog::Entry::Recover(), GraphLog::RootKind, Debug::Timestamp(), GraphLog::Root::ts, CacheIntf::WeederScans, and GLNode::Write().

Referenced by MarkWork().

void Weeder::DeletionPhase  )  throw (SRPC::failure, FS::Failure, VestaLog::Error, VestaLog::Eof) [private]
 

Definition at line 766 of file Weeder.C.

References cache, SourceOrDerived::checkpoint(), WeederC::CommitChkpt(), FS::Delete(), WeederC::EndMark(), SourceOrDerived::keepDerived(), newLogVer, PruneGraphLog(), BitVector::ResetAll(), TimedMsg(), Debug::Timestamp(), weeded, WeededPrefixes(), and WriteWeeded().

void Weeder::MarkNode CacheEntry::Index  ci  )  throw (FS::Failure) [private]
 

Definition at line 706 of file Weeder.C.

Referenced by MarkWork().

void Weeder::MarkPhase  )  throw (SRPC::failure, FS::Failure, FS::DoesNotExist, VestaLog::Error, VestaLog::Eof, InputError, SysError, ReposError) [private]
 

Definition at line 266 of file Weeder.C.

References args, cache, initCIs, instrRoots, WeedArgs::keepSecs, keepTime, MarkWork(), NEW, GatherWeedRoots::P(), WeederC::ResumeLeaseExp(), and WeederC::StartMark().

void Weeder::MarkWork  )  throw (SRPC::failure, FS::Failure, VestaLog::Error, VestaLog::Eof, SourceOrDerived::Fatal, ReposError) [private]
 

Definition at line 296 of file Weeder.C.

References cache, BitVector::Cardinality(), Config_GLNodeBuffSize, Config_PendingGLFile, Config_WorkingGLFile, CopyGLtoPending(), disFP, WeederC::GetLeases(), glCIs, initCIs, instrRoots, marked, markedCnt, markedCntTotal, markedRoots, MarkNode(), NEW, NEW_CONSTR, BVIter::Next(), nodeBuff, BitVector::PrintAll(), WeederC::ResumeLeaseExp(), ReposRoots::Scan(), ScanLogOnce(), WeederC::SetHitFilter(), CacheIntf::StatusMsgs, TimedMsg(), Debug::Timestamp(), and weeded.

Referenced by MarkPhase().

void Weeder::PrintRoot const PkgBuild root,
const PkgTbl pkgTbl,
bool  chosenRoot,
bool  freshRoot
throw () [private]
 

Definition at line 737 of file Weeder.C.

References NullShortId, and Pathname::Print().

void Weeder::ProcessNode const GLNode node  )  throw (FS::Failure) [private]
 

Definition at line 720 of file Weeder.C.

References Derived::Indices::index, and CacheEntry::Indices::index.

Referenced by ScanLogOnce().

void Weeder::PruneGraphLog  )  throw (FS::Failure, VestaLog::Error, VestaLog::Eof) [private]
 

Definition at line 869 of file Weeder.C.

References GraphLog::Node::ci, GraphLog::Root::cis, FS::Close(), Config_GraphLogPath, Config_WeederMDPath, GraphLog::Root::done, RecoveryReader::eof(), FS::Exists(), Table< K, V >::Default::Get(), CacheEntry::Indices::index, GraphLog::Entry::kind, CacheIntf::LogFlush, GraphLog::Root::model, GraphLog::NodeKind, FS::OpenForWriting(), GraphLog::Root::pkgVersion, RootTbl::Print(), Table< K, V >::Default::Put(), GraphLog::Entry::Recover(), AtomicFile::reserved_char, GraphLog::RootKind, Basics::OBufStream::str(), Debug::Timestamp(), GraphLog::Root::ts, GraphLog::Node::Write(), and GraphLog::Root::Write().

Referenced by DeletionPhase().

void Weeder::Recover  )  throw (SRPC::failure, FS::Failure) [private]
 

Definition at line 166 of file Weeder.C.

References RecoverMiscVars(), and RecoverWeeded().

void Weeder::RecoverMiscVars  )  throw (FS::Failure) [private]
 

Definition at line 1128 of file Weeder.C.

References FS::Close(), Config_MiscVarsFile, disShortId, keepTime, CacheIntf::LogRecover, markedRoots, NEW_CONSTR, FS::OpenReadOnly(), RootTbl::Print(), FS::Read(), Table< K, V >::Default::Size(), sizeof_assert, startTime, and TimedMsg().

Referenced by Recover().

void Weeder::RecoverWeeded  )  throw (FS::Failure) [private]
 

Definition at line 1078 of file Weeder.C.

References FS::Close(), Config_WeededFile, CacheIntf::LogRecover, NEW, NEW_CONSTR, FS::OpenReadOnly(), TimedMsg(), and weeded.

Referenced by Recover().

void Weeder::ScanLogOnce  )  throw (FS::Failure) [private]
 

Definition at line 440 of file Weeder.C.

References FS::AtEOF(), Text::chars(), GLNode::ci, FS::Close(), Config_PendingGLFile, Config_WorkingGLFile, GLNodeBuffer::flushedCnt, markedCnt, nodeBuff, FS::OpenForWriting(), FS::OpenReadOnly(), pendingGL, ProcessNode(), GLNodeBuffer::Put(), TimedMsg(), and CacheIntf::WeederScans.

Referenced by MarkWork().

void Weeder::TimedMsg char *  msg,
bool  blankline = true,
int  level = CacheIntf::StatusMsgs
throw () [private]
 

Definition at line 62 of file Weeder.C.

References Debug::Timestamp().

Referenced by DeletionPhase(), MarkWork(), RecoverMiscVars(), RecoverWeeded(), ScanLogOnce(), WriteMiscVars(), and WriteWeeded().

bool Weeder::Weed WeedArgs args  )  throw (SRPC::failure, FS::Failure, FS::DoesNotExist, VestaLog::Error, VestaLog::Eof, InputError, SysError, ReposError)
 

Definition at line 204 of file Weeder.C.

References WeedArgs::DoDeletions, and CacheIntf::StatusMsgs.

Referenced by main().

PKPrefixTbl * Weeder::WeededPrefixes  )  throw (VestaLog::Error, FS::Failure) [private]
 

Definition at line 839 of file Weeder.C.

References GraphLog::Node::ci, VestaLogSeq::Close(), RecoveryReader::eof(), graphLogSeq, GraphLog::Entry::kind, GraphLog::Node::loc, NEW_CONSTR, GraphLog::NodeKind, VestaLogSeq::Open(), Table< K, V >::Default::Put(), and GraphLog::Entry::Recover().

Referenced by DeletionPhase().

void Weeder::WriteMiscVars  )  throw (FS::Failure) [private]
 

Definition at line 1176 of file Weeder.C.

References Text::chars(), FS::Close(), Config_MiscVarsFile, disShortId, keepTime, CacheIntf::LogFlush, markedRoots, AtomicFile::open(), RootTbl::Print(), Table< K, V >::Default::Size(), sizeof_assert, startTime, TimedMsg(), RootTbl::Write(), and FS::Write().

void Weeder::WriteWeeded  )  throw (FS::Failure) [private]
 

Definition at line 1107 of file Weeder.C.

References BitVector::Cardinality(), Text::chars(), FS::Close(), Config_WeededFile, CacheIntf::LogFlush, AtomicFile::open(), BitVector::PrintAll(), TimedMsg(), weeded, and BitVector::Write().

Referenced by DeletionPhase().


Member Data Documentation

const WeedArgs* Weeder::args [private]
 

Definition at line 74 of file Weeder.H.

Referenced by MarkPhase().

WeederC* Weeder::cache [private]
 

Definition at line 75 of file Weeder.H.

Referenced by DeletionPhase(), MarkPhase(), and MarkWork().

CacheIntf::DebugLevel Weeder::debug [private]
 

Definition at line 73 of file Weeder.H.

FILE* Weeder::disFP [private]
 

Definition at line 102 of file Weeder.H.

Referenced by MarkWork().

ShortId Weeder::disShortId [private]
 

Definition at line 80 of file Weeder.H.

Referenced by RecoverMiscVars(), and WriteMiscVars().

BitVector* Weeder::glCIs [private]
 

Definition at line 92 of file Weeder.H.

Referenced by MarkWork().

VestaLogSeq Weeder::graphLogSeq [private]
 

Definition at line 94 of file Weeder.H.

Referenced by WeededPrefixes().

BitVector* Weeder::initCIs [private]
 

Definition at line 89 of file Weeder.H.

Referenced by MarkPhase(), and MarkWork().

RootTbl* Weeder::instrRoots [private]
 

Definition at line 81 of file Weeder.H.

Referenced by MarkPhase(), and MarkWork().

time_t Weeder::keepTime [private]
 

Definition at line 103 of file Weeder.H.

Referenced by MarkPhase(), RecoverMiscVars(), and WriteMiscVars().

Text Weeder::logChkptFName [private]
 

Definition at line 96 of file Weeder.H.

BitVector* Weeder::marked [private]
 

Definition at line 90 of file Weeder.H.

Referenced by MarkWork().

int Weeder::markedCnt [private]
 

Definition at line 99 of file Weeder.H.

Referenced by MarkWork(), and ScanLogOnce().

int Weeder::markedCntTotal [private]
 

Definition at line 100 of file Weeder.H.

Referenced by MarkWork().

RootTbl* Weeder::markedRoots [private]
 

Definition at line 82 of file Weeder.H.

Referenced by MarkWork(), RecoverMiscVars(), and WriteMiscVars().

int Weeder::newLogVer [private]
 

Definition at line 95 of file Weeder.H.

Referenced by DeletionPhase().

GLNodeBuffer* Weeder::nodeBuff [private]
 

Definition at line 101 of file Weeder.H.

Referenced by MarkWork(), and ScanLogOnce().

std::ofstream Weeder::pendingGL [private]
 

Definition at line 98 of file Weeder.H.

Referenced by ScanLogOnce().

time_t Weeder::startTime [private]
 

Definition at line 79 of file Weeder.H.

Referenced by RecoverMiscVars(), and WriteMiscVars().

BitVector* Weeder::weeded [private]
 

Definition at line 78 of file Weeder.H.

Referenced by DeletionPhase(), MarkWork(), RecoverWeeded(), and WriteWeeded().

BitVector* Weeder::wLeases [private]
 

Definition at line 91 of file Weeder.H.


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