Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

fio_PermDBinfoMgr Class Reference
[Classes for large file i/o, relative file, and DataBase]

#include <fio_PermDBinfoMgr.h>

Inheritance diagram for fio_PermDBinfoMgr:
Inheritance graph
[legend]
Collaboration diagram for fio_PermDBinfoMgr:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 fio_PermDBinfoMgr (bool a_readOnly, fio_DataBaseID_t a_dbID, cmn_Path a_path, string a_name)
 ~fio_PermDBinfoMgr ()
struct fio_permDBinfo_tGetPermDBinfo ()
ivd_Time32_t GetJourDate ()
fio_DataBaseID_t GetDataBaseID ()
ivd_FileID_t GetLastJourFileID ()
ivd_TransNumber_t GetLastTransNumber ()
ivd_FilePosition_t GetPostTransPosition ()
ivd_FileID_t GetArhivedSyncJourFileID ()
ivd_FileID_t GetLastSyncJourFileID ()
ivd_FilePosition_t GetLastSyncPosition ()
void SetJourDate (ivd_Time32_t a_date)
void SetLastTransaction (ivd_TransNumber_t a_transNumber, ivd_FileID_t a_jourFileID, ivd_FilePosition_t a_postTransPosition)
void SetLastSyncPosition (ivd_FileID_t a_jourFileID, ivd_FilePosition_t a_currentJourPosition, bool a_forced)
void WriteInfo ()
 After DB is Synchroniyed than PDBI is update permanently.

Public Attributes

 log_CLASSID_m
 Macro for class name member.

Private Member Functions

void ReadInfo ()

Private Attributes

struct fio_permDBinfo_t m_permDBinfo
 permanent DB information
cmn_Mutex m_write_x
 atomic write to file

Detailed Description

Definition at line 277 of file fio_PermDBinfoMgr.h.


Constructor & Destructor Documentation

fio_PermDBinfoMgr::fio_PermDBinfoMgr ( bool  a_readOnly,
fio_DataBaseID_t  a_dbID,
cmn_Path  a_path,
string  a_name 
)

Definition at line 158 of file fio_permDBinfoMgr.cpp.

References fio_permDBinfo_t::CheckValidation(), dbg_NORM, cmn_Time::GetTime_t(), fio_permDBinfo_t::Init(), log_DBG_m, log_FUNC_m, m_permDBinfo, ReadInfo(), cmn_File::SeekEndF(), and WriteInfo().

                                     :
                                     fio_File(a_readOnly, 0, a_path, a_name) {
    log_FUNC_m(fio_PermDBinfoMgr);

    ivd_FilePosition_t fileSize = SeekEndF();
    if (fileSize == 0) { // new or empty file
        cmn_Time time;
        m_permDBinfo.Init(a_dbID, time.GetTime_t());
        WriteInfo();
    }
    else {
        ReadInfo();
        m_permDBinfo.CheckValidation(a_dbID);
    }
    log_DBG_m(dbg_NORM,  m_permDBinfo);    
}

Here is the call graph for this function:

fio_PermDBinfoMgr::~fio_PermDBinfoMgr (  )  [inline]

Definition at line 284 of file fio_PermDBinfoMgr.h.

{};


Member Function Documentation

ivd_FileID_t fio_PermDBinfoMgr::GetArhivedSyncJourFileID (  )  [inline]

Definition at line 306 of file fio_PermDBinfoMgr.h.

Referenced by fio_JourMgr::RemoveArhivedJourFile().

Here is the caller graph for this function:

fio_DataBaseID_t fio_PermDBinfoMgr::GetDataBaseID (  )  [inline]

Definition at line 301 of file fio_PermDBinfoMgr.h.

ivd_Time32_t fio_PermDBinfoMgr::GetJourDate (  )  [inline]

Definition at line 300 of file fio_PermDBinfoMgr.h.

{ return m_permDBinfo.JourDate;};

ivd_FileID_t fio_PermDBinfoMgr::GetLastJourFileID (  )  [inline]

Definition at line 302 of file fio_PermDBinfoMgr.h.

Referenced by fio_JourMgr::fio_JourMgr().

Here is the caller graph for this function:

ivd_FileID_t fio_PermDBinfoMgr::GetLastSyncJourFileID (  )  [inline]

Definition at line 308 of file fio_PermDBinfoMgr.h.

Referenced by fio_JourMgr::fio_JourMgr().

Here is the caller graph for this function:

ivd_FilePosition_t fio_PermDBinfoMgr::GetLastSyncPosition (  )  [inline]

Definition at line 309 of file fio_PermDBinfoMgr.h.

Referenced by fio_JourMgr::fio_JourMgr().

{ return m_permDBinfo.LastSyncPosition;};

Here is the caller graph for this function:

ivd_TransNumber_t fio_PermDBinfoMgr::GetLastTransNumber (  )  [inline]

