Public Member Functions | Public Attributes | Friends

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

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

#include <fio_JourFile.h>

Collaboration diagram for fio_PermJourInfo_t:
Collaboration graph
[legend]

List of all members.

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)

Detailed Description

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

Must match with permanent DB info.

Definition at line 109 of file fio_JourFile.h.


Constructor & Destructor Documentation

fio_PermJourInfo_t::fio_PermJourInfo_t (  )  [inline]

Definition at line 110 of file fio_JourFile.h.

{};

fio_PermJourInfo_t::~fio_PermJourInfo_t (  )  [inline]

Definition at line 113 of file fio_JourFile.h.

{};


Member Function Documentation

void fio_PermJourInfo_t::Init ( fio_permDBinfo_t a_permDBinfo_p  ) 

Definition at line 110 of file fio_JourFile.cpp.

References fio_permDBinfo_t::ArchivedSyncJourFileID, c_fio_JournalHeaderStructVersion, fio_permDBinfo_t::DataBaseID, DataBaseID, 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().

                                                              {
    log_FUNC_m(Init(fio_permDBinfo_t));
    recordStructVersion = c_fio_JournalHeaderStructVersion;
    recordSize          = sizeof (fio_PermJourInfo_t);

    startTransVersion   = fio_STARTTRANS_T_VERSION;  // Version of header of start transaction
    startTransSize      = sizeof(fio_StartTransaction_t);// Size of start transaction
    UVstructVersion     = fio_UV_T_VERSION; // Version of UV structure
    UVstructSize        = sizeof(fio_UV_t);// Size of UV structure

    DataBaseID          = a_permDBinfo_p->DataBaseID;
    JourDate            = a_permDBinfo_p->JourDate;
    PrevJourDate        = a_permDBinfo_p->ArchivedSyncJourFileID;
    PrevLastTransNumber = a_permDBinfo_p->ArchivedSyncPosition;
}

Here is the caller graph for this function:

void fio_PermJourInfo_t::Init ( fio_File a_file_p  ) 

Definition at line 68 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.

                                                {
    log_FUNC_m(Init(fio_File));
    a_file_p->PosRead(0, this, sizeof(fio_PermJourInfo_t));

    if (   recordStructVersion != c_fio_JournalHeaderStructVersion
       || !(  (recordSize  == sizeof(fio_PermJourInfo_t))
           || (recordSize  == sizeof(fio_PermJourInfo_t)+4)
           )
       ) {
        ostringstream sstr;
        sstr << endl << "Expected: recors struct version " << c_fio_JournalHeaderStructVersion << endl
             << "          record size " << sizeof (fio_PermJourInfo_t) << endl
             << *this;
        throw ivd_Error(ie_INV_JOUR_FILE_HEADER,
            "Header was changed or file coruption. Jour file "
            + a_file_p->GetFileName() + sstr.str(), true);
    }
    else if (  startTransVersion    != fio_STARTTRANS_T_VERSION
       || startTransSize       != sizeof(fio_StartTransaction_t)) {
        ostringstream sstr;
        sstr << endl << "Expected: start trans struct version " << fio_STARTTRANS_T_VERSION << endl
             << "                  start trans rec size " << sizeof (fio_StartTransaction_t) << endl
             << *this;
        throw ivd_Error(ie_INV_STARTTRANS_T_VERSION,
            "OR wrong record size got form journal file header. Jour file "
            + a_file_p->GetFileName() + sstr.str(), true);
    }
    else if (  (UVstructVersion  != fio_UV_T_VERSION)
            || (UVstructSize     != sizeof(fio_UV_t))) {
        ostringstream sstr;
        sstr << endl << "Expected: UV struct version " << fio_UV_T_VERSION << endl
             << "          UV rec size " << sizeof (fio_UV_t) << endl
             << *this;
        throw ivd_Error(ie_INV_UNUSED_VECT_STRUCT,
            "OR wrong record size got from journal file header. Jour file "
            + a_file_p->GetFileName() + sstr.str(), true);
    }
}

Here is the call graph for this function:

void fio_PermJourInfo_t::WriteInfo ( fio_File a_file_p  ) 

Definition at line 127 of file fio_JourFile.cpp.

References log_FUNC_m, and fio_File::PosWrite().

Referenced by fio_JourFile::fio_JourFile().

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

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 133 of file fio_JourFile.cpp.

                                                              {
    cmn_Time tjd(a_jh.JourDate, 0);
    cmn_Time tpjd(a_jh.PrevJourDate, 0);
    a_os << "************** Journal Header ***************"             << endl;
    a_os << "Structure version          = " << a_jh.recordStructVersion << endl;
    a_os << "Record size                = " << a_jh.recordSize          << endl;
    a_os << "Start trans struct version = " << a_jh.startTransVersion   << endl;
    a_os << "Start trans struct rec size= " << a_jh.startTransSize      << endl;
    a_os << "UV struct version          = " << a_jh.UVstructVersion     << endl;
    a_os << "UV struct rec size         = " << a_jh.UVstructSize        << endl;

    a_os << "Database ID                = " << a_jh.DataBaseID          << endl;
    a_os << "Journal date               = " << tjd.Time2YMDhms()        << endl;

    a_os << "Previous journal date      = " << tpjd.Time2YMDhms()       << endl;
    a_os << "Previous last trans num    = " << a_jh.PrevLastTransNumber << endl;
    a_os << "********** End Of Journal Header  ***********"             << endl;
    return a_os;
}


Member Data Documentation

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

Definition at line 138 of file fio_JourFile.h.

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

Time of journal file creation.

Definition at line 144 of file fio_JourFile.h.

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

Definition at line 152 of file fio_JourFile.h.

Previous journal date.

Definition at line 147 of file fio_JourFile.h.

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

Previous last transaction number.

Definition at line 150 of file fio_JourFile.h.

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

Definition at line 131 of file fio_JourFile.h.

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

Definition at line 130 of file fio_JourFile.h.

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

Definition at line 133 of file fio_JourFile.h.

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

Definition at line 132 of file fio_JourFile.h.

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

Definition at line 135 of file fio_JourFile.h.

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

Definition at line 134 of file fio_JourFile.h.

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


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