Public Member Functions | Public Attributes | Private Attributes | Friends

fsc_SplitMgr Class Reference
[File System Catalog]

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

#include <fsc_SplitMgr.h>

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

List of all members.

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

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 69 of file fsc_SplitMgr.h.


Constructor & Destructor Documentation

fsc_SplitMgr::fsc_SplitMgr ( df_SplitInfo a_splitInfo  ) 

Definition at line 59 of file fsc_SplitMgr.cpp.

References fsc_SplitMgr(), log_FUNC_m, and m_split_p_l.

            :
            m_relFile(*g_splitRF_p)
{
    log_FUNC_m(fsc_SplitMgr(df_SplitInfo));

    // add new split
    fsc_Split* split_p = new fsc_Split(a_splitInfo);

    // first element is always sortted
    m_split_p_l.push_back(split_p);
}

Here is the call graph for this function:

fsc_SplitMgr::fsc_SplitMgr ( fsc_Split a_split_p  ) 

Definition at line 74 of file fsc_SplitMgr.cpp.

References fsc_SplitMgr(), log_FUNC_m, and m_split_p_l.

Here is the call graph for this function:

fsc_SplitMgr::fsc_SplitMgr ( Int16_t  a_numOfElement,
ivd_RecordIDX_t  a_splitIdx 
)

Definition at line 84 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().

            :
            fsc_EntryMgr(a_numOfElement, a_splitIdx),
            m_relFile(*g_splitRF_p)
{
    log_FUNC_m(fsc_SplitMgr(Int16_t.));
//    log_DBG_m(dbg_DETAIL,"Get " << a_numOfElement
//                      << " split from idx " << a_splitIdx);

    if (a_numOfElement > 0) {
        fsc_Split_t *splitData_v = reinterpret_cast<fsc_Split_t*>
                                    (alloca(a_numOfElement * sizeof(fsc_Split_t)));

        fsc_Split_t *p    =  splitData_v;
        fsc_Split_t *endp = &splitData_v[a_numOfElement];

        m_relFile.ReadRec(a_splitIdx, splitData_v, a_numOfElement);
        log_DBG_m(dbg_DETAIL, "R Splits from = " << a_splitIdx << endl <<
        cmn_HexDump(splitData_v, a_numOfElement * sizeof(fsc_Split_t), sizeof(fsc_Split_t), false) );

        for (; p < endp; p++) {
            if (p->nextEntity.dlcType != dlc_NotUsed) {  // only used records add to list
                fsc_Split* split_p = new fsc_Split(*p);
                m_split_p_l.push_back(split_p);
            }
        }
    }
}

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 116 of file fsc_SplitMgr.cpp.

References m_split_p_l.

