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

VestaLog Class Reference

#include <VestaLog.H>

List of all members.

Public Member Functions

 VestaLog () throw ()
void open (char *dir, int ver=-1, bool readonly=false, bool lock=false, char *dir2=NULL, bool bakckp=false) throw (Error)
int logVersion () throw (Error)
std::fstream * openCheckpoint () throw (Error)
void get (char &c) throw (Eof, Error)
void get (char *p, int n, char term='\n') throw (Eof, Error)
int read (char *p, int n) throw (Error)
void readAll (char *p, int n) throw (Eof, Error)
bool eof () throw (Error)
bool nextLog () throw (Error)
void loggingBegin () throw (Error)
void start () throw (Error)
int nesting () throw ()
void put (char c) throw (Error)
void put (const char *p) throw (Error)
void write (const char *p, int n) throw (Error)
void commit () throw (Error)
void abort () throw (Error)
std::fstream * checkpointBegin (std::ios::openmode mode=std::ios::out) throw (Error)
void checkpointEnd () throw (Error)
void checkpointAbort () throw (Error)
std::fstream * checkpointResume (std::ios::openmode mode=std::ios::out|std::ios::trunc) throw (Error)
void prune (int ckpkeep, bool logkeep=false, bool prunebak=true) throw (Error)
void close () throw ()

Private Attributes

VestaLogPrivatevlp

Classes

class  Eof
class  Error
class  Exception


Constructor & Destructor Documentation

VestaLog::VestaLog  )  throw ()
 

Definition at line 63 of file VestaLog.C.

References VestaLogPrivate::initial, NEW, VestaLogPrivate::state, and vlp.


Member Function Documentation

void VestaLog::abort  )  throw (Error)
 

Definition at line 959 of file VestaLog.C.

References VestaLogPrivate::bad, VestaLogPrivate::commPhy, VestaLogPrivate::commPocketPhy, VestaLogPrivate::commSeq, VestaLogPrivate::commUsePocket, VestaLogPrivate::cur, VestaLogPrivate::curLen, VestaLogPrivate::curSeq, VLogBlock::data, VestaLogPrivate::eraseUncommitted(), Basics::errno_Text(), VestaLogPrivate::fd, VestaLogPrivate::fd2, VLogBlock::data_block::getLen(), VestaLogPrivate::logging, VestaLogPrivate::nesting, VLogBlock::phy, VLogBlock::pocketPhy, read(), VestaLogPrivate::ready, VestaLogPrivate::state, VestaLogPrivate::usePocket, and vlp.

Referenced by main().

void VestaLog::checkpointAbort  )  throw (Error)
 

Definition at line 1227 of file VestaLog.C.

References Text::cchars(), VestaLogPrivate::ccVersion, VestaLogPrivate::checkpointing, VestaLogPrivate::directory, PathnameSep, VestaLogPrivate::ready, VestaLogPrivate::state, VestaLogPrivate::version, and vlp.

Referenced by CacheS::AbortGraphLogChkpt(), and main().

fstream * VestaLog::checkpointBegin std::ios::openmode  mode = std::ios::out  )  throw (Error)
 

Definition at line 1002 of file VestaLog.C.

References VestaLogPrivate::bad, Text::cchars(), FdCache::close(), Basics::errno_Text(), FS::Exists(), NEW_CONSTR, FdCache::open(), PathnameSep, VestaLogPrivate::ready, FS::Touch(), and VestaSourceSRPC::version.

Referenced by EmptyPKLog::CheckpointBegin(), CheckpointServer(), CacheS::ChkptGraphLog(), main(), and CacheS::ResetWeededMPKs().

void VestaLog::checkpointEnd  )  throw (Error)
 

Definition at line 1111 of file VestaLog.C.

References VestaLogPrivate::bad, VestaLogPrivate::bakckp, Text::cchars(), VestaLogPrivate::ccVersion, VestaLogPrivate::ccVersion2, VestaLogPrivate::checkpointing, FS::FdStreamBase::close(), COPY_SIZE, VestaLogPrivate::directory, VestaLogPrivate::directory2, Basics::errno_Text(), FS::FdStreamBase::fd(), NEW_CONSTR, PathnameSep, VestaLogPrivate::ready, VestaLogPrivate::state, VestaLogPrivate::version, and vlp.

