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

fsc_FRIunpacker Class Reference
[File System Catalog]

#include <fsc_FRIunpacker.h>

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

List of all members.

Public Member Functions

 fsc_FRIunpacker (fsc_DataLMgr &a_dataLMgr, UInt32_t a_cacheSize, ivd_MedVolNum_t a_medVolNum, ivd_MediaKey_t a_mediaKey, df_BlockProxy *a_reader)
 Recover process use cache and transaction object from dataLMgr Prerequsite: the transaction have to be started before Unpack is called().
virtual ~fsc_FRIunpacker ()
UInt32_t GetSplitCount ()

Public Attributes

 log_CLASSID_m
 Macro to add class name member s_className.

Private Member Functions

virtual void ProcSplitInfo (df_SplitInfo *a_splitInfo)
 when one split info is parsed then call ProcSplitInfo()

Private Attributes

fsc_DataLMgrm_dataLMgr
UInt32_t m_cacheSize
UInt32_t m_splitCount
 count all got splits per volume
UInt32_t m_chgPerTrans
 number of splits in last transaction Flush changes when its number exceed cache size * 2

Friends

ostream & operator<< (ostream &a_os, const fsc_FRIunpacker &a_friUnpack)

Detailed Description

Definition at line 42 of file fsc_FRIunpacker.h.


Constructor & Destructor Documentation

fsc_FRIunpacker::fsc_FRIunpacker ( fsc_DataLMgr a_dataLMgr,
UInt32_t  a_cacheSize,
ivd_MedVolNum_t  a_medVolNum,
ivd_MediaKey_t  a_mediaKey,
df_BlockProxy a_reader 
)

Recover process use cache and transaction object from dataLMgr Prerequsite: the transaction have to be started before Unpack is called().

Definition at line 50 of file fsc_FRIunpacker.cpp.

References g_DataLcache, log_FUNC_m, and stx_CacheArray< _MaxCacheSize >::Resize().

        :
        df_SplitInfoUnpacker(a_medVolNum,
                             a_mediaKey,
                             a_reader,
                             g_updateNSC),
        m_dataLMgr(a_dataLMgr),
        m_cacheSize(a_cacheSize),
        m_splitCount(0),
        m_chgPerTrans(0)
{
    log_FUNC_m(fsc_FRIunpacker);
    g_DataLcache.Resize(a_cacheSize);
}

Here is the call graph for this function:

fsc_FRIunpacker::~fsc_FRIunpacker (  )  [virtual]

Definition at line 71 of file fsc_FRIunpacker.cpp.

References log_FUNC_m.

                                  {
    log_FUNC_m(~fsc_FRIunpacker);
//    Bug 3800 & 5849: Destructor must not flush the changes. The cache may not 
//    be locked any more and it is possible that another process/thread has 
//    already changed its contents or size. The user of the class must flush the
//    cache at the right moment while the cache is still locked.
//    m_dataLMgr.FlushChangesAndCleanCache();
}


Member Function Documentation

UInt32_t fsc_FRIunpacker::GetSplitCount (  )  [inline]

Definition at line 73 of file fsc_FRIunpacker.h.

References m_splitCount.

Referenced by i_FSC_i::FSCRecovery().

{ return m_splitCount; };

Here is the caller graph for this function:

void fsc_FRIunpacker::ProcSplitInfo ( df_SplitInfo a_splitInfo  )  [private, virtual]

when one split info is parsed then call ProcSplitInfo()

Reimplemented from df_SplitInfoUnpacker.

Definition at line 81 of file fsc_FRIunpacker.cpp.

References fsc_DataLMgr::FastInsert(), fsc_DataLMgr::FlushChangesAndCleanCache(), m_cacheSize, m_chgPerTrans, m_dataLMgr, m_splitCount, and NULL.

                                                             {
//    log_FUNC_m(ProcSplitInfo);

    if (a_splitInfo != NULL) {
        m_splitCount++;
        m_dataLMgr.FastInsert(*a_splitInfo);
         // flush changes when its number exceed cache size * 2
         // it is useful for FSC Recovery
        if (++m_chgPerTrans >= (m_cacheSize * 2)) {
            m_chgPerTrans = 0;
            m_dataLMgr.FlushChangesAndCleanCache();
        }
    }
    else {
  //      cout << "End of stream." << endl;
    }
}

Here is the call graph for this function:


Friends And Related Function Documentation

ostream& operator<< ( ostream &  a_os,
const fsc_FRIunpacker a_friUnpack 
) [friend]

Definition at line 100 of file fsc_FRIunpacker.cpp.

                                                                  {
    a_os << "m_cacheSize : " << a_obj.m_cacheSize << endl
         << "m_splitCount : " << a_obj.m_splitCount << endl
         << "m_chgPerTrans : " << a_obj.m_chgPerTrans << endl
         << "df_SplitInfoUnpacker : ( " << *static_cast<const df_SplitInfoUnpacker*>(&a_obj)
         << " )";
    return a_os;
}


Member Data Documentation

Macro to add class name member s_className.

Reimplemented from df_SplitInfoUnpacker.

Reimplemented in fsc_FRIblockUnpacker.

Definition at line 71 of file fsc_FRIunpacker.h.

Definition at line 61 of file fsc_FRIunpacker.h.

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

number of splits in last transaction Flush changes when its number exceed cache size * 2

Definition at line 68 of file fsc_FRIunpacker.h.

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

Definition at line 58 of file fsc_FRIunpacker.h.

Referenced by ProcSplitInfo().

count all got splits per volume

Definition at line 64 of file fsc_FRIunpacker.h.

Referenced by GetSplitCount(), operator<<(), and ProcSplitInfo().


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