{
    for (fsc_Split_p_l_i iter = m_split_p_l.begin();
         iter != m_split_p_l.end();
         iter++) {
        delete *iter;
    }
}


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 126 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, and m_split_p_l.

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

                                                                        {
    log_FUNC_m(AddSplit);
    assert(m_split_p_l.size() > 0);

    ivd_FilePosition_t  addedSplitOffset = a_split_p->m_offset;
    fsc_Split_p_l_i iter  = m_split_p_l.begin();
    UInt32_t prevMediaKey = 0;
    Int64_t splitOffset   = 0;

    log_DBG_m(dbg_DETAIL, "add split " << *a_split_p);

    fsc_Split *s = *iter;

    // Do not update FSC if split size is 0 and it is not ADS
    if (a_split_p->IsZeroSizeSplit()) {
        return sp_ALREADY_ADDED;
    }

    // split will be inserted before selected object
    // so find proper one
    for (;
         iter != m_split_p_l.end();
         iter++) {
        s = *iter;

        log_DBG_m(dbg_DETAIL, "compare split " << *s);

        if (s->m_offset == addedSplitOffset) {
            if (s->IsSplitEqual(*a_split_p)) {
                return sp_ALREADY_ADDED;
            }
            if (s->m_size == 0) { // What if many different splits has size 0? example ADS
                if (a_split_p->m_size == 0) { // only one zero sized split is posible on same place
                    return sp_NEW_COPY;
                }
                log_DBG_m(dbg_DETAIL, "Current split size is 0.");
                prevMediaKey = s->GetMediaPosMgr().m_mediaKey;
                continue;
            }
            splitOffset = s->m_offset;
            break;
        }
        else if (s->m_offset > addedSplitOffset) {
            // intersection cannnot be checked, current split may be intruder.

            // split FIX after permutation test
            splitOffset = s->m_offset;
            break;
        }
        prevMediaKey = s->GetMediaPosMgr().m_mediaKey;
    }

    log_DBG_m(dbg_DETAIL, "prevMediaKey = " << prevMediaKey
                         << " splitOffset " << splitOffset
                         << " addedSplitOffset " << addedSplitOffset);

    if (iter == m_split_p_l.begin()) {// add-Split is infront of others
        log_DBG_m(dbg_DETAIL, "addSplit:  add-Split is infront of others");
      //  if (splitOffset == addedSplitOffset) {
            //if (s->IsSplitEqual(*a_split_p)) {
            //    return sp_ALREADY_ADDED;
            //}
            //else {
            //   return sp_NEW_COPY;
            //}
       //     }
       // else
        if (s->HasIntersection(*a_split_p)){
            log_DBG_m(dbg_DETAIL, "addSplit: has intersection" );
            return sp_NEW_COPY;
        }
        else if (s->GetMediaPosMgr().m_mediaKey == a_split_p->GetMediaPosMgr().m_mediaKey) {
                log_DBG_m(dbg_DETAIL, "addSplit: next mediaKey match "
                        << a_split_p->GetMediaPosMgr().m_mediaKey);
            if (splitOffset == addedSplitOffset + a_split_p->m_size) {
                log_DBG_m(dbg_DETAIL, "addSplit: splitOffset == addedSplitOffset + a_split_p->m_size "
                        <<  splitOffset);
                // insert it match offset and medium
                m_split_p_l.insert(iter, a_split_p);
                return sp_INSERTTED;
            }
            else {
                a_possibleInsertPoint = iter;
                return sp_CHECK_OTHER_COPIES;
            }
        }
        else {
            a_possibleInsertPoint = iter;
            return sp_CHECK_OTHER_COPIES;
        }
    }

    if (iter == m_split_p_l.end()) { // add-split is last in sequence
        // s point to previous split FIX after permutation test
        if (s->HasIntersection(*a_split_p)){
            return sp_NEW_COPY;
        }

        log_DBG_m(dbg_DETAIL, "addSplit:  add-Split is last in sequence");
        log_DBG_m(dbg_DETAIL, "addSplit:  s->m_offset + s->m_size = "
                << s->m_offset + s->m_size );
        if (s->m_offset + s->m_size == addedSplitOffset) {
            log_DBG_m(dbg_DETAIL, "addSplit: sprev->m_offset + sprev->m_size == addedSplitOffset match");
            log_DBG_m(dbg_DETAIL, "addSplit: a_split_p->mediaKey = "
                << a_split_p->GetMediaPosMgr().m_mediaKey);
            if (prevMediaKey == a_split_p->GetMediaPosMgr().m_mediaKey) {
#if TGT_OS_linux
    #warning add volnumber check when reorganization take place
#elif TGT_OS_windows
    #pragma message ("WARNING: Add volnumber check when reorganization take place.")
#endif
                log_DBG_m(dbg_DETAIL, "previous mediaKey match ");
                m_split_p_l.insert(iter, a_split_p);
                return sp_INSERTTED;
            }
            else {
            a_possibleInsertPoint = iter;
                return sp_CHECK_OTHER_COPIES;
            }
        }
        else {
            a_possibleInsertPoint = iter;
            return sp_CHECK_OTHER_COPIES;
        }
    }

    fsc_Split_p_l_i prev = iter;
    fsc_Split *sprev = *(--prev);

    log_DBG_m(dbg_DETAIL, "addSplit:  add-Split is between others");
    if (sprev->m_offset + sprev->m_size == addedSplitOffset) { // new split is in sequence
        // FIX after permutation test
        // s point to split with >= offset
        if (  s->m_offset == addedSplitOffset // s has size > 0, see for sentance above.
           && a_split_p->m_size > 0) { // already bind together
            return sp_NEW_COPY;
        }

        if (s->HasIntersection(*a_split_p)) { // has intersections with next split
            m_split_p_l.insert(iter, a_split_p);

            Int64_t remSplitOffset;
            do {  // all splits that are linked together with removed split must be removed too.
                a_replacedSplit_p_l.push_back(*iter);
                remSplitOffset = (*iter)->m_offset + (*iter)->m_size;
                m_split_p_l.erase(iter++);
            } while (  iter != m_split_p_l.end()
                 && (*iter)->m_offset == remSplitOffset);

            return sp_REPLACE;
        }
        else {
            if (s->m_offset == a_split_p->m_offset + a_split_p->m_size) {
                m_split_p_l.insert(iter, a_split_p);
                return sp_INSERTTED;
            }
            else {
                if (sprev->HasIntersection(*a_split_p)) {
                    return sp_NEW_COPY;
                }
                else {
                    a_possibleInsertPoint = iter;
                    return sp_CHECK_OTHER_COPIES;
                }
            }
        }
    }
    else {
        if (   (s->HasIntersection(*a_split_p) )
            || (sprev->HasIntersection(*a_split_p) ) ) {
            return sp_NEW_COPY;
        }
        else {
            a_possibleInsertPoint = iter;
            return sp_CHECK_OTHER_COPIES;
        }
    }
}

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 554 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().

                                   {
    log_FUNC_m(Dump);

//    os << "S          Vector index         =" << m_vecIndex << endl;
    os << "Sp         Previous vector idx  =" << m_prevVecIndex << endl;
    os << " l         Number of splits     =" << m_split_p_l.size() << endl;
    os << " it        Previous num of spli.=" << m_prevVecSize << endl;


    for (fsc_Split_p_l_i iter = m_split_p_l.begin();
         iter != m_split_p_l.end();
         iter++) {
        fsc_Split &s = (**iter);
        if (s.m_nextEntry.dlcType == dlc_NotUsed ) {
            os << "               Reserved space for split" << endl;
        }
        else {
            s.Dump(os);
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

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 414 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().

                                                                                       {
    log_FUNC_m(GetCopiesPos);
    //FIX bug 690  reserve space not alocate
    a_mediaPos_v.reserve(m_split_p_l.size());

    ivd_FilePosition_t fileOffset = 0; // to check if all splits are collected and in sequence
    int i = 0;
    for (fsc_Split_p_l_i iter = m_split_p_l.begin();
         iter != m_split_p_l.end();
         iter++, i++) {
        fsc_Split &s = (**iter);
        if (fileOffset != s.m_offset) {
            goto missingSplit;
        }
        fileOffset += s.m_size;
        log_DBG_m(dbg_DETAIL," Splits's record type " << (int)s.m_nextEntry.dlcType
                            << " data type " << s.m_dataType);
        if (s.m_nextEntry.dlcType != dlc_NotUsed
            && s.m_dataType        & ivd_DATA_d) {
            //FIX bug 690  add one by one
            a_mediaPos_v.resize(a_mediaPos_v.size() + 1);
            s.GetMediaPos(a_mediaPos_v.back());
        }
    }
    if (fileOffset == a_migInfo.m_size) {
        return;
    }

missingSplit:
    cmn_Time t(static_cast<time_t>(a_migInfo.m_migId >> 8));
    log_DBG_m(dbg_DETAIL, "Copy of FileID " << a_migInfo.m_fileId
              << " MigID "  << a_migInfo.m_migId << " " << t.Time2YMDhms() << ";"
                    << (a_migInfo.m_migId & 0xFF) << endl
              << " File size " << a_migInfo.m_size
              << " has not completted or its splits are not sortted.\n" );
    a_mediaPos_v.clear();
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool fsc_SplitMgr::HasEqualSplit ( df_SplitInfo a_splitInfo  ) 

Definition at line 401 of file fsc_SplitMgr.cpp.

References log_FUNC_m, and m_split_p_l.

                                                           {
    log_FUNC_m(HasEqualSplit);

    fsc_Split_p_l_i iter = m_split_p_l.begin();
    for (;iter != m_split_p_l.end(); iter++) {
        if ((*iter)->HasEqualSplit(a_splitInfo)) {
            return true;
        }
    }
    return false;
}

bool fsc_SplitMgr::HasIntersection ( df_SplitInfo a_splitInfo  ) 

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

Definition at line 388 of file fsc_SplitMgr.cpp.

References log_FUNC_m, and m_split_p_l.

                                                             {
    log_FUNC_m(HasIntersection);

    fsc_Split_p_l_i iter = m_split_p_l.begin();
    for (;iter != m_split_p_l.end(); iter++) {
        if ((*iter)->HasIntersection(a_splitInfo)) {
            return true;
        }
    }
    return false;
}

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 361 of file fsc_SplitMgr.cpp.

References log_FUNC_m, m_split_p_l, and Remove().

                                                               {
    log_FUNC_m(Remove);
    fsc_Split_p_l_i iter = m_split_p_l.begin();
    for (;iter != m_split_p_l.end(); iter++) {
        // if removed then all other splits have to be re insert
        if ((**iter).Remove(a_mediumKey, a_medVolNum, a_blockOffs)) {
            fsc_Split_p_l_i i = m_split_p_l.begin();
            while (i != m_split_p_l.end()) {
                if (i != iter) {
                    a_replacedSplit_p_l.push_back(*i);
                    // NOTE, erase with post increment
                    // erase() use copy of i and i is incremented before erase() is called
                    m_split_p_l.erase(i++);
                    continue; // already incremented
                }
                ++i;
            }
            return true;
        }
    }
    return false;
}

Here is the call 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 332 of file fsc_SplitMgr.cpp.

References log_FUNC_m, and m_split_p_l.

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

                                                                {
    log_FUNC_m(Remove);
    fsc_Split_p_l_i iter = m_split_p_l.begin();
    for (;iter != m_split_p_l.end(); iter++) {
        // if removed then all other splits have to be re insert
        if ((**iter).Remove(a_mediumKey, a_medVolNum)) {
            fsc_Split_p_l_i i = m_split_p_l.begin();
            while (i != m_split_p_l.end()) {
                if (i != iter) {
                    // check if other split are on removable volume
                    if (!(**i).Remove(a_mediumKey, a_medVolNum)) {
                        a_replacedSplit_p_l.push_back(*i);
                        // NOTE, erase with post increment
                        // erase() use copy of i and i is incremented before erase() is called
                        m_split_p_l.erase(i++);
                        continue; // already incremented
                    }
                }
                ++i;
            }
            return true;
        }
    }
    return false;
}

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 308 of file fsc_SplitMgr.cpp.

References log_FUNC_m, and m_split_p_l.

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

                                                             {
    log_FUNC_m(RemoveEntry);
    fsc_Split_p_l_i iter = m_split_p_l.begin();
    for (;iter != m_split_p_l.end(); iter++) {
        (**iter).Remove(a_mediumKey, a_medVolNum);
    }
}

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 318 of file fsc_SplitMgr.cpp.

References log_FUNC_m, m_split_p_l, and RemoveEntry().

                                                             {
    log_FUNC_m(RemoveEntry(elem));
    fsc_Split_p_l_i iter = m_split_p_l.begin();
    for (;iter != m_split_p_l.end(); iter++) {
        if ((**iter).Remove(a_mediumKey, a_medVolNum, a_blockOffs)) {
            return true;
        }
    }
    return false;
}

Here is the call graph for this function:

bool fsc_SplitMgr::TreeWalk ( fsc_Collector a_collector  ) 

Definition at line 454 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().

                                                        {
    log_FUNC_m(TreeWalk);

    if (!a_collector.ProcObjSplitMgr(this)){
        return false;
    }
    fsc_Split_p_l_i iter = m_split_p_l.begin();
    for (;iter != m_split_p_l.end(); iter++) {
        if (!(**iter).TreeWalk(a_collector)) {
            return false;
        }
    }
    return true;
}

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 470 of file fsc_SplitMgr.cpp.

References alloca(), cmn_HexDump(), dbg_DETAIL, dlc_NotUsed, 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, 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().

                                                       {
    log_FUNC_m(Write2DB);

    bool vecIdxOrSizeChanged = false;
    bool vecDataChanged      = false;
    fsc_Split_v_st size = m_split_p_l.size();
    fsc_Split_t *splitData_v = NULL;

    if (size) {
        splitData_v = reinterpret_cast<fsc_Split_t*>
                       (alloca(size * sizeof(fsc_Split_t)));

        fsc_Split_t *p = splitData_v;
        fsc_Split_p_l_i iter = m_split_p_l.begin();
        while(iter != m_split_p_l.end()) {  // fulfill the data vector
            fsc_Split *s = (*iter);
            if (s->Write2DB(*p, a_trans)) {
                vecDataChanged = true;
                if (   p->nextEntity.dlcType          == dlc_NotUsed
                &&  p->nextEntity.vector.entryIdx     == 0
                &&  p->nextEntity.vector.numOfElement == 0) { // entry was removed
                    // release object
                    delete s;
                    size--;
                    iter = m_split_p_l.erase(iter);
                    continue;
                }
            }
            iter++;
            p++;
        }
    }

    if (size == 0) {
        if( size != m_prevVecSize) {
            m_relFile.ReleaseVectorIdx(m_prevVecIndex, m_prevVecSize, &a_trans);
            m_prevVecSize  = 0;
            m_prevVecIndex = 0;
            vecIdxOrSizeChanged = true;
        }
        a_nextEntry.dlcType              = dlc_NotUsed;
        a_nextEntry.vector.entryIdx      = 0;
        a_nextEntry.vector.numOfElement  = 0;
        return vecIdxOrSizeChanged;
    }

    // DO NOT remove last split like last copy!!!!

    ivd_RecordIDX_t idx = m_prevVecIndex;  // curent vector index
    if (idx == 0) {
        idx = m_relFile.GetVectorIDX(size, &a_trans);
        vecIdxOrSizeChanged = true;
    }
    else if (size != m_prevVecSize) {
        idx = m_relFile.GetVectorIDX(size, &a_trans);
        m_relFile.ReleaseVectorIdx(m_prevVecIndex, m_prevVecSize, &a_trans);
        vecIdxOrSizeChanged = true;
    }


    log_DBG_m(dbg_DETAIL, " vecIdxOrSizeCahnged " << vecIdxOrSizeChanged
                       << " vecDataChanged " << vecDataChanged);
    if (  vecIdxOrSizeChanged
       || vecDataChanged) {  // if something change write it t
        log_DBG_m(dbg_DETAIL, "W Splits : idx = " << idx << endl <<
            cmn_HexDump(splitData_v, size * sizeof(fsc_Split_t), sizeof(fsc_Split_t), false) );
        // write data to relative file
        m_relFile.WriteRec(idx, splitData_v, size, &a_trans);
//        m_vecIndex     = idx;
        m_prevVecSize  = size;
        m_prevVecIndex = idx;

        // update caller nextEntity structure
    }
    // tel owner my profile
    a_nextEntry.dlcType              = dlc_Split;
    a_nextEntry.vector.entryIdx      = idx;
    a_nextEntry.vector.numOfElement  = size;
    return vecIdxOrSizeChanged;
}

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 70 of file fsc_SplitMgr.h.


Member Data Documentation

Reimplemented from fsc_EntryMgr.

Definition at line 92 of file fsc_SplitMgr.h.

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

It's not need to delete it in destructor

Definition at line 86 of file fsc_SplitMgr.h.

Referenced by fsc_SplitMgr(), and Write2DB().


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