Referenced by EmptyPKLog::CheckpointEnd(), CheckpointServer(), main(), and CacheS::ResetWeededMPKs().

fstream * VestaLog::checkpointResume std::ios::openmode  mode = std::ios::out|std::ios::trunc  )  throw (Error)
 

Definition at line 1245 of file VestaLog.C.

References VestaLogPrivate::bad, Text::cchars(), Basics::errno_Text(), FS::Exists(), NEW_CONSTR, PathnameSep, and VestaLogPrivate::recovered.

Referenced by main(), and CacheS::RecoverGraphLog().

void VestaLog::close  )  throw ()
 

Definition at line 1399 of file VestaLog.C.

References VestaLogPrivate::bad, VestaLogPrivate::cur, VestaLogPrivate::directory, VestaLogPrivate::fd, VestaLogPrivate::fd2, VestaLogPrivate::free, VestaLogPrivate::initial, VestaLogPrivate::last, VestaLogPrivate::lockfd, VestaLogPrivate::lockfd2, VestaLogPrivate::logging, VLogBlock::next, VestaLogPrivate::pocket, VestaLogPrivate::ready, VestaLogPrivate::recovered, VestaLogPrivate::recovering, VestaLogPrivate::state, and vlp.

Referenced by VestaLogSeq::Close(), main(), nextLog(), and EmptyPKLog::~EmptyPKLog().

void VestaLog::commit  )  throw (Error)
 

Definition at line 924 of file VestaLog.C.

References VestaLogPrivate::bad, VestaLogPrivate::commPhy, VestaLogPrivate::commPocketPhy, VestaLogPrivate::commSeq, VestaLogPrivate::commUsePocket, VestaLogPrivate::cur, VestaLogPrivate::curLen, VestaLogPrivate::curSeq, VLogBlock::data, Basics::errno_Text(), VestaLogPrivate::fd, VestaLogPrivate::fd2, VestaLogPrivate::logging, VestaLogPrivate::nesting, VLogBlock::phy, VLogBlock::pocketPhy, VestaLogPrivate::ready, VLogBlock::data_block::setLen(), VestaLogPrivate::state, VestaLogPrivate::usePocket, vlp, and VestaLogPrivate::writeCur().

Referenced by AcquireMastership(), AcquireShortIdBlock(), apply_sattr(), VestaSource::cedeMastership(), VDirChangeable::collapseBase(), VDirChangeable::copyIndexToMutable(), VDirVolatileRoot::createVolatileDirectory(), do_mkdir(), DoDeletions(), VDirChangeable::insertAppendableDirectory(), VDirChangeable::insertFile(), VDirChangeable::insertGhost(), VDirChangeable::insertImmutableDirectory(), VDirChangeable::insertMutableDirectory(), VDirChangeable::insertMutableFile(), VDirChangeable::insertStub(), LogAllDirShortIds(), main(), VDirChangeable::makeIndexImmutable(), VDirChangeable::makeIndexMutable(), VDirChangeable::reallyDelete(), VestaSource::recoveryDone(), VDirChangeable::renameTo(), RenewShortIdBlock(), VDirChangeable::setIndexMaster(), VDirChangeable::setTimestamp(), and VSAtomic().

bool VestaLog::eof  )  throw (Error)
 

Definition at line 562 of file VestaLog.C.

References VestaLogPrivate::makeBytesAvail(), VestaLogPrivate::recovering, VestaLogPrivate::state, and vlp.

Referenced by RecoveryReader::eof().

void VestaLog::get char *  p,
int  n,
char  term = '\n'
throw (Eof, Error)
 

Definition at line 487 of file VestaLog.C.

References VestaLogPrivate::recovering.

void VestaLog::get char &  c  )  throw (Eof, Error)
 

Definition at line 251 of file VestaLog.C.

References VestaLogPrivate::recovering.

Referenced by main(), and CacheS::RecoverGraphLog().

