#include <fsc_FRIunpacker.h>


Definition at line 28 of file fsc_FRIunpacker.h.
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_DataLMgr & | m_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) |
| 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 36 of file fsc_FRIunpacker.cpp.
References g_DataLcache, log_FUNC_m, and stx_CacheArray< _MaxCacheSize >::Resize().
00042 : 00043 df_SplitInfoUnpacker(a_medVolNum, 00044 a_mediaKey, 00045 a_reader, 00046 g_updateNSC), 00047 m_dataLMgr(a_dataLMgr), 00048 m_cacheSize(a_cacheSize), 00049 m_splitCount(0), 00050 m_chgPerTrans(0) 00051 { 00052 log_FUNC_m(fsc_FRIunpacker); 00053 g_DataLcache.Resize(a_cacheSize); 00054 } //============================================================================//

| fsc_FRIunpacker::~fsc_FRIunpacker | ( | ) | [virtual] |
Definition at line 57 of file fsc_FRIunpacker.cpp.
References log_FUNC_m.
00057 { 00058 log_FUNC_m(~fsc_FRIunpacker); 00059 // Bug 3800 & 5849: Destructor must not flush the changes. The cache may not 00060 // be locked any more and it is possible that another process/thread has 00061 // already changed its contents or size. The user of the class must flush the 00062 // cache at the right moment while the cache is still locked. 00063 // m_dataLMgr.FlushChangesAndCleanCache(); 00064 }
| UInt32_t fsc_FRIunpacker::GetSplitCount | ( | ) | [inline] |
Definition at line 59 of file fsc_FRIunpacker.h.
References m_splitCount.
Referenced by i_FSC_i::FSCRecovery().
00059 { return m_splitCount; };

| 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 67 of file fsc_FRIunpacker.cpp.
References fsc_DataLMgr::FastInsert(), fsc_DataLMgr::FlushChangesAndCleanCache(), m_cacheSize, m_chgPerTrans, m_dataLMgr, m_splitCount, and NULL.
00067 { 00068 // log_FUNC_m(ProcSplitInfo); 00069 00070 if (a_splitInfo != NULL) { 00071 m_splitCount++; 00072 m_dataLMgr.FastInsert(*a_splitInfo); 00073 // flush changes when its number exceed cache size * 2 00074 // it is useful for FSC Recovery 00075 if (++m_chgPerTrans >= (m_cacheSize * 2)) { 00076 m_chgPerTrans = 0; 00077 m_dataLMgr.FlushChangesAndCleanCache(); 00078 } 00079 } 00080 else { 00081 // cout << "End of stream." << endl; 00082 } 00083 }

| ostream& operator<< | ( | ostream & | a_os, | |
| const fsc_FRIunpacker & | a_friUnpack | |||
| ) | [friend] |
Definition at line 86 of file fsc_FRIunpacker.cpp.
00086 { 00087 a_os << "m_cacheSize : " << a_obj.m_cacheSize << endl 00088 << "m_splitCount : " << a_obj.m_splitCount << endl 00089 << "m_chgPerTrans : " << a_obj.m_chgPerTrans << endl 00090 << "df_SplitInfoUnpacker : ( " << *static_cast<const df_SplitInfoUnpacker*>(&a_obj) 00091 << " )"; 00092 return a_os; 00093 }
fsc_DataLMgr& fsc_FRIunpacker::m_dataLMgr [private] |
UInt32_t fsc_FRIunpacker::m_cacheSize [private] |
UInt32_t fsc_FRIunpacker::m_splitCount [private] |
count all got splits per volume
Definition at line 50 of file fsc_FRIunpacker.h.
Referenced by GetSplitCount(), operator<<(), and ProcSplitInfo().
UInt32_t fsc_FRIunpacker::m_chgPerTrans [private] |
number of splits in last transaction Flush changes when its number exceed cache size * 2
Definition at line 54 of file fsc_FRIunpacker.h.
Referenced by operator<<(), and ProcSplitInfo().
Macro to add class name member s_className.
Reimplemented from df_SplitInfoUnpacker.
Reimplemented in fsc_FRIblockUnpacker.
Definition at line 57 of file fsc_FRIunpacker.h.
1.5.6