fio_PermJourInfo_t Struct Reference
[Classes for large file i/o, relative file, and DataBase]

#include <fio_JourFile.h>

Collaboration diagram for fio_PermJourInfo_t:

Collaboration graph
[legend]

List of all members.


Detailed Description

Permanent journal manager information stored in each journal file as header.

Must match with permanent DB info.

Definition at line 89 of file fio_JourFile.h.


Public Member Functions

 fio_PermJourInfo_t ()
 ~fio_PermJourInfo_t ()
void Init (fio_permDBinfo_t *a_permDBinfo_p)
void Init (fio_File *a_file_p)
void WriteInfo (fio_File *a_file_p)

Public Attributes

UInt16_t recordStructVersion
UInt16_t recordSize
UInt16_t startTransVersion
UInt16_t startTransSize
UInt16_t UVstructVersion
UInt16_t UVstructSize
fio_DataBaseID_t DataBaseID
 IVD system unique number. In case of FSC PartitionID is used.
ivd_Time32_t JourDate
 Time of journal file creation.
ivd_Time32_t PrevJourDate
 Previous journal date.
ivd_TransNumber_t PrevLastTransNumber
 Previous last transaction number.
 log_CLASSID_m

Friends

IVD_FILEIO_DECL_d ostream & operator<< (ostream &a_os, fio_PermJourInfo_t &a_pji)

Constructor & Destructor Documentation

fio_PermJourInfo_t::fio_PermJourInfo_t (  )  [inline]

Definition at line 90 of file fio_JourFile.h.

00090 {};

fio_PermJourInfo_t::~fio_PermJourInfo_t (  )  [inline]

Definition at line 93 of file fio_JourFile.h.

00093 {};


Member Function Documentation

void fio_PermJourInfo_t::Init ( fio_permDBinfo_t a_permDBinfo_p  ) 

Definition at line 96 of file fio_JourFile.cpp.

References fio_permDBinfo_t::ArchivedSyncJourFileID, fio_permDBinfo_t::ArchivedSyncPosition, c_fio_JournalHeaderStructVersion, fio_permDBinfo_t::DataBaseID, DataBaseID, fio_STARTTRANS_T_VERSION, fio_UV_T_VERSION, fio_permDBinfo_t::JourDate, JourDate, log_FUNC_m, PrevJourDate, PrevLastTransNumber, recordSize, recordStructVersion, startTransSize, startTransVersion, UVstructSize, and UVstructVersion.

Referenced by fio_JourFile::fio_JourFile(), and Init().

00096                                                               {
00097     log_FUNC_m(Init(fio_permDBinfo_t));
00098     recordStructVersion = c_fio_JournalHeaderStructVersion;
00099     recordSize          = sizeof (fio_PermJourInfo_t);
00100 
00101     startTransVersion   = fio_STARTTRANS_T_VERSION;  // Version of header of start transaction
00102     startTransSize      = sizeof(fio_StartTransaction_t);// Size of start transaction
00103     UVstructVersion     = fio_UV_T_VERSION; // Version of UV structure
00104     UVstructSize        = sizeof(fio_UV_t);// Size of UV structure
00105 
00106     DataBaseID          = a_permDBinfo_p->DataBaseID;
00107     JourDate            = a_permDBinfo_p->JourDate;
00108     PrevJourDate        = a_permDBinfo_p->ArchivedSyncJourFileID;
00109     PrevLastTransNumber = a_permDBinfo_p->ArchivedSyncPosition;
00110 }

Here is the caller graph for this function:

void fio_PermJourInfo_t::Init ( fio_File a_file_p  ) 

Definition at line 54 of file fio_JourFile.cpp.

References c_fio_JournalHeaderStructVersion, fio_STARTTRANS_T_VERSION, fio_UV_T_VERSION, fio_File::GetFileName(), ie_INV_JOUR_FILE_HEADER, ie_INV_STARTTRANS_T_VERSION, ie_INV_UNUSED_VECT_STRUCT, Init(), ivd_Error, log_FUNC_m, fio_File::PosRead(), recordSize, recordStructVersion, startTransSize, startTransVersion, UVstructSize, and UVstructVersion.

