class Journal { public: void SetName( StrPtr *Jval ); char *GetName(); dev_t GetDev(); ino_t GetIno(); off_tL GetSize(); int GetSequence(); bool Init( StrPtr *Jval, Error *e ); bool Open( Error *e ); bool Seek( off_tL offset, Error *e ); bool Read( char *buf, size_t count, ssize_t *n, Error *e ); bool ReadSequence( Error *e ); bool Stat( Error *e ); bool StatWait( Error *e ); bool Close( Error *e ); private: StrBuf name; int journalfd; int sequence; struct statL statbuf; };
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 6155 | Michael Shields |
Updated for the 2007.3 release while maintaining compatibility with prior releases. 2007.3 and later servers might rotate the journal by renaming it rather than copying and truncating it. A renamed journal is now detected by comparing the device and inode returned from statting by the journal's file name and statting by the journal's file descriptor. This algorithm (suggested by J.T. Goldstone; thanks J.T.!) is faster than reopening the journal and seeking if the journal was not rotated (~2.0 seconds vs. ~2.7 seconds for 1,000,000 iterations on my laptop). |
||
#1 | 4839 | Michael Shields | Pushing p4jrep source into the public depot. |