Public Member Functions | Private Member Functions | Private Attributes

fsc_FLSPerVolume Class Reference
[G_new_group]

#include <fsc_FLSPerVolume.h>

List of all members.

Public Member Functions

 fsc_FLSPerVolume (ivd_MedVolNum_t a_volNum)
 fsc_FLSPerVolume (ivd_MedVolNum_t a_volNum, ivd_FileLocationData_t_v_i a_begin, ivd_FileLocationData_t_v_i a_end)
 fsc_FLSPerVolume (string &a_partName, ivd_MediaKey_t a_mediaKey, ivd_MedVolNum_t a_volNum)
 fsc_FLSPerVolume (ivd_MediaKey_t a_mediaKey, ivd_MedVolNum_t a_volNum)
 ~fsc_FLSPerVolume (void)
void Insert (ivd_FileLocationData_t &a_fileLoc)
 Impossible to inser new element after sort and cut.
void SortByOffset ()
ivd_FileLocationData_t_v_tGetRefOfFileLocDataVec ()
i_FileLocationDataList_tGetNextRecallList (UInt64_t a_buffSize)
i_RecallList_tGetCurrentRecallList ()
UInt64_t GetCurrentSplitSize ()
UInt64_t GetRemainingBytesToCopy ()
bool AtEndOfList ()
ivd_MedVolNum_t GetVolNum ()
void DumpFileListVector ()
void DumpFileListVector (ivd_FileLocationData_t_v_i a_begin, ivd_FileLocationData_t_v_i a_end)

Private Member Functions

UInt64_t CountVolumeSize ()

Private Attributes

 log_CLASSID_m
const ivd_MedVolNum_t m_volNum
ivd_FileLocationData_t_v_t m_fileLoc_v
ivd_FileLocationData_t_v_i m_recallSetEnd
ivd_FileLocationData_t_v_i m_recallSetBegin
UInt64_t m_remainingSplitSize
bool m_sorted

Detailed Description

Definition at line 47 of file fsc_FLSPerVolume.h.


Constructor & Destructor Documentation

fsc_FLSPerVolume::fsc_FLSPerVolume ( ivd_MedVolNum_t  a_volNum  ) 

Definition at line 56 of file fsc_FLSPerVolume.cpp.

References log_FUNC_A_m.

    :
    m_volNum(a_volNum),
    m_remainingSplitSize(0),
    m_sorted(false)
{
    log_FUNC_A_m(fsc_FLSPerVolume, "volNum: " << a_volNum);

}

fsc_FLSPerVolume::fsc_FLSPerVolume ( ivd_MedVolNum_t  a_volNum,
ivd_FileLocationData_t_v_i  a_begin,
ivd_FileLocationData_t_v_i  a_end 
)

Definition at line 67 of file fsc_FLSPerVolume.cpp.

References CountVolumeSize(), log_FUNC_m, m_fileLoc_v, m_recallSetBegin, m_recallSetEnd, and m_remainingSplitSize.

    :
    m_volNum(a_volNum),
    m_sorted(true)
{
    log_FUNC_m(fsc_FLSPerVolume assign);
    m_fileLoc_v.assign(a_begin, a_end);
    m_recallSetEnd = m_fileLoc_v.begin();
    m_recallSetBegin = m_fileLoc_v.begin();
    m_remainingSplitSize = CountVolumeSize();
}

Here is the call graph for this function:

fsc_FLSPerVolume::fsc_FLSPerVolume ( string &  a_partName,
ivd_MediaKey_t  a_mediaKey,
ivd_MedVolNum_t  a_volNum 
)

Definition at line 82 of file fsc_FLSPerVolume.cpp.

References CountVolumeSize(), log_FUNC_A_m, m_fileLoc_v, m_recallSetBegin, m_recallSetEnd, m_remainingSplitSize, and fsc_DataCollectorStorage::ReadContent().

    :
    m_volNum(a_volNum),
    m_sorted(false)
{
    log_FUNC_A_m(fsc_FLSPerVolume,
        "partName: " << a_partName <<
        ", medKey: " << a_mediaKey <<
        ", volNum: " << a_volNum);

    fsc_ReorgScanReorgVolStorage fileLocation(0, a_partName, a_mediaKey, a_volNum, false);

    fileLocation.ReadContent(m_fileLoc_v);

    m_recallSetEnd = m_fileLoc_v.begin();
    m_recallSetBegin = m_fileLoc_v.begin();
    m_remainingSplitSize = CountVolumeSize();
}