void VestaLog::loggingBegin  )  throw (Error)
 

Definition at line 710 of file VestaLog.C.

References VestaLogPrivate::balloc(), VestaLogPrivate::commPhy, VestaLogPrivate::commPocketPhy, VestaLogPrivate::commSeq, VestaLogPrivate::commUsePocket, VestaLogPrivate::cur, VestaLogPrivate::curLen, VestaLogPrivate::curSeq, VLogBlock::data, VestaLogPrivate::eraseUncommitted(), VestaLogPrivate::fd, VestaLogPrivate::fd2, VestaLogPrivate::free, VestaLogPrivate::hitEOF, VestaLogPrivate::last, VLogBlock::next, VestaLogPrivate::nextPhy, VLogBlock::phy, VestaLogPrivate::pocket, VLogBlock::pocketPhy, VestaLogPrivate::readonly, VestaLogPrivate::ready, VestaLogPrivate::recovered, VLogBlock::data_block::setLen(), VLogBlock::data_block::setSeq(), VestaLogPrivate::state, VLogBlock::tailCommitted, VestaLogPrivate::usePocket, and vlp.

Referenced by EmptyPKLog::EndRecovery(), main(), CacheS::RecoverCacheLog(), CacheS::RecoverCILog(), CacheS::RecoverGraphLog(), and CacheS::RecoverWeededMPKs().

int VestaLog::logVersion  )  throw (Error)
 

Definition at line 225 of file VestaLog.C.

References VestaLogPrivate::bad, VestaLogPrivate::initial, VestaLogPrivate::state, VestaLogPrivate::version, and vlp.

Referenced by CacheS::ChkptGraphLog(), and CacheS::RecoverGraphLog().

int VestaLog::nesting  )  throw ()
 

Definition at line 821 of file VestaLog.C.

References VestaLogPrivate::nesting, and vlp.

Referenced by VDirChangeable::freeTree(), VDirChangeable::insertCommon(), and VDirChangeable::reallyDelete().

bool VestaLog::nextLog  )  throw (Error)
 

Definition at line 628 of file VestaLog.C.

References VestaLogPrivate::bad, Text::cchars(), close(), VestaLogPrivate::commPhy, VestaLogPrivate::commPocketPhy, VestaLogPrivate::commSeq, VestaLogPrivate::commUsePocket, VestaLogPrivate::cur, VestaLogPrivate::curLen, VestaLogPrivate::curSeq, VestaLogPrivate::directory, VestaLogPrivate::directory2, Basics::errno_Text(), VestaLogPrivate::fd, VestaLogPrivate::fd2, VestaLogPrivate::free, VestaLogPrivate::hitEOF, VestaLogPrivate::last, VestaLogPrivate::nesting, VLogBlock::next, VestaLogPrivate::nextPhy, VestaLogPrivate::nextSeq, open(), PathnameSep, VestaLogPrivate::pocket, VestaLogPrivate::readonly, VestaLogPrivate::recovered, VestaLogPrivate::recovering, VestaLogPrivate::state, VLogBlock::tailCommitted, VestaLogPrivate::usePocket, VestaLogPrivate::version, and vlp.

Referenced by main(), EmptyPKLog::NextLog(), PrintCacheLog(), and Recover().

void VestaLog::open char *  dir,
int  ver = -1,
bool  readonly = false,
bool  lock = false,
char *  dir2 = NULL,
bool  bakckp = false
throw (Error)
 

Definition at line 71 of file VestaLog.C.

References VestaLogPrivate::bad, Text::cchars(), Basics::errno_Text(), VestaLogPrivate::initial, NEW_PTRFREE_ARRAY, ok(), FdCache::open(), PathnameSep, and VestaLogPrivate::recovering.

Referenced by main(), nextLog(), PrintCacheLog(), Recover(), CacheS::RecoverCacheLog(), CacheS::RecoverCILog(), CacheS::RecoverGraphLog(), and CacheS::RecoverWeededMPKs().

fstream * VestaLog::openCheckpoint  )  throw (Error)
 

Definition at line 234 of file VestaLog.C.

