Public Member Functions | Public Attributes | Friends

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

#include <fio_PermDBinfoMgr.h>

Collaboration diagram for fio_permDBinfo_t:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void IVD_FILEIO_DECL_d Init (fio_DataBaseID_t a_DataBaseID, ivd_Time32_t a_JourDate)
void CheckValidation (fio_DataBaseID_t a_dbID)
bool IsSynchonized ()
bool IVD_FILEIO_DECL_d To64Bit ()
 Convert 32 bit variant of structure data to 64 bit variant, returns true on success, false otherwise.
 ivd_ALIGNDUMMY32 (reserved2) ivd_FilePosition_t PostTransPosition
 pointer to the end of last transaction commited
 ivd_ALIGNDUMMY32 (reserved3) ivd_FilePosition_t LastSyncPosition
 Last synchronization pointer into journal file.
 ivd_ALIGNDUMMY32 (reserved4) ivd_FilePosition_t ArchivedSyncPosition
 Archived Sync position.

Public Attributes

UInt16_t recordStructVersion
UInt16_t recordSize
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_TransNumber_t LastTransNumber
 Which transaction is already committed. It's reset after archive.
ivd_FileID_t LastJourFileID
 Journal file ID, used to know into which jourfile is last transaction commited.
ivd_FileID_t LastSyncJourFileID
 Last synchronization Journal file ID.
UInt32_t ArchivedSyncJourFileID
 Archived journal File ID.
 log_CLASSID_m

Friends

IVD_FILEIO_DECL_d ostream & operator<< (ostream &a_os, fio_permDBinfo_t &a_pdbi)

Detailed Description

Definition at line 76 of file fio_PermDBinfoMgr.h.


Member Function Documentation

void fio_permDBinfo_t::CheckValidation ( fio_DataBaseID_t  a_dbID  ) 

Definition at line 103 of file fio_permDBinfoMgr.cpp.

References DataBaseID, dbg_LOW, fio_PERM_DB_INFO_STRUCT_VERSION_d, ie_PERM_DB_INFO_HEADER_INV, ivd_Error, log_DBG_m, log_FUNC_m, recordSize, and recordStructVersion.

Referenced by fio_PermDBinfoMgr::fio_PermDBinfoMgr().

                                                              {
    log_FUNC_m(CheckValidation);
    
    if (recordStructVersion != fio_PERM_DB_INFO_STRUCT_VERSION_d) {
        throw ivd_Error(ie_PERM_DB_INFO_HEADER_INV, 
            "Record structure version mismatch.", true);
    }
    
    if (recordSize != sizeof(fio_permDBinfo_t) ) {
        throw ivd_Error(ie_PERM_DB_INFO_HEADER_INV, 
            "Record size mismatch.", true);
    }

    if (!(DataBaseID == a_dbID)) {
        log_DBG_m(dbg_LOW,"DataBaseID:" << DataBaseID <<
                            " a_dbID:" << a_dbID);

        throw ivd_Error(ie_PERM_DB_INFO_HEADER_INV, 
            "Database ID mismatch.", true);
    }
}

Here is the caller graph for this function:

void fio_permDBinfo_t::Init ( fio_DataBaseID_t  a_DataBaseID,
ivd_Time32_t  a_JourDate 
)

Definition at line 74 of file fio_permDBinfoMgr.cpp.

References ArchivedSyncJourFileID, DataBaseID, JourDate, LastJourFileID, LastSyncJourFileID, LastTransNumber, log_FUNC_m, recordSize, and recordStructVersion.

Referenced by ClearPDBI(), and fio_PermDBinfoMgr::fio_PermDBinfoMgr().

          {
    log_FUNC_m(Init);

    recordStructVersion = fio_PERM_DB_INFO_STRUCT_VERSION_d;
    recordSize          = sizeof(fio_permDBinfo_t);
    DataBaseID          = a_DataBaseID;
    JourDate            = a_JourDate;
    LastTransNumber         = 0;
    LastJourFileID          = 0;
    PostTransPosition       = 0;
    LastSyncJourFileID      = 0;
    LastSyncPosition        = 0;
    ArchivedSyncJourFileID        = 0;
    ArchivedSyncPosition = 0;


//    LastTransNumber     = a_LastTransNumber;

}

Here is the caller graph for this function:

bool fio_permDBinfo_t::IsSynchonized (  )  [inline]

Definition at line 85 of file fio_PermDBinfoMgr.h.

References LastJourFileID, and LastSyncJourFileID.

                         {
        return (   (LastSyncPosition   == PostTransPosition)
               &&  (LastSyncJourFileID == LastJourFileID));
    };

fio_permDBinfo_t::ivd_ALIGNDUMMY32 ( reserved2   ) 

pointer to the end of last transaction commited

fio_permDBinfo_t::ivd_ALIGNDUMMY32 ( reserved4   ) 

Archived Sync position.

fio_permDBinfo_t::ivd_ALIGNDUMMY32 ( reserved3   ) 

Last synchronization pointer into journal file.

bool fio_permDBinfo_t::To64Bit (  ) 

Convert 32 bit variant of structure data to 64 bit variant, returns true on success, false otherwise.

Definition at line 128 of file fio_permDBinfoMgr.cpp.