Here is the call graph for this function:

fsc_FLSPerVolume::fsc_FLSPerVolume ( ivd_MediaKey_t  a_mediaKey,
ivd_MedVolNum_t  a_volNum 
)

Definition at line 104 of file fsc_FLSPerVolume.cpp.

References CountVolumeSize(), dbg_DETAIL, cmn_File::DeleteFile(), fsc_GetRedunCopyDir(), fsc_GetRedunCopyMedVolFile(), ivd_BaseException::GetFriendly(), log_DBG_m, log_FUNC_A_m, m_fileLoc_v, m_recallSetBegin, m_recallSetEnd, m_remainingSplitSize, and fsc_DataCollectorStorage::ReadContent().

    :
    m_volNum(a_volNum),
    m_sorted(false)
{
    log_FUNC_A_m(fsc_FLSPerVolume,
        "medKey: " << a_mediaKey <<
        ", volNum: " << a_volNum);
    {
        fsc_RedunCopyDataVolStorageReader fileLocation(a_mediaKey, a_volNum);

        fileLocation.ReadContent(m_fileLoc_v);
    }
    // idx file not needed any more
    try {
        cmn_Path idxFile = fsc_GetRedunCopyDir(a_mediaKey)
                        + fsc_GetRedunCopyMedVolFile(a_mediaKey, a_volNum);
        log_DBG_m(dbg_DETAIL, "Removing file: " << idxFile);
        cmn_File::DeleteFile(idxFile);
    }
    catch (ivd_SysError &se) {
        log_DBG_m(dbg_DETAIL, "File removing failed: " << se.GetFriendly());
    }

    m_recallSetEnd = m_fileLoc_v.begin();
    m_recallSetBegin = m_fileLoc_v.begin();
    m_remainingSplitSize = CountVolumeSize();
}

Here is the call graph for this function:

fsc_FLSPerVolume::~fsc_FLSPerVolume ( void   ) 

Definition at line 135 of file fsc_FLSPerVolume.cpp.

References log_FUNC_m.


Member Function Documentation

bool fsc_FLSPerVolume::AtEndOfList (  )  [inline]

Definition at line 76 of file fsc_FLSPerVolume.h.

Referenced by pm_RecallSetReader::EndOfCurrentVolume().

{ return (m_recallSetEnd == m_fileLoc_v.end()); };

Here is the caller graph for this function:

UInt64_t fsc_FLSPerVolume::CountVolumeSize (  )  [private]

Definition at line 227 of file fsc_FLSPerVolume.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, and m_fileLoc_v.

Referenced by fsc_FLSPerVolume(), and Insert().

                                           {
    log_FUNC_m(CountVolumeSize);

    UInt64_t volumeSize(0);
    ivd_FileLocationData_t_v_i iter;

    for (iter = m_fileLoc_v.begin(); iter != m_fileLoc_v.end(); iter++ ) {
        volumeSize += (iter->splitSize + HSM_FILE_HEADER_SIZE);
    }

    log_DBG_m(dbg_DETAIL, "Volume size: " << volumeSize);

    return volumeSize;
}

Here is the caller graph for this function:

void fsc_FLSPerVolume::DumpFileListVector (  ) 

Definition at line 252 of file fsc_FLSPerVolume.cpp.

References log_FUNC_m, and m_fileLoc_v.

Referenced by DumpFileListVector(), and SortByOffset().

Here is the caller graph for this function:

void fsc_FLSPerVolume::DumpFileListVector ( ivd_FileLocationData_t_v_i  a_begin,
ivd_FileLocationData_t_v_i  a_end 
)

Definition at line 259 of file fsc_FLSPerVolume.cpp.

