fsc_SplitMgr Class Reference
[File System Catalog]

#include <fsc_SplitMgr.h>

Inheritance diagram for fsc_SplitMgr:

Inheritance graph
[legend]
Collaboration diagram for fsc_SplitMgr:

Collaboration graph
[legend]

List of all members.


Detailed Description

<Description:> A more elaborate class description that describes all aspects of class usage etc.

Author:
Dejan Volk Lupo, HERMES SoftLab
See also:
<reference>

Definition at line 55 of file fsc_SplitMgr.h.


Public Member Functions

 fsc_SplitMgr (df_SplitInfo &a_splitInfo)
 fsc_SplitMgr (fsc_Split *a_split_p)
 fsc_SplitMgr (Int16_t a_numOfElement, ivd_RecordIDX_t a_splitIdx)
 fsc_SplitMgr ()
virtual ~fsc_SplitMgr ()
sp_State_e AddSplit (fsc_Split *a_split_p, fsc_Split_p_l_i &a_possibleInsertPoint, fsc_Split_p_l_t &a_replacedSplit_p_l)
void RemoveEntry (ivd_MediaKey_t a_mediumKey, ivd_MedVolNum_t a_medVolNum)
 remove entries from particular volume.
bool Remove (ivd_MediaKey_t a_mediumKey, ivd_MedVolNum_t a_medVolNum, fsc_Split_p_l_t &a_replacedSplit_p_l)
 remove entries from particular volume.
bool RemoveEntry (ivd_MediaKey_t a_mediumKey, ivd_MedVolNum_t a_medVolNum, UInt32_t a_blockOffs)
 remove particular entry.
bool Remove (ivd_MediaKey_t a_mediumKey, ivd_MedVolNum_t a_medVolNum, UInt32_t a_blockOffs, fsc_Split_p_l_t &a_replacedSplit_p_l)
 remove particular entry.
bool HasIntersection (df_SplitInfo &a_splitInfo)
 check if some of split has common parts of data with splitInfo
bool HasEqualSplit (df_SplitInfo &a_splitInfo)
void GetMediaPos (ivd_MediaPos_v_t &a_mediaPos_v, fsc_MigInfo_t &a_migInfo)
 Get all media position from copy.
bool Write2DB (fsc_NextEntity_t &a_nextEntry, fio_Transaction &a_trans)
void Dump (ostream &os)
bool TreeWalk (fsc_Collector &a_collector)

Public Attributes

fsc_Split_p_l_t m_split_p_l
 log_CLASSID_m

Private Attributes

fio_RelFileTransm_relFile
 this is pointer to relative file "fsc_xxxx.lrf" object.

Friends

class ut_fsc_SplitMgr

Constructor & Destructor Documentation

fsc_SplitMgr::fsc_SplitMgr ( df_SplitInfo a_splitInfo  ) 

Definition at line 45 of file fsc_SplitMgr.cpp.

References fsc_SplitMgr(), log_FUNC_m, and m_split_p_l.

00047             :
00048             m_relFile(*g_splitRF_p)
00049 {
00050     log_FUNC_m(fsc_SplitMgr(df_SplitInfo));
00051 
00052     // add new split
00053     fsc_Split* split_p = new fsc_Split(a_splitInfo);
00054 
00055     // first element is always sortted
00056     m_split_p_l.push_back(split_p);
00057 }
//============================================================================*/

Here is the call graph for this function:

fsc_SplitMgr::fsc_SplitMgr ( fsc_Split a_split_p  ) 

Definition at line 60 of file fsc_SplitMgr.cpp.

References fsc_SplitMgr(), log_FUNC_m, and m_split_p_l.

00061             :
00062             m_relFile(*g_splitRF_p)
00063 {
00064     log_FUNC_m(fsc_SplitMgr(fsc_Split));
00065 
00066     m_split_p_l.push_back(a_split_p);
00067 }
//============================================================================//