00054                                                 {
00055     log_FUNC_m(Init(fio_File));
00056     a_file_p->PosRead(0, this, sizeof(fio_PermJourInfo_t));
00057 
00058     if (   recordStructVersion != c_fio_JournalHeaderStructVersion
00059        || !(  (recordSize  == sizeof(fio_PermJourInfo_t))
00060            || (recordSize  == sizeof(fio_PermJourInfo_t)+4)
00061            )
00062        ) {
00063         ostringstream sstr;
00064         sstr << endl << "Expected: recors struct version " << c_fio_JournalHeaderStructVersion << endl
00065              << "          record size " << sizeof (fio_PermJourInfo_t) << endl
00066              << *this;
00067         throw ivd_Error(ie_INV_JOUR_FILE_HEADER,
00068             "Header was changed or file coruption. Jour file "
00069             + a_file_p->GetFileName() + sstr.str(), true);
00070     }
00071     else if (  startTransVersion    != fio_STARTTRANS_T_VERSION
00072        || startTransSize       != sizeof(fio_StartTransaction_t)) {
00073         ostringstream sstr;
00074         sstr << endl << "Expected: start trans struct version " << fio_STARTTRANS_T_VERSION << endl
00075              << "                  start trans rec size " << sizeof (fio_StartTransaction_t) << endl
00076              << *this;
00077         throw ivd_Error(ie_INV_STARTTRANS_T_VERSION,
00078             "OR wrong record size got form journal file header. Jour file "
00079             + a_file_p->GetFileName() + sstr.str(), true);
00080     }
00081     else if (  (UVstructVersion  != fio_UV_T_VERSION)
00082             || (UVstructSize     != sizeof(fio_UV_t))) {
00083         ostringstream sstr;
00084         sstr << endl << "Expected: UV struct version " << fio_UV_T_VERSION << endl
00085              << "          UV rec size " << sizeof (fio_UV_t) << endl
00086              << *this;
00087         throw ivd_Error(ie_INV_UNUSED_VECT_STRUCT,
00088             "OR wrong record size got from journal file header. Jour file "
00089             + a_file_p->GetFileName() + sstr.str(), true);
00090     }
00091 }

Here is the call graph for this function:

void fio_PermJourInfo_t::WriteInfo ( fio_File a_file_p  ) 

Definition at line 113 of file fio_JourFile.cpp.

References log_FUNC_m, and fio_File::PosWrite().

Referenced by fio_JourFile::fio_JourFile().

00113                                                      {
00114     log_FUNC_m(WriteInfo);
00115     a_file_p->PosWrite(0, this, sizeof(fio_PermJourInfo_t));
00116 }

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

IVD_FILEIO_DECL_d ostream& operator<< ( ostream &  a_os,
fio_PermJourInfo_t a_pji 
) [friend]

Definition at line 119 of file fio_JourFile.cpp.

00119                                                               {
00120     cmn_Time tjd(a_jh.JourDate, 0);
00121     cmn_Time tpjd(a_jh.PrevJourDate, 0);
00122     a_os << "************** Journal Header ***************"             << endl;
00123     a_os << "Structure version          = " << a_jh.recordStructVersion << endl;
00124     a_os << "Record size                = " << a_jh.recordSize          << endl;
00125     a_os << "Start trans struct version = " << a_jh.startTransVersion   << endl;
00126     a_os << "Start trans struct rec size= " << a_jh.startTransSize      << endl;
00127     a_os << "UV struct version          = " << a_jh.UVstructVersion     << endl;
00128     a_os << "UV struct rec size         = " << a_jh.UVstructSize        << endl;
00129 
00130     a_os << "Database ID                = " << a_jh.DataBaseID          << endl;
00131     a_os << "Journal date               = " << tjd.Time2YMDhms()        << endl;
00132 
00133     a_os << "Previous journal date      = " << tpjd.Time2YMDhms()       << endl;
00134     a_os << "Previous last trans num    = " << a_jh.PrevLastTransNumber << endl;
00135     a_os << "********** End Of Journal Header  ***********"             << endl;
00136     return a_os;
00137 }


Member Data Documentation

Definition at line 110 of file fio_JourFile.h.

Referenced by Init(), and operator<<().

Definition at line 111 of file fio_JourFile.h.

Referenced by Init(), and operator<<().

Definition at line 112 of file fio_JourFile.h.

Referenced by Init(), and operator<<().

Definition at line 113 of file fio_JourFile.h.

Referenced by Init(), and operator<<().

Definition at line 114 of file fio_JourFile.h.

Referenced by Init(), and operator<<().

Definition at line 115 of file fio_JourFile.h.

Referenced by Init(), and operator<<().

IVD system unique number. In case of FSC PartitionID is used.

Definition at line 118 of file fio_JourFile.h.

Referenced by Init(), and operator<<().

Time of journal file creation.

Definition at line 121 of file fio_JourFile.h.

Referenced by Init(), and operator<<().

Previous journal date.

Definition at line 124 of file fio_JourFile.h.

Referenced by Init(), and operator<<().

Previous last transaction number.

Definition at line 127 of file fio_JourFile.h.

Referenced by Init(), and operator<<().

Definition at line 129 of file fio_JourFile.h.


The documentation for this struct was generated from the following files:

Generated on Mon Feb 27 19:16:47 2012 for OPENARCHIVE by  doxygen 1.5.6