References ivd_FileLocationData_t::blockOffset, dbg_DETAIL, DumpFileListVector(), ivd_FileLocationData_t::fileID, ivd_FileLocationData_t::fileIdx, log_DBG_m, log_FUNC_m, ivd_FileLocationData_t::migrationID, and ivd_FileLocationData_t::splitSize.

                                                                            {
    log_FUNC_m(DumpFileListVector);

    ivd_FileLocationData_t_v_i iter = a_begin;

    int numOfFiles(0);

    log_DBG_m(dbg_DETAIL, " === File list vector === ");
    for (; iter != a_end; ++iter) {
        ivd_FileLocationData_t &fld = *iter;

        log_DBG_m(dbg_DETAIL, "FileID: " << fld.fileID
            << ", block off: " << fld.blockOffset
            << ", file size: " << fld.splitSize
            << ", migration ID: " << fld.migrationID
            << ", fileIdx: " << fld.fileIdx);
        numOfFiles++;
    }
    log_DBG_m(dbg_DETAIL, " Total: "  << numOfFiles << " files");
    log_DBG_m(dbg_DETAIL," ========================= ");
}

Here is the call graph for this function:

i_RecallList_t * fsc_FLSPerVolume::GetCurrentRecallList (  ) 

Definition at line 283 of file fsc_FLSPerVolume.cpp.

References dbg_DETAIL, ivd_FileLocationData_t::fileID, i_Recall_t::fileID, ivd_FileLocationData_t::fileIdx, i_Recall_t::fileIdx, i_Recall_t::fileSize, log_DBG_m, log_FUNC_m, m_recallSetBegin, m_recallSetEnd, ivd_FileLocationData_t::migrationID, and i_Recall_t::migrationID.

Referenced by pm_RecallSetReader::GetCurrentRecallSet().

                                                       {
    log_FUNC_m(GetCurrentRecallList);

    i_RecallList_t_var seqRecallList(new i_RecallList_t);
    ivd_FileLocationData_t_v_i iter = m_recallSetBegin;

    int i(0);
    for (; iter != m_recallSetEnd; ++iter) {
        ivd_FileLocationData_t &fldSour = *iter;

        // Dynamic resize(dont know sequence size in advance)
        seqRecallList->length(i + 1);

        i_Recall_t &recallStr = seqRecallList[i];

        recallStr.fileID      = fldSour.fileID;
        recallStr.migrationID = fldSour.migrationID;
        // Get Copies set it to split size.
        // HSM set it to file size to be checked in FSC. Not checked if 0.
        recallStr.fileSize    = 0;
        recallStr.fileIdx     = fldSour.fileIdx;
        i++;
    }

    log_DBG_m(dbg_DETAIL, "Number of files in list: " << i);
    return seqRecallList._retn();
}

Here is the caller graph for this function:

UInt64_t fsc_FLSPerVolume::GetCurrentSplitSize (  ) 

Definition at line 167 of file fsc_FLSPerVolume.cpp.

References dbg_LOW, log_DBG_m, log_FUNC_m, m_fileLoc_v, m_recallSetEnd, and ivd_FileLocationData_t::splitSize.

Referenced by pm_RecallSetReader::GetCurrentSplitSize().

                                               {
    log_FUNC_m(GetCurrentSplitSize);

    if (m_recallSetEnd != m_fileLoc_v.end()) {
        ivd_FileLocationData_t &currentSplit = *m_recallSetEnd;
        log_DBG_m(dbg_LOW, "Current split size: " << currentSplit.splitSize);

        return currentSplit.splitSize + HSM_FILE_HEADER_SIZE;
    }
    return 0;
}

Here is the caller graph for this function:

i_FileLocationDataList_t * fsc_FLSPerVolume::GetNextRecallList ( UInt64_t  a_buffSize  ) 

Definition at line 180 of file fsc_FLSPerVolume.cpp.

References ivd_FileLocationData_t::blockOffset, i_FileLocationData_t::blockOffset, dbg_DETAIL, ivd_FileLocationData_t::fileID, i_FileLocationData_t::fileID, log_DBG_m, log_FUNC_m, m_fileLoc_v, m_recallSetBegin, m_recallSetEnd, m_remainingSplitSize, MAX_READ_COUNT, ivd_FileLocationData_t::migrationID, i_FileLocationData_t::migrationID, i_FileLocationData_t::splitSize, and ivd_FileLocationData_t::splitSize.