Here is the call graph for this function:

fsc_SplitMgr::fsc_SplitMgr ( Int16_t  a_numOfElement,
ivd_RecordIDX_t  a_splitIdx 
)

Definition at line 70 of file fsc_SplitMgr.cpp.

References alloca(), cmn_HexDump(), dbg_DETAIL, dlc_NotUsed, fsc_NextEntity_t::dlcType, fsc_SplitMgr(), log_DBG_m, log_FUNC_m, m_relFile, m_split_p_l, fsc_Split_t::nextEntity, and fio_RelFile::ReadRec().

00073             :
00074             fsc_EntryMgr(a_numOfElement, a_splitIdx),
00075             m_relFile(*g_splitRF_p)
00076 {
00077     log_FUNC_m(fsc_SplitMgr(Int16_t.));
00078 //    log_DBG_m(dbg_DETAIL,"Get " << a_numOfElement
00079 //                      << " split from idx " << a_splitIdx);
00080 
00081     if (a_numOfElement > 0) {
00082         fsc_Split_t *splitData_v = reinterpret_cast<fsc_Split_t*>
00083                                     (alloca(a_numOfElement * sizeof(fsc_Split_t)));
00084 
00085         fsc_Split_t *p    =  splitData_v;
00086         fsc_Split_t *endp = &splitData_v[a_numOfElement];
00087 
00088         m_relFile.ReadRec(a_splitIdx, splitData_v, a_numOfElement);
00089         log_DBG_m(dbg_DETAIL, "R Splits from = " << a_splitIdx << endl <<
00090         cmn_HexDump(splitData_v, a_numOfElement * sizeof(fsc_Split_t), sizeof(fsc_Split_t), false) );
00091 
00092         for (; p < endp; p++) {
00093             if (p->nextEntity.dlcType != dlc_NotUsed) {  // only used records add to list
00094                 fsc_Split* split_p = new fsc_Split(*p);
00095                 m_split_p_l.push_back(split_p);
00096             }
00097         }
00098     }
00099 }
//============================================================================//

Here is the call graph for this function:

fsc_SplitMgr::fsc_SplitMgr (  ) 

Referenced by fsc_SplitMgr().

Here is the caller graph for this function:

fsc_SplitMgr::~fsc_SplitMgr (  )  [virtual]

Definition at line 102 of file fsc_SplitMgr.cpp.

References m_split_p_l.

00103 {
00104     for (fsc_Split_p_l_i iter = m_split_p_l.begin();
00105          iter != m_split_p_l.end();
00106          iter++) {
00107         delete *iter;
00108     }
00109 }


Member Function Documentation

sp_State_e fsc_SplitMgr::AddSplit ( fsc_Split a_split_p,
fsc_Split_p_l_i a_possibleInsertPoint,
fsc_Split_p_l_t a_replacedSplit_p_l 
)

Definition at line 112 of file fsc_SplitMgr.cpp.

References assert, dbg_DETAIL, fsc_Split::GetMediaPosMgr(), fsc_Split::HasIntersection(), fsc_Split::IsSplitEqual(), fsc_Split::IsZeroSizeSplit(), log_DBG_m, log_FUNC_m, fsc_MedPosMgr::m_mediaKey, fsc_Split::m_offset, fsc_Split::m_size, m_split_p_l, sp_ALREADY_ADDED, sp_CHECK_OTHER_COPIES, sp_INSERTTED, sp_NEW_COPY, and sp_REPLACE.

Referenced by fsc_Copy::AddSplit(), and fsc_Generation::Insert().

