Public Member Functions | Public Attributes | Private Attributes

hsm_FHcache Class Reference
[Classes for managing object list]

hsm_FHcache: class, this class hold all active file header in HSM sistem. More...

#include <hsm_FHcache.h>

List of all members.

Public Member Functions

 hsm_FHcache (UInt32_t a_hashSize)
 Constructor for creating a vector (STK container) of size a_hashSize.
virtual ~hsm_FHcache ()
UInt32_t HashFunc (UInt32_t a_inode)
void Insert (hsm_FileHeader *a_FileHObj)
void InsertDirWithTest (hsm_FileHeader **a_FileHObj)
 If Dir FH that is going to be inserted is already in cache than cache delete it and update pointer to FH that point to FH known by cache.
void Remove (hsm_FileHeader *a_FileHObj)
bool RemoveLastButOne (hsm_FileHeader *a_FileHObj)
 remove if only one reference stay
hsm_FileHeaderGetFH (ivd_GenInode_t a_generalInode)

Public Attributes

 log_CLASSID_m

Private Attributes

const UInt32_t m_hashSize

Detailed Description

hsm_FHcache: class, this class hold all active file header in HSM sistem.

NOTE It is not tread safe by itself, but each FH that need to be managed throught cache must be locked by inode.

Definition at line 94 of file hsm_FHcache.h.


Constructor & Destructor Documentation

hsm_FHcache::hsm_FHcache ( UInt32_t  a_hashSize  ) 

Constructor for creating a vector (STK container) of size a_hashSize.

Parameters:
a_hashSize number opf elements, which vector should take

Definition at line 194 of file hsm_FHcache.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, and m_hashSize.

    :
    m_hashSize(a_hashSize)
{
    log_FUNC_m(hsm_FHcache);
    resize(m_hashSize);
    // prepare all FH pointer vector managers
    for (hsm_FHpVM_p_i iter = begin(); iter != end(); iter++) {
        *iter = new hsm_FHpVecMgr;
    }
    log_DBG_m(dbg_DETAIL, ">>Cache List with " << m_hashSize << " elements IS_CREATED.");
}

hsm_FHcache::~hsm_FHcache (  )  [virtual]

Definition at line 209 of file hsm_FHcache.cpp.

References dbg_LOW, log_DBG_m, log_FUNC_m, and NULL.

                         {

    log_FUNC_m(~hsm_FHcache);
    log_DBG_m(dbg_LOW, "      ~hsm_FHcache: delete its elements");
    for (hsm_FHpVM_p_i iter = begin(); iter != end(); iter++) {
         if (*iter != NULL) {
             delete *iter;
         }
    }
}


Member Function Documentation

hsm_FileHeader * hsm_FHcache::GetFH ( ivd_GenInode_t  a_generalInode  ) 

Definition at line 246 of file hsm_FHcache.cpp.

References HashFunc(), and IVD_FILE_INO.

Referenced by hsm_ActiveFH::ActiveToList(), TreeWalk::CheckDir(), fs_api::FindAndPrepareFH(), fs_api::GetDirFH(), hsmGetDirFH(), hsmGetFH(), hsm_ActiveFH::OrphanedToMigList(), and hsm_FHrelc::Truncate().

                                                                 {
    return operator[](HashFunc(IVD_FILE_INO(a_generalInode)))->GetFH(a_generalInode);
}

Here is the call graph for this function:

Here is the caller graph for this function:

UInt32_t hsm_FHcache::HashFunc ( UInt32_t  a_inode  )  [inline]

Definition at line 106 of file hsm_FHcache.h.

References m_hashSize.

Referenced by GetFH(), Insert(), InsertDirWithTest(), Remove(), and RemoveLastButOne().

                                        {
        return (a_inode % m_hashSize);
    };

Here is the caller graph for this function:

void hsm_FHcache::Insert ( hsm_FileHeader a_FileHObj  ) 

Definition at line 222 of file hsm_FHcache.cpp.

References hsm_FileHeader::GetShortInode(), and HashFunc().

Referenced by hsm_ActiveFH::ActiveToList(), fs_api::AddGenericEvent(), fs_api::EventDataOffline(), fs_api::EventDelete(), fs_api::EventMove(), hsmGetFH(), and hsm_ActiveFH::OrphanedToMigList().

                                                   {
    operator[](HashFunc(a_FileHObj->GetShortInode()))->Insert(a_FileHObj);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FHcache::InsertDirWithTest ( hsm_FileHeader **  a_FileHObj  ) 

If Dir FH that is going to be inserted is already in cache than cache delete it and update pointer to FH that point to FH known by cache.

Definition at line 228 of file hsm_FHcache.cpp.

References HashFunc().

Referenced by fs_api::GetDirFH(), and hsmGetDirFH().

                                                               {
    operator[](HashFunc((*a_FileHObj)->GetShortInode()))->InsertDirWithTest(a_FileHObj);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FHcache::Remove ( hsm_FileHeader a_FileHObj  ) 

Definition at line 234 of file hsm_FHcache.cpp.

References hsm_FileHeader::GetShortInode(), and HashFunc().

Referenced by fs_api::AddGenericEvent(), hsm_FileHeader::Event(), and hsm_FileHeader::RemoveFromHSM().

                                                   {    
    operator[](HashFunc(a_FileHObj->GetShortInode()))->Remove(a_FileHObj);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool hsm_FHcache::RemoveLastButOne ( hsm_FileHeader a_FileHObj  ) 

remove if only one reference stay

Definition at line 240 of file hsm_FHcache.cpp.

References hsm_FileHeader::GetShortInode(), and HashFunc().

Referenced by hsm_FileHeader::CompleteMigIsDone(), hsm_FileHeader::EventOffline(), hsm_FileHeader::Recalled(), and hsm_DirWaitList::TaskTime().

                                                             {    
    return operator[](HashFunc(a_FileHObj->GetShortInode()))->RemoveLastButOne(a_FileHObj);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 103 of file hsm_FHcache.h.

Definition at line 100 of file hsm_FHcache.h.

Referenced by HashFunc(), and hsm_FHcache().


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