Referenced by pm_RecallSetReader::GetNextRecallSet().

                                                                                 {
    log_FUNC_m(GetNextRecallList);

    UInt64_t fileSize = 0;

    m_recallSetBegin = m_recallSetEnd;

    i_FileLocationDataList_t_var fileLocDataList(new i_FileLocationDataList_t);
    UInt32_t numOfFiles(0);

    for (; m_recallSetEnd != m_fileLoc_v.end(); ++m_recallSetEnd ) {
        ivd_FileLocationData_t &fldSour = *m_recallSetEnd;
        UInt64_t toRead(0);

        toRead = fldSour.splitSize + HSM_FILE_HEADER_SIZE;
        if (   ( (fileSize + toRead) > a_buffSize)
            || ( numOfFiles >= MAX_READ_COUNT) ) {
            break;
        }

        // Dynamic resize(dont know vector size in advance)
        fileLocDataList->length(numOfFiles + 1);

        i_FileLocationData_t   &fldDest = fileLocDataList[numOfFiles];

        fldDest.fileID      = fldSour.fileID;
        fldDest.blockOffset = fldSour.blockOffset;
        fldDest.migrationID = fldSour.migrationID;
        fldDest.splitSize   = fldSour.splitSize;

        log_DBG_m(dbg_DETAIL, "FileID: " << fldDest.fileID
            << ", block off: " << fldDest.blockOffset
            << ", file size: " << fldDest.splitSize);

        fileSize += toRead;
        m_remainingSplitSize -= toRead;
        numOfFiles++;
    }

    log_DBG_m(dbg_DETAIL, "DiskBufferSize: " << a_buffSize
                       << " File size read: " << fileSize);
    log_DBG_m(dbg_DETAIL, "MAX_READ_COUNT: " << MAX_READ_COUNT
                       << " Number of files read: " << numOfFiles);
    return fileLocDataList._retn();
}

Here is the caller graph for this function:

ivd_FileLocationData_t_v_t& fsc_FLSPerVolume::GetRefOfFileLocDataVec (  )  [inline]

Definition at line 71 of file fsc_FLSPerVolume.h.

Referenced by i_EfficientRecallJob_i::PrepareFailedRecallListSeq(), and i_EfficientRecallJob_i::PrepareResource().

{ return  m_fileLoc_v; };               

Here is the caller graph for this function:

UInt64_t fsc_FLSPerVolume::GetRemainingBytesToCopy (  ) 

Definition at line 243 of file fsc_FLSPerVolume.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, and m_remainingSplitSize.

Referenced by pm_RecallSetReader::GetRemainingBytesToCopy().

Here is the caller graph for this function:

ivd_MedVolNum_t fsc_FLSPerVolume::GetVolNum (  )  [inline]

Definition at line 78 of file fsc_FLSPerVolume.h.

Referenced by fsc_FLSPerMedia::GetNextFSLPerVolume().

{ return m_volNum; };

Here is the caller graph for this function:

void fsc_FLSPerVolume::Insert ( ivd_FileLocationData_t a_fileLoc  ) 

Impossible to inser new element after sort and cut.

Impossible to insert new element after sort and cut

Definition at line 140 of file fsc_FLSPerVolume.cpp.

References CountVolumeSize(), ie_NOT_SUPPORTED, log_FUNC_m, m_fileLoc_v, m_recallSetBegin, m_recallSetEnd, m_remainingSplitSize, and m_sorted.

                                                              {
    log_FUNC_m(Insert);

    if (m_sorted) {
        throw ivd_InternalError( ie_NOT_SUPPORTED,
            "Storage is already sorted an rearange. Items cannot be inserted any more.");
    }
    m_fileLoc_v.push_back(a_fileLoc);
    m_recallSetEnd = m_fileLoc_v.begin();
    m_recallSetBegin = m_fileLoc_v.begin();
    m_remainingSplitSize = CountVolumeSize();
}

Here is the call graph for this function:

void fsc_FLSPerVolume::SortByOffset (  ) 

Definition at line 155 of file fsc_FLSPerVolume.cpp.

References DumpFileListVector(), FileLocDataOffsetCompare(), log_FUNC_m, m_fileLoc_v, m_recallSetBegin, and m_recallSetEnd.

Referenced by pm_RecallSetReader::pm_RecallSetReader(), and fsc_FLSPerMedia::SortList().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 83 of file fsc_FLSPerVolume.h.

Definition at line 91 of file fsc_FLSPerVolume.h.

Referenced by Insert().

Definition at line 84 of file fsc_FLSPerVolume.h.


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