00114                                                                         {
00115     log_FUNC_m(AddSplit);
00116     assert(m_split_p_l.size() > 0);
00117 
00118     ivd_FilePosition_t  addedSplitOffset = a_split_p->m_offset;
00119     fsc_Split_p_l_i iter  = m_split_p_l.begin();
00120     UInt32_t prevMediaKey = 0;
00121     Int64_t splitOffset   = 0;
00122 
00123     log_DBG_m(dbg_DETAIL, "add split " << *a_split_p);
00124 
00125     fsc_Split *s = *iter;
00126 
00127     // Do not update FSC if split size is 0 and it is not ADS
00128     if (a_split_p->IsZeroSizeSplit()) {
00129         return sp_ALREADY_ADDED;
00130     }
00131 
00132     // split will be inserted before selected object
00133     // so find proper one
00134     for (;
00135          iter != m_split_p_l.end();
00136          iter++) {
00137         s = *iter;
00138 
00139         log_DBG_m(dbg_DETAIL, "compare split " << *s);
00140 
00141         if (s->m_offset == addedSplitOffset) {
00142             if (s->IsSplitEqual(*a_split_p)) {
00143                 return sp_ALREADY_ADDED;
00144             }
00145             if (s->m_size == 0) { // What if many different splits has size 0? example ADS
00146                 if (a_split_p->m_size == 0) { // only one zero sized split is posible on same place
00147                     return sp_NEW_COPY;
00148                 }
00149                 log_DBG_m(dbg_DETAIL, "Current split size is 0.");
00150                 prevMediaKey = s->GetMediaPosMgr().m_mediaKey;
00151                 continue;
00152             }
00153             splitOffset = s->m_offset;
00154             break;
00155         }
00156         else if (s->m_offset > addedSplitOffset) {
00157             // intersection cannnot be checked, current split may be intruder.
00158 
00159             // split FIX after permutation test
00160             splitOffset = s->m_offset;
00161             break;
00162         }
00163         prevMediaKey = s->GetMediaPosMgr().m_mediaKey;
00164     }
00165 
00166     log_DBG_m(dbg_DETAIL, "prevMediaKey = " << prevMediaKey
00167                          << " splitOffset " << splitOffset
00168                          << " addedSplitOffset " << addedSplitOffset);
00169 
00170     if (iter == m_split_p_l.begin()) {// add-Split is infront of others
00171         log_DBG_m(dbg_DETAIL, "addSplit:  add-Split is infront of others");
00172       //  if (splitOffset == addedSplitOffset) {
00173             //if (s->IsSplitEqual(*a_split_p)) {
00174             //    return sp_ALREADY_ADDED;
00175             //}
00176             //else {
00177             //   return sp_NEW_COPY;
00178             //}
00179        //     }
00180        // else
00181         if (s->HasIntersection(*a_split_p)){
00182             log_DBG_m(dbg_DETAIL, "addSplit: has intersection" );
00183             return sp_NEW_COPY;
00184         }
00185         else if (s->GetMediaPosMgr().m_mediaKey == a_split_p->GetMediaPosMgr().m_mediaKey) {
00186                 log_DBG_m(dbg_DETAIL, "addSplit: next mediaKey match "
00187                         << a_split_p->GetMediaPosMgr().m_mediaKey);
00188             if (splitOffset == addedSplitOffset + a_split_p->m_size) {
00189                 log_DBG_m(dbg_DETAIL, "addSplit: splitOffset == addedSplitOffset + a_split_p->m_size "
00190                         <<  splitOffset);
00191                 // insert it match offset and medium
00192                 m_split_p_l.insert(iter, a_split_p);
00193                 return sp_INSERTTED;
00194             }
00195             else {
00196                 a_possibleInsertPoint = iter;
00197                 return sp_CHECK_OTHER_COPIES;
00198             }
00199         }
00200         else {
00201             a_possibleInsertPoint = iter;
00202             return sp_CHECK_OTHER_COPIES;
00203         }
00204     }
00205 
00206     if (iter == m_split_p_l.end()) { // add-split is last in sequence
00207         // s point to previous split FIX after permutation test
00208         if (s->HasIntersection(*a_split_p)){
00209             return sp_NEW_COPY;
00210         }
00211 
00212         log_DBG_m(dbg_DETAIL, "addSplit:  add-Split is last in sequence");
00213         log_DBG_m(dbg_DETAIL, "addSplit:  s->m_offset + s->m_size = "
00214                 << s->m_offset + s->m_size );
00215         if (s->m_offset + s->m_size == addedSplitOffset) {
00216             log_DBG_m(dbg_DETAIL, "addSplit: sprev->m_offset + sprev->m_size == addedSplitOffset match");
00217             log_DBG_m(dbg_DETAIL, "addSplit: a_split_p->mediaKey = "
00218                 << a_split_p->GetMediaPosMgr().m_mediaKey);
00219             if (prevMediaKey == a_split_p->GetMediaPosMgr().m_mediaKey) {
00220 #if TGT_OS_linux
00221     #warning add volnumber check when reorganization take place
00222 #elif TGT_OS_windows
00223     #pragma message ("WARNING: Add volnumber check when reorganization take place.")
00224 #endif
00225                 log_DBG_m(dbg_DETAIL, "previous mediaKey match ");
00226                 m_split_p_l.insert(iter, a_split_p);
00227                 return sp_INSERTTED;
00228             }
00229             else {
00230             a_possibleInsertPoint = iter;
00231                 return sp_CHECK_OTHER_COPIES;
00232             }
00233         }
00234         else {
00235             a_possibleInsertPoint = iter;
00236             return sp_CHECK_OTHER_COPIES;
00237         }
00238     }
00239 
00240     fsc_Split_p_l_i prev = iter;
00241     fsc_Split *sprev = *(--prev);
00242 
00243     log_DBG_m(dbg_DETAIL, "addSplit:  add-Split is between others");
00244     if (sprev->m_offset + sprev->m_size == addedSplitOffset) { // new split is in sequence
00245         // FIX after permutation test
00246         // s point to split with >= offset
00247         if (  s->m_offset == addedSplitOffset // s has size > 0, see for sentance above.
00248            && a_split_p->m_size > 0) { // already bind together
00249             return sp_NEW_COPY;
00250         }
00251 
00252         if (s->HasIntersection(*a_split_p)) { // has intersections with next split
00253             m_split_p_l.insert(iter, a_split_p);
00254 
00255             Int64_t remSplitOffset;
00256             do {  // all splits that are linked together with removed split must be removed too.
00257                 a_replacedSplit_p_l.push_back(*iter);
00258                 remSplitOffset = (*iter)->m_offset + (*iter)->m_size;
00259                 m_split_p_l.erase(iter++);
00260             } while (  iter != m_split_p_l.end()
00261                  && (*iter)->m_offset == remSplitOffset);
00262 
00263             return sp_REPLACE;
00264         }
00265         else {
00266             if (s->m_offset == a_split_p->m_offset + a_split_p->m_size) {
00267                 m_split_p_l.insert(iter, a_split_p);
00268                 return sp_INSERTTED;
00269             }
00270             else {
00271                 if (sprev->HasIntersection(*a_split_p)) {
00272                     return sp_NEW_COPY;
00273                 }
00274                 else {
00275                     a_possibleInsertPoint = iter;
00276                     return sp_CHECK_OTHER_COPIES;
00277                 }
00278             }
00279         }
00280     }
00281     else {
00282         if (   (s->HasIntersection(*a_split_p) )
00283             || (sprev->HasIntersection(*a_split_p) ) ) {
00284             return sp_NEW_COPY;
00285         }
00286         else {
00287             a_possibleInsertPoint = iter;
00288             return sp_CHECK_OTHER_COPIES;
00289         }
00290     }
00291 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fsc_SplitMgr::RemoveEntry ( ivd_MediaKey_t  a_mediumKey,
ivd_MedVolNum_t  a_medVolNum 
)

remove entries from particular volume.

Can be called from Generation. NO copies.

Definition at line 294 of file fsc_SplitMgr.cpp.

References log_FUNC_m, and m_split_p_l.

Referenced by fsc_Generation::Remove(), and RemoveEntry().

00295                                                              {
00296     log_FUNC_m(RemoveEntry);
00297     fsc_Split_p_l_i iter = m_split_p_l.begin();
00298     for (;iter != m_split_p_l.end(); iter++) {
00299         (**iter).Remove(a_mediumKey, a_medVolNum);
00300     }
00301 }

Here is the caller graph for this function:

bool fsc_SplitMgr::Remove ( ivd_MediaKey_t  a_mediumKey,
ivd_MedVolNum_t  a_medVolNum,
fsc_Split_p_l_t a_replacedSplit_p_l 
)

remove entries from particular volume.

Return true if some split is removed.

Definition at line 318 of file fsc_SplitMgr.cpp.

References log_FUNC_m, and m_split_p_l.

Referenced by Remove(), and fsc_Copy::Remove().

00320                                                                 {
00321     log_FUNC_m(Remove);
00322     fsc_Split_p_l_i iter = m_split_p_l.begin();
00323     for (;iter != m_split_p_l.end(); iter++) {
00324         // if removed then all other splits have to be re insert
00325         if ((**iter).Remove(a_mediumKey, a_medVolNum)) {
00326             fsc_Split_p_l_i i = m_split_p_l.begin();
00327             while (i != m_split_p_l.end()) {
00328                 if (i != iter) {
00329                     // check if other split are on removable volume
00330                     if (!(**i).Remove(a_mediumKey, a_medVolNum)) {
00331                         a_replacedSplit_p_l.push_back(*i);
00332                         // NOTE, erase with post increment
00333                         // erase() use copy of i and i is incremented before erase() is called
00334                         m_split_p_l.erase(i++);
00335                         continue; // already incremented
00336                     }
00337                 }
00338                 ++i;
00339             }
00340             return true;
00341         }
00342     }
00343     return false;
00344 }

Here is the caller graph for this function:

bool fsc_SplitMgr::RemoveEntry ( ivd_MediaKey_t  a_mediumKey,
ivd_MedVolNum_t  a_medVolNum,
UInt32_t  a_blockOffs 
)

remove particular entry.

Can be called from Generation. NO copies.

Definition at line 304 of file fsc_SplitMgr.cpp.

References log_FUNC_m, m_split_p_l, and RemoveEntry().

00306                                                              {
00307     log_FUNC_m(RemoveEntry(elem));
00308     fsc_Split_p_l_i iter = m_split_p_l.begin();
00309     for (;iter != m_split_p_l.end(); iter++) {
00310         if ((**iter).Remove(a_mediumKey, a_medVolNum, a_blockOffs)) {
00311             return true;
00312         }
00313     }
00314     return false;
00315 }

Here is the call graph for this function:

bool fsc_SplitMgr::Remove ( ivd_MediaKey_t  a_mediumKey,
ivd_MedVolNum_t  a_medVolNum,
UInt32_t  a_blockOffs,
fsc_Split_p_l_t a_replacedSplit_p_l 
)

remove particular entry.

Return true if some split is removed.

Definition at line 347 of file fsc_SplitMgr.cpp.

References log_FUNC_m, m_split_p_l, and Remove().

00350                                                                {
00351     log_FUNC_m(Remove);
00352     fsc_Split_p_l_i iter = m_split_p_l.begin();
00353     for (;iter != m_split_p_l.end(); iter++) {
00354         // if removed then all other splits have to be re insert
00355         if ((**iter).Remove(a_mediumKey, a_medVolNum, a_blockOffs)) {
00356             fsc_Split_p_l_i i = m_split_p_l.begin();
00357             while (i != m_split_p_l.end()) {
00358                 if (i != iter) {
00359                     a_replacedSplit_p_l.push_back(*i);
00360                     // NOTE, erase with post increment
00361                     // erase() use copy of i and i is incremented before erase() is called
00362                     m_split_p_l.erase(i++);
00363                     continue; // already incremented
00364                 }
00365                 ++i;
00366             }
00367             return true;
00368         }
00369     }
00370     return false;
00371 }

Here is the call graph for this function:

bool fsc_SplitMgr::HasIntersection ( df_SplitInfo a_splitInfo  ) 

check if some of split has common parts of data with splitInfo

Definition at line 374 of file fsc_SplitMgr.cpp.

References log_FUNC_m, and m_split_p_l.

00374                                                              {
00375     log_FUNC_m(HasIntersection);
00376 
00377     fsc_Split_p_l_i iter = m_split_p_l.begin();
00378     for (;iter != m_split_p_l.end(); iter++) {
00379         if ((*iter)->HasIntersection(a_splitInfo)) {
00380             return true;
00381         }
00382     }
00383     return false;
00384 }

bool fsc_SplitMgr::HasEqualSplit ( df_SplitInfo a_splitInfo  ) 

Definition at line 387 of file fsc_SplitMgr.cpp.

References log_FUNC_m, and m_split_p_l.

00387                                                            {
00388     log_FUNC_m(HasEqualSplit);
00389 
00390     fsc_Split_p_l_i iter = m_split_p_l.begin();
00391     for (;iter != m_split_p_l.end(); iter++) {
00392         if ((*iter)->HasEqualSplit(a_splitInfo)) {
00393             return true;
00394         }
00395     }
00396     return false;
00397 }

void fsc_SplitMgr::GetMediaPos ( ivd_MediaPos_v_t a_mediaPos_v,
fsc_MigInfo_t a_migInfo 
)

Get all media position from copy.

Definition at line 400 of file fsc_SplitMgr.cpp.

References dbg_DETAIL, dlc_NotUsed, fsc_NextEntity_t::dlcType, fsc_Split::GetMediaPos(), ivd_DATA_d, log_DBG_m, log_FUNC_m, fsc_Split::m_dataType, fsc_MigInfo_t::m_fileId, fsc_MigInfo_t::m_migId, fsc_Entry::m_nextEntry, fsc_Split::m_offset, fsc_MigInfo_t::m_size, fsc_Split::m_size, m_split_p_l, and cmn_Time::Time2YMDhms().

Referenced by fsc_Generation::GetCopiesPos(), and fsc_Copy::GetMediaPos().

00400                                                                                        {
00401     log_FUNC_m(GetCopiesPos);
00402     //FIX bug 690  reserve space not alocate
00403     a_mediaPos_v.reserve(m_split_p_l.size());
00404 
00405     ivd_FilePosition_t fileOffset = 0; // to check if all splits are collected and in sequence
00406     int i = 0;
00407     for (fsc_Split_p_l_i iter = m_split_p_l.begin();
00408          iter != m_split_p_l.end();
00409          iter++, i++) {
00410         fsc_Split &s = (**iter);
00411         if (fileOffset != s.m_offset) {
00412             goto missingSplit;
00413         }
00414         fileOffset += s.m_size;
00415         log_DBG_m(dbg_DETAIL," Splits's record type " << (int)s.m_nextEntry.dlcType
00416                             << " data type " << s.m_dataType);
00417         if (s.m_nextEntry.dlcType != dlc_NotUsed
00418             && s.m_dataType        & ivd_DATA_d) {
00419             //FIX bug 690  add one by one
00420             a_mediaPos_v.resize(a_mediaPos_v.size() + 1);
00421             s.GetMediaPos(a_mediaPos_v.back());
00422         }
00423     }
00424     if (fileOffset == a_migInfo.m_size) {
00425         return;
00426     }
00427 
00428 missingSplit:
00429     cmn_Time t(static_cast<time_t>(a_migInfo.m_migId >> 8));
00430     log_DBG_m(dbg_DETAIL, "Copy of FileID " << a_migInfo.m_fileId
00431               << " MigID "  << a_migInfo.m_migId << " " << t.Time2YMDhms() << ";"
00432                     << (a_migInfo.m_migId & 0xFF) << endl
00433               << " File size " << a_migInfo.m_size
00434               << " has not completted or its splits are not sortted.\n" );
00435     a_mediaPos_v.clear();
00436     return;
00437 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool fsc_SplitMgr::Write2DB ( fsc_NextEntity_t a_nextEntry,
fio_Transaction a_trans 
)

Definition at line 456 of file fsc_SplitMgr.cpp.

References alloca(), cmn_HexDump(), dbg_DETAIL, dlc_NotUsed, dlc_Split, fsc_NextEntity_t::dlcType, fsc_Vector_t::entryIdx, fio_RelFileTrans::GetVectorIDX(), log_DBG_m, log_FUNC_m, fsc_EntryMgr::m_prevVecIndex, fsc_EntryMgr::m_prevVecSize, m_relFile, m_split_p_l, fsc_Split_t::nextEntity, NULL, fsc_Vector_t::numOfElement, fio_RelFileTrans::ReleaseVectorIdx(), size, fsc_NextEntity_t::vector, fsc_Split::Write2DB(), and fio_RelFile::WriteRec().

Referenced by fsc_Generation::Write2DB(), and fsc_Copy::Write2DB().

00457                                                        {
00458     log_FUNC_m(Write2DB);
00459 
00460     bool vecIdxOrSizeChanged = false;
00461     bool vecDataChanged      = false;
00462     fsc_Split_v_st size = m_split_p_l.size();
00463     fsc_Split_t *splitData_v = NULL;
00464 
00465     if (size) {
00466         splitData_v = reinterpret_cast<fsc_Split_t*>
00467                        (alloca(size * sizeof(fsc_Split_t)));
00468 
00469         fsc_Split_t *p = splitData_v;
00470         fsc_Split_p_l_i iter = m_split_p_l.begin();
00471         while(iter != m_split_p_l.end()) {  // fulfill the data vector
00472             fsc_Split *s = (*iter);
00473             if (s->Write2DB(*p, a_trans)) {
00474                 vecDataChanged = true;
00475                 if (   p->nextEntity.dlcType          == dlc_NotUsed
00476                 &&  p->nextEntity.vector.entryIdx     == 0
00477                 &&  p->nextEntity.vector.numOfElement == 0) { // entry was removed
00478                     // release object
00479                     delete s;
00480                     size--;
00481                     iter = m_split_p_l.erase(iter);
00482                     continue;
00483                 }
00484             }
00485             iter++;
00486             p++;
00487         }
00488     }
00489 
00490     if (size == 0) {
00491         if( size != m_prevVecSize) {
00492             m_relFile.ReleaseVectorIdx(m_prevVecIndex, m_prevVecSize, &a_trans);
00493             m_prevVecSize  = 0;
00494             m_prevVecIndex = 0;
00495             vecIdxOrSizeChanged = true;
00496         }
00497         a_nextEntry.dlcType              = dlc_NotUsed;
00498         a_nextEntry.vector.entryIdx      = 0;
00499         a_nextEntry.vector.numOfElement  = 0;
00500         return vecIdxOrSizeChanged;
00501     }
00502 
00503     // DO NOT remove last split like last copy!!!!
00504 
00505     ivd_RecordIDX_t idx = m_prevVecIndex;  // curent vector index
00506     if (idx == 0) {
00507         idx = m_relFile.GetVectorIDX(size, &a_trans);
00508         vecIdxOrSizeChanged = true;
00509     }
00510     else if (size != m_prevVecSize) {
00511         idx = m_relFile.GetVectorIDX(size, &a_trans);
00512         m_relFile.ReleaseVectorIdx(m_prevVecIndex, m_prevVecSize, &a_trans);
00513         vecIdxOrSizeChanged = true;
00514     }
00515 
00517 
00518     log_DBG_m(dbg_DETAIL, " vecIdxOrSizeCahnged " << vecIdxOrSizeChanged
00519                        << " vecDataChanged " << vecDataChanged);
00520     if (  vecIdxOrSizeChanged
00521        || vecDataChanged) {  // if something change write it t
00522         log_DBG_m(dbg_DETAIL, "W Splits : idx = " << idx << endl <<
00523             cmn_HexDump(splitData_v, size * sizeof(fsc_Split_t), sizeof(fsc_Split_t), false) );
00524         // write data to relative file
00525         m_relFile.WriteRec(idx, splitData_v, size, &a_trans);
00526 //        m_vecIndex     = idx;
00527         m_prevVecSize  = size;
00528         m_prevVecIndex = idx;
00529 
00530         // update caller nextEntity structure
00531     }
00532     // tel owner my profile
00533     a_nextEntry.dlcType              = dlc_Split;
00534     a_nextEntry.vector.entryIdx      = idx;
00535     a_nextEntry.vector.numOfElement  = size;
00536     return vecIdxOrSizeChanged;
00537 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fsc_SplitMgr::Dump ( ostream &  os  ) 

Definition at line 540 of file fsc_SplitMgr.cpp.

References dlc_NotUsed, fsc_NextEntity_t::dlcType, fsc_Split::Dump(), log_FUNC_m, fsc_Entry::m_nextEntry, fsc_EntryMgr::m_prevVecIndex, fsc_EntryMgr::m_prevVecSize, and m_split_p_l.

Referenced by fsc_Generation::Dump(), and fsc_Copy::Dump().

00540                                    {
00541     log_FUNC_m(Dump);
00542 
00543 //    os << "S          Vector index         =" << m_vecIndex << endl;
00544     os << "Sp         Previous vector idx  =" << m_prevVecIndex << endl;
00545     os << " l         Number of splits     =" << m_split_p_l.size() << endl;
00546     os << " it        Previous num of spli.=" << m_prevVecSize << endl;
00547 
00548 
00549     for (fsc_Split_p_l_i iter = m_split_p_l.begin();
00550          iter != m_split_p_l.end();
00551          iter++) {
00552         fsc_Split &s = (**iter);
00553         if (s.m_nextEntry.dlcType == dlc_NotUsed ) {
00554             os << "               Reserved space for split" << endl;
00555         }
00556         else {
00557             s.Dump(os);
00558         }
00559     }
00560 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool fsc_SplitMgr::TreeWalk ( fsc_Collector a_collector  ) 

Definition at line 440 of file fsc_SplitMgr.cpp.

References log_FUNC_m, m_split_p_l, and fsc_Collector::ProcObjSplitMgr().

Referenced by fsc_Generation::TreeWalk(), and fsc_Copy::TreeWalk().

00440                                                         {
00441     log_FUNC_m(TreeWalk);
00442 
00443     if (!a_collector.ProcObjSplitMgr(this)){
00444         return false;
00445     }
00446     fsc_Split_p_l_i iter = m_split_p_l.begin();
00447     for (;iter != m_split_p_l.end(); iter++) {
00448         if (!(**iter).TreeWalk(a_collector)) {
00449             return false;
00450         }
00451     }
00452     return true;
00453 }

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class ut_fsc_SplitMgr [friend]

Definition at line 56 of file fsc_SplitMgr.h.


Member Data Documentation

this is pointer to relative file "fsc_xxxx.lrf" object.

It's not need to delete it in destructor

Definition at line 72 of file fsc_SplitMgr.h.

Referenced by fsc_SplitMgr(), and Write2DB().

Reimplemented from fsc_EntryMgr.

Definition at line 78 of file fsc_SplitMgr.h.


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

Generated on Mon Feb 27 19:24:52 2012 for OPENARCHIVE by  doxygen 1.5.6