References ArchivedSyncJourFileID, fio_permDBinfo32_t::fields, fio_PERM_DB_INFO_STRUCT_VERSION_d, JourDate, LastJourFileID, LastSyncJourFileID, LastTransNumber, log_FUNC_m, recordSize, and recordStructVersion.

Referenced by GetPDBI().

                               {
    log_FUNC_m(fio_permDBinfo_t::To64Bit);

    if(recordSize == 68 && sizeof(*this) == 88 && recordStructVersion == fio_PERM_DB_INFO_STRUCT_VERSION_d) {
        fio_permDBinfo32_t tmp;
        memcpy(&tmp, this, sizeof(tmp));

        JourDate = tmp.fields[0];
        UInt32_t* target = reinterpret_cast<UInt32_t*>(&LastTransNumber);
        target[0] = tmp.fields[1];
        target[1] = tmp.fields[2];
        LastJourFileID = tmp.fields[3];
        target = reinterpret_cast<UInt32_t*>(&PostTransPosition);
        target[0] = tmp.fields[4];
        target[1] = tmp.fields[5];
        LastSyncJourFileID = tmp.fields[6];
        target = reinterpret_cast<UInt32_t*>(&LastSyncPosition);
        target[0] = tmp.fields[7];
        target[1] = tmp.fields[8];
        ArchivedSyncJourFileID = tmp.fields[9];
        target = reinterpret_cast<UInt32_t*>(&ArchivedSyncPosition);
        target[0] = tmp.fields[10];
        target[1] = tmp.fields[11];
        return true;
    }
    return false;
}

Here is the caller graph for this function:


Friends And Related Function Documentation

IVD_FILEIO_DECL_d ostream& operator<< ( ostream &  a_os,
fio_permDBinfo_t a_pdbi 
) [friend]

Definition at line 262 of file fio_permDBinfoMgr.cpp.

                                                              {
    cmn_Time tjd(a_pdbi.JourDate, 0);
    
    a_os << "***** Permanent Database Information ***************"              << endl;
    a_os << "Structure version          = " << a_pdbi.recordStructVersion  << endl;
    a_os << "Record size                = " << a_pdbi.recordSize  << endl;
    a_os << "Database ID                = " << a_pdbi.DataBaseID  << endl;
    a_os << "Journal date               = " << tjd.Time2YMDhms()  << endl;
    a_os << "Num. of last trans. in DB  = " << a_pdbi.LastTransNumber  << endl;
    a_os << "Last journal file ID       = 0x" << hex << a_pdbi.LastJourFileID << dec << endl;
    a_os << "Pos. after last trans in DB= " << a_pdbi.PostTransPosition  << endl;
    a_os << "Last jou fileID after sync = 0x" << hex << a_pdbi.LastSyncJourFileID << dec << endl;
    a_os << "Pos. where last sync occure= " << a_pdbi.LastSyncPosition  << endl;
    a_os << "Archive sync jour file ID  = 0x" << hex << a_pdbi.ArchivedSyncJourFileID << dec << endl;
    a_os << "Archive sync position      = " << a_pdbi.ArchivedSyncPosition  << endl;
    a_os << "***** End Of Permanent Database Information ********"              << endl;
    return a_os;
}


Member Data Documentation

Archived journal File ID.

Definition at line 127 of file fio_PermDBinfoMgr.h.

Referenced by Init(), fio_PermJourInfo_t::Init(), main(), operator<<(), fio_PermDBinfoMgr::SetLastSyncPosition(), and To64Bit().

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

Definition at line 96 of file fio_PermDBinfoMgr.h.

Referenced by CheckValidation(), ClearPDBI(), Init(), fio_PermJourInfo_t::Init(), main(), and operator<<().

Time of journal file creation.

Definition at line 102 of file fio_PermDBinfoMgr.h.

Referenced by Init(), fio_PermJourInfo_t::Init(), main(), operator<<(), fio_PermDBinfoMgr::SetJourDate(), and To64Bit().

Journal file ID, used to know into which jourfile is last transaction commited.

Definition at line 108 of file fio_PermDBinfoMgr.h.

Referenced by Init(), IsSynchonized(), main(), operator<<(), fio_PermDBinfoMgr::SetLastTransaction(), and To64Bit().

Last synchronization Journal file ID.

The last sync info is useful for startup while UV buffers need to be created. There is no UV in buffer at sync time. Thus, traversing journal file could be startet at lastsync pointers.

Definition at line 119 of file fio_PermDBinfoMgr.h.

Referenced by Init(), IsSynchonized(), main(), operator<<(), fio_PermDBinfoMgr::SetLastSyncPosition(), and To64Bit().

Which transaction is already committed. It's reset after archive.

Definition at line 105 of file fio_PermDBinfoMgr.h.

Referenced by Init(), main(), operator<<(), fio_PermDBinfoMgr::SetLastTransaction(), and To64Bit().

Definition at line 133 of file fio_PermDBinfoMgr.h.

Definition at line 94 of file fio_PermDBinfoMgr.h.

Referenced by CheckValidation(), Init(), main(), operator<<(), and To64Bit().

Definition at line 93 of file fio_PermDBinfoMgr.h.

Referenced by CheckValidation(), Init(), main(), operator<<(), and To64Bit().


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