hsm_FHcache Class Reference
[Classes for managing object list]

#include <hsm_FHcache.h>

Inheritance diagram for hsm_FHcache:

Inheritance graph
[legend]
Collaboration diagram for hsm_FHcache:

Collaboration graph
[legend]

List of all members.


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 80 of file hsm_FHcache.h.


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

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 180 of file hsm_FHcache.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, and m_hashSize.

00181     :
00182     m_hashSize(a_hashSize)
00183 {
00184     log_FUNC_m(hsm_FHcache);
00185     resize(m_hashSize);
00186     // prepare all FH pointer vector managers
00187     for (hsm_FHpVM_p_i iter = begin(); iter != end(); iter++) {
00188         *iter = new hsm_FHpVecMgr;
00189     }
00190     log_DBG_m(dbg_DETAIL, ">>Cache List with " << m_hashSize << " elements IS_CREATED.");
00191 }
//============================================================================//

hsm_FHcache::~hsm_FHcache (  )  [virtual]

Definition at line 195 of file hsm_FHcache.cpp.

References dbg_LOW, log_DBG_m, log_FUNC_m, and NULL.

00195                          {
00196 
00197     log_FUNC_m(~hsm_FHcache);
00198     log_DBG_m(dbg_LOW, "      ~hsm_FHcache: delete its elements");
00199     for (hsm_FHpVM_p_i iter = begin(); iter != end(); iter++) {
00200          if (*iter != NULL) {
00201              delete *iter;
00202          }
00203     }
00204 }


Member Function Documentation

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

Definition at line 92 of file hsm_FHcache.h.

References m_hashSize.

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

00092                                         {
00093         return (a_inode % m_hashSize);
00094     };

Here is the caller graph for this function:

void hsm_FHcache::Insert ( hsm_FileHeader a_FileHObj  ) 

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

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

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 214 of file hsm_FHcache.cpp.

References HashFunc().

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

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

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 220 of file hsm_FHcache.cpp.

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

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

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

hsm_FileHeader * hsm_FHcache::GetFH ( ivd_GenInode_t  a_generalInode  ) 

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

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

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 86 of file hsm_FHcache.h.

Referenced by HashFunc(), and hsm_FHcache().

Definition at line 89 of file hsm_FHcache.h.


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

Generated on Mon Feb 27 19:25:59 2012 for OPENARCHIVE by  doxygen 1.5.6