hsm_DirWaitList Class Reference
[Classes for managing object list]

#include <hsm_DirWaitList.h>

Inheritance diagram for hsm_DirWaitList:

Inheritance graph
[legend]
Collaboration diagram for hsm_DirWaitList:

Collaboration graph
[legend]

List of all members.


Detailed Description

hsm_DirWaitList class manages files which are "Dirty".

Definition at line 34 of file hsm_DirWaitList.h.


Public Member Functions

 hsm_DirWaitList (bool &a_running, ivd_Time32_t a_waitTime)
virtual ~hsm_DirWaitList ()
virtual void TaskTime ()
 implementetion of removing directories from sistem
void DumpStatus (ostringstream &sstr)

Public Attributes

 log_CLASSID_m

Constructor & Destructor Documentation

hsm_DirWaitList::hsm_DirWaitList ( bool &  a_running,
ivd_Time32_t  a_waitTime 
)

Definition at line 46 of file hsm_DirWaitList.cpp.

References log_FUNC_m.

00049     :
00050     hsm_TimedList(a_running, 
00051                   a_waitTime)
00052 {
00053     log_FUNC_m(hsm_DirWaitList);
00054 }
//============================================================================//

virtual hsm_DirWaitList::~hsm_DirWaitList (  )  [inline, virtual]

Definition at line 41 of file hsm_DirWaitList.h.

00041 {};


Member Function Documentation

void hsm_DirWaitList::TaskTime ( void   )  [virtual]

implementetion of removing directories from sistem

Dirty list manager check if exist eny candidate to move to Migration candidate list It is started by thread and is checking Dirty list at some time interval.

proceed one quoter more than policy ask

Implements hsm_TimedList.

Definition at line 62 of file hsm_DirWaitList.cpp.

References hsm_FileHeader::CleanDirListPos(), dbg_DETAIL, dbg_NORM, g_hsm_FHCache_p, g_hsm_fhLock, hsm_FileHeader::GetInode(), ie_NULLPTR, IVD_PRINT_ID_FS, cmn_Mutex::Lock(), log_DBG_m, log_FUNC_m, hsm_TimedList::m_goDown, hsm_TimedList::m_quaterTime, hsm_TimedList::m_timedList_x, NULL, hsm_TimedList::Remove(), hsm_FHcache::RemoveLastButOne(), size, hsm_TimedList::SpliceToEndNoLock(), and cmn_Mutex::Unlock().

00062                                    {
00063     log_FUNC_m(TaskTime);
00064 
00065     log_DBG_m(dbg_DETAIL, "Start removing not used directories from memory.");
00066 
00067     m_timedList_x.Lock();
00068     hsm_FHtimed_li iter;
00069     while ((iter = begin()) != end()) {
00070         if (m_goDown) {
00071             log_DBG_m (dbg_NORM, "Shut down. Abort Directory List."); 
00072             break;
00073         }
00075         if ((*iter).m_wakeUpTime <= time(NULL) + m_quaterTime) {
00076             hsm_FileHeader &fh = *(*iter).m_fh_p;
00077             if (&fh == NULL) {
00078                 m_timedList_x.Unlock();
00079                 throw ivd_InternalError(ie_NULLPTR, "unused dir list contain NULL pointer.", true);
00080             }
00081             ivd_GenInode_t inode = fh.GetInode();
00082             if (!g_hsm_fhLock.CanLockByID(inode)) {
00083                 log_DBG_m(dbg_DETAIL, "FH is locked. Skip it. INO = " << IVD_PRINT_ID_FS(inode) );
00084                 SpliceToEndNoLock(iter);
00085                 if (size() == 1) { // if only one element is in list then stop
00086                    break;
00087                 }
00088                 continue;  // can't use this FH already locked, so skip it
00089             }
00090             // now FH is locked, so list can be unlock
00091             m_timedList_x.Unlock();
00092             
00093             log_DBG_m(dbg_DETAIL, "Directory is going to remove. INO " 
00094                                     << IVD_PRINT_ID_FS(inode));
00095             if (g_hsm_FHCache_p->RemoveLastButOne(&fh)) { // must be last but one reference 
00096                 Remove(iter);
00097                 g_hsm_fhLock.UnLockByID(inode);
00098             }
00099             else {
00100                 log_DBG_m(dbg_DETAIL, "Directory is not removed from cache. INO " 
00101                                     << IVD_PRINT_ID_FS(inode));
00102                 Remove(iter);
00103                 fh.CleanDirListPos();
00104                 g_hsm_fhLock.UnLockByID(inode);
00105             }
00106         }
00107         else {
00108             break; // next directoryes are to young
00109         }
00110         m_timedList_x.Lock();
00111     }
00112     m_timedList_x.Unlock();
00113 }

Here is the call graph for this function:

void hsm_DirWaitList::DumpStatus ( ostringstream &  sstr  ) 

Definition at line 116 of file hsm_DirWaitList.cpp.

References size.

Referenced by i_HSM_i::ShowStatus().

00116                                                     {
00117     sstr << "Number of directories in DirWaitList :  " << size() << endl;
00118 }

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from hsm_TimedList.

Definition at line 41 of file hsm_DirWaitList.h.


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

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