References VestaLogPrivate::bad, Text::cchars(), VestaLogPrivate::directory, Basics::errno_Text(), NEW_CONSTR, PathnameSep, VestaLogPrivate::recovering, VestaLogPrivate::state, VestaLogPrivate::version, and vlp.

Referenced by main(), PrintCacheLog(), Recover(), CacheS::RecoverCacheLog(), and CacheS::RecoverCILog().

void VestaLog::prune int  ckpkeep,
bool  logkeep = false,
bool  prunebak = true
throw (Error)
 

Definition at line 1377 of file VestaLog.C.

References VestaLogPrivate::bad, and VestaLogPrivate::initial.

Referenced by EmptyPKLog::CheckpointEnd(), main(), and CacheS::ResetWeededMPKs().

void VestaLog::put const char *  p  )  throw (Error)
 

Definition at line 897 of file VestaLog.C.

References VestaLogPrivate::logging.

void VestaLog::put char  c  )  throw (Error)
 

Definition at line 887 of file VestaLog.C.

References VestaLogPrivate::logging.

Referenced by AcquireMastership(), AcquireShortIdBlock(), VDirChangeable::collapseBase(), VDirChangeable::copyIndexToMutable(), VDirVolatileRoot::createVolatileDirectory(), DoDeletions(), VDirChangeable::insertAppendableDirectory(), VDirChangeable::insertFile(), VDirChangeable::insertGhost(), VDirChangeable::insertImmutableDirectory(), VDirChangeable::insertMutableDirectory(), VDirChangeable::insertMutableFile(), VDirChangeable::insertStub(), LogAllDirShortIds(), LogPutQuotedString(), main(), VDirChangeable::makeIndexImmutable(), VDirChangeable::makeIndexMutable(), VDirChangeable::reallyDelete(), VestaSource::recoveryDone(), VDirChangeable::renameTo(), RenewShortIdBlock(), VDirChangeable::setIndexMaster(), and VDirChangeable::setTimestamp().

int VestaLog::read char *  p,
int  n
throw (Error)
 

Definition at line 512 of file VestaLog.C.

References VestaLogPrivate::recovering.

Referenced by abort().

void VestaLog::readAll char *  p,
int  n
throw (Eof, Error)
 

Definition at line 540 of file VestaLog.C.

References VestaLogPrivate::recovering.

Referenced by CacheS::RecoverWeededMPKs().

void VestaLog::start  )  throw (Error)
 

Definition at line 807 of file VestaLog.C.

References VestaLogPrivate::logging, VestaLogPrivate::nesting, VestaLogPrivate::ready, VestaLogPrivate::state, and vlp.

Referenced by AcquireMastership(), AcquireShortIdBlock(), apply_sattr(), VestaSource::cedeMastership(), VDirChangeable::collapseBase(), VDirChangeable::copyIndexToMutable(), VDirVolatileRoot::createVolatileDirectory(), do_mkdir(), DoDeletions(), VDirChangeable::insertAppendableDirectory(), VDirChangeable::insertFile(), VDirChangeable::insertGhost(), VDirChangeable::insertImmutableDirectory(), VDirChangeable::insertMutableDirectory(), VDirChangeable::insertMutableFile(), VDirChangeable::insertStub(), LogAllDirShortIds(), main(), VDirChangeable::makeIndexImmutable(), VDirChangeable::makeIndexMutable(), VDirChangeable::reallyDelete(), VestaSource::recoveryDone(), VDirChangeable::renameTo(), RenewShortIdBlock(), VDirChangeable::setIndexMaster(), VDirChangeable::setTimestamp(), and VSAtomic().

void VestaLog::write const char *  p,
int  n
throw (Error)
 

Definition at line 910 of file VestaLog.C.

References VestaLogPrivate::logging.


Member Data Documentation

VestaLogPrivate* VestaLog::vlp [private]
 

Definition at line 385 of file VestaLog.H.

Referenced by abort(), checkpointAbort(), checkpointEnd(), close(), commit(), eof(), loggingBegin(), logVersion(), nesting(), nextLog(), openCheckpoint(), start(), and VestaLog().


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