Definition at line 303 of file fio_PermDBinfoMgr.h.

Referenced by fio_JourMgr::Replay().

Here is the caller graph for this function:

struct fio_permDBinfo_t* fio_PermDBinfoMgr::GetPermDBinfo (  )  [inline, read]

Definition at line 298 of file fio_PermDBinfoMgr.h.

Referenced by fio_JourMgr::AddNewJourFile(), and fio_JourMgr::fio_JourMgr().

{ return &m_permDBinfo;};

Here is the caller graph for this function:

ivd_FilePosition_t fio_PermDBinfoMgr::GetPostTransPosition (  )  [inline]

Definition at line 304 of file fio_PermDBinfoMgr.h.

{ return m_permDBinfo.PostTransPosition;};

void fio_PermDBinfoMgr::ReadInfo (  )  [private]

Definition at line 254 of file fio_permDBinfoMgr.cpp.

References log_FUNC_m, m_permDBinfo, cmn_File::ReadF(), and cmn_File::SeekF().

Referenced by fio_PermDBinfoMgr().

Here is the call graph for this function:

Here is the caller graph for this function:

void fio_PermDBinfoMgr::SetJourDate ( ivd_Time32_t  a_date  ) 
void fio_PermDBinfoMgr::SetLastSyncPosition ( ivd_FileID_t  a_jourFileID,
ivd_FilePosition_t  a_currentJourPosition,
bool  a_forced 
)

Definition at line 222 of file fio_permDBinfoMgr.cpp.

References fio_permDBinfo_t::ArchivedSyncJourFileID, dbg_NORM, fio_permDBinfo_t::LastSyncJourFileID, cmn_Mutex::Lock(), log_DBG_m, log_FUNC_m, m_permDBinfo, m_write_x, cmn_Mutex::Unlock(), and WriteInfo().

Referenced by fio_JourMgr::SetLastSyncPosition().

{
    log_FUNC_m(SetLastSyncPosition);
    m_write_x.Lock();
    m_permDBinfo.LastSyncJourFileID = a_jourFileID;
    m_permDBinfo.LastSyncPosition   = a_currentJourPosition;
    if (a_forced) {
        m_permDBinfo.ArchivedSyncJourFileID = a_jourFileID;
        m_permDBinfo.ArchivedSyncPosition   = a_currentJourPosition;
    }
    WriteInfo();
    log_DBG_m(dbg_NORM, "Set last Sync position." 
                     << " a_forced: " << boolalpha << a_forced);
                     
    log_DBG_m(dbg_NORM,  m_permDBinfo);    
    m_write_x.Unlock();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void fio_PermDBinfoMgr::SetLastTransaction ( ivd_TransNumber_t  a_transNumber,
ivd_FileID_t  a_jourFileID,
ivd_FilePosition_t  a_postTransPosition 
)

Definition at line 201 of file fio_permDBinfoMgr.cpp.

References dbg_DETAIL, fio_permDBinfo_t::LastJourFileID, fio_permDBinfo_t::LastTransNumber, cmn_Mutex::Lock(), log_DBG_m, log_FUNC_m, m_permDBinfo, m_write_x, cmn_Mutex::Unlock(), and WriteInfo().

Referenced by fio_JourMgr::ReleaseWaiters().

{
    log_FUNC_m(SetLastTransaction);
    m_write_x.Lock();

    log_DBG_m(dbg_DETAIL, "Commit up to trans num " << a_transNumber <<
                          " JourFileID " << a_jourFileID <<
                          " JourPosition = " << a_postTransPosition );
    m_permDBinfo.LastTransNumber   = a_transNumber; 
    m_permDBinfo.LastJourFileID    = a_jourFileID;
    m_permDBinfo.PostTransPosition = a_postTransPosition;

    WriteInfo();
    m_write_x.Unlock();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void fio_PermDBinfoMgr::WriteInfo (  ) 

After DB is Synchroniyed than PDBI is update permanently.

Definition at line 246 of file fio_permDBinfoMgr.cpp.

References log_FUNC_m, m_permDBinfo, cmn_File::SeekF(), and cmn_File::WriteF().

Referenced by fio_PermDBinfoMgr(), SetJourDate(), SetLastSyncPosition(), and SetLastTransaction().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Macro for class name member.

Reimplemented from fio_File.

Definition at line 295 of file fio_PermDBinfoMgr.h.

permanent DB information

Definition at line 288 of file fio_PermDBinfoMgr.h.

Referenced by fio_PermDBinfoMgr(), ReadInfo(), SetJourDate(), SetLastSyncPosition(), SetLastTransaction(), and WriteInfo().

atomic write to file

Definition at line 291 of file fio_PermDBinfoMgr.h.

Referenced by SetJourDate(), SetLastSyncPosition(), and SetLastTransaction().


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