Public Member Functions | Public Attributes | Private Attributes

hsm_InoObj Class Reference
[Classes for managing object list]

Simple class one line description. More...

#include <hsm_InoObj.h>

List of all members.

Public Member Functions

 hsm_InoObj (ivd_FS_FileProperty_t &a_fileProp, hsm_ChgFlag_t a_inodeChgFlag=0)
 hsm_InoObj (ivd_FileType_e a_fType, ivd_GenInode_t a_inode, ivd_FileID_t a_fileID, hsm_ChgFlag_t a_inodeChgFlag=0)
 constructor for creating an object from I-node, fileID and chunk size
 hsm_InoObj ()
 Default constructor.
virtual ~hsm_InoObj ()
 destructor
bool operator== (ivd_GenInode_t a_inode)
bool operator== (hsm_InoObj &a_inodeObj)
 compare if two inodes are organicaly same have equal: inode, fileID, chunkSize
ivd_FileSize_t GetFileSize (void) const
ivd_FileType_e GetfType (void) const
UInt64_t GetInode (void) const
UInt32_t GetShortInode () const
ivd_FileID_t GetFileId (void) const
ivd_FileSize_t GetChnSize (void) const
hsm_ChgFlag_t GetInodeChgFlag (void) const
bool IsDeleted (void) const
bool IsDirty (void) const
bool GetOffline (void) const
void ResetDataInPacker ()
void SetDataInPacker ()
bool IsDataInPacker ()
void SetDirty (bool a_dirty)
void SetInode (ivd_GenInode_t a_fInode)
void SetInodeChgFlag (hsm_ChgFlag_t a_inodeChgFlag)
void UnSetInodeChgFlag (hsm_ChgFlag_t a_inodeChgFlag)
void SetFileSize (ivd_FileSize_t a_fileSize)
void SetChnSize (ivd_FileSize_t a_chnSize)
void SetFileID (ivd_FileID_t a_fileId)
 set fileID and extend atributes
void UpdateFileID (ivd_FileID_t a_fileId)
 set fileID and DOESN'T set EA
void CleanChgFlag (ivd_Time_t a_modTimeAtMig)
void SetOffline (bool a_offline, const cmn_Path &a_fullPath)
void IncrRef ()
 method to increment reference to this object to know how many File header objects are referenced to it
void DecrRef ()
 method to decrement reference to this object.
bool IsEqual (hsm_InoObj *a_InoObj) const
 method to check if object in input is equal to this object
void SetMigAllowedTime (ivd_Time32_t a_migAllowedTime)
ivd_Time32_t GetMigAllowedTime ()
 hsm_InoObj (UInt64_t a_inode, ivd_FileID_t a_fileID, ivd_FileSize_t a_chnSize, ivd_FileSize_t a_fileSize=0)
 hsm_InoObj ()
 Default constructor.
virtual ~hsm_InoObj ()
ivd_FileSize_t GetFileSize (void) const
UInt64_t GetInode (void) const
ivd_FileID_t GetFileId (void) const
ivd_FileSize_t GetChnSize (void) const
UInt16_t GetData (void) const
void SetInode (UInt64_t a_fInode)
void SetChnData (UInt16_t a_Data)
void SetFileId (ivd_FileID_t a_fileId)
void SetFileSize (ivd_FileSize_t a_fileSize)
void SetChnSize (ivd_FileSize_t a_chnSize)
void Update (ivd_FileID_t a_fileId, ivd_FileSize_t a_fileSize=0)
void IncrRef ()
void DecrRef ()
bool IsEqual (hsm_InoObj *a_InoObj) const

Public Attributes

 log_CLASSID_m
 Macro to add class name member s_className.
ivd_Time32_t m_lastDataUpdataInDB
 Do not update HSMDB to often.

Private Attributes

ivd_FileType_e m_fType
 File type eRegular, eSymlink, eDirectory, eDevice.
ivd_GenInode_t m_fInode
ivd_FileID_t m_fileId
ivd_FileSize_t m_chnSize
ivd_FileSize_t m_fileSize
 Whole file size - with all chunks.
UInt16_t m_inodeRef
hsm_ChgFlag_t m_inodeChgFlag
 which part of file is changed
bool m_offline
bool m_dirty
 dirty flag is set by constructor, but only for directories as owner NOTE!!! active object has not defined this flag
bool m_dataInPacker
ivd_Time32_t m_migAllowedTime
 when data or attr is changed this member is set to time when migratin is allowed.
UInt64_t m_fInode
UInt16_t m_Data

Detailed Description

Simple class one line description.

A more elaborate class description that describes all aspects of class usage etc.

Definition at line 49 of file client/hsmlist/hsm_InoObj.h.


Constructor & Destructor Documentation

hsm_InoObj::hsm_InoObj ( ivd_FS_FileProperty_t a_fileProp,
hsm_ChgFlag_t  a_inodeChgFlag = 0 
)

Definition at line 63 of file hsm_InoObj.cpp.

References hsm_InoObj(), and log_FUNC_m.

                        :
                        m_fType(a_fileProp.m_type),
                        m_fInode(a_fileProp.m_Inode),
                        m_fileId(a_fileProp.m_fileID),
                        m_chnSize(a_fileProp.m_chunkSize),
                        m_fileSize(a_fileProp.m_fileSize),
                        m_inodeRef(1),// some one need it, same as find in cache increase reference
                        m_inodeChgFlag(a_inodeChgFlag),  // Flag 1 bit ON data exist and is changed
                        m_offline(a_fileProp.m_offlineFlag),
                        m_dirty(a_fileProp.m_dirtyFlag),
                        m_dataInPacker(false),
                        m_migAllowedTime(0), // any time 
                        m_lastDataUpdataInDB(0)
{
    log_FUNC_m(hsm_InoObj(ivd_FS_FileProperty));
}

Here is the call graph for this function:

hsm_InoObj::hsm_InoObj ( ivd_FileType_e  a_fType,
ivd_GenInode_t  a_inode,
ivd_FileID_t  a_fileID,
hsm_ChgFlag_t  a_inodeChgFlag = 0 
)

constructor for creating an object from I-node, fileID and chunk size

Parameters:
a_inode I-node,
a_fileID file ID from FSC,
a_chnSize Chunk size

Definition at line 86 of file hsm_InoObj.cpp.

References log_FUNC_m.

                       :
                        m_fType(a_fType),
                        m_fInode(a_inode),
                        m_fileId(a_fileID),
                        m_chnSize(0),
                        m_fileSize(0),
                        m_inodeRef(1),// some one need it, same as find in cache increase reference
                        m_inodeChgFlag(a_inodeChgFlag),
                        m_offline(false),
                        m_dirty(false),
                        m_dataInPacker(false),
                        m_migAllowedTime(0),
                        m_lastDataUpdataInDB(0)
{
    log_FUNC_m(hsm_InoObj);
}

hsm_InoObj::hsm_InoObj (  ) 

Default constructor.

Referenced by hsm_InoObj().

Here is the caller graph for this function:

hsm_InoObj::~hsm_InoObj (  )  [virtual]

destructor

Definition at line 111 of file hsm_InoObj.cpp.

References log_FUNC_m.

                       {
    log_FUNC_m(~hsm_InoObj);
    // NULL statement
}

hsm_InoObj::hsm_InoObj ( UInt64_t  a_inode,
ivd_FileID_t  a_fileID,
ivd_FileSize_t  a_chnSize,
ivd_FileSize_t  a_fileSize = 0 
)
hsm_InoObj::hsm_InoObj (  ) 

Default constructor.

virtual hsm_InoObj::~hsm_InoObj (  )  [virtual]

Member Function Documentation

void hsm_InoObj::CleanChgFlag ( ivd_Time_t  a_modTimeAtMig  ) 

Definition at line 202 of file hsm_InoObj.cpp.

References file, g_fs_api_p, log_FUNC_m, m_chnSize, m_fileId, m_fileSize, m_fInode, m_inodeChgFlag, and ivd_FS_File::SetDataClean().

Referenced by hsm_FileHeader::CleanChgFlag().

                                                       { 
    log_FUNC_m(CleanChgFlag);
    m_inodeChgFlag = 0;
    if (m_fileSize > 0) {
        ivd_FS_File file(*g_fs_api_p, m_fInode, m_fileId);
        file.SetDataClean(a_modTimeAtMig, 0, m_chnSize);

    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_InoObj::DecrRef (  ) 
void hsm_InoObj::DecrRef (  ) 

method to decrement reference to this object.

This method is used for deleting the object from memory. It should be deleted just in case that no File Header object is referenced to it.

Definition at line 154 of file hsm_InoObj.cpp.

References dbg_DETAIL, dbg_NORM, IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, m_fInode, and m_inodeRef.

Referenced by hsm_FileHeader::DecInodeRef(), and hsm_FileHeader::~hsm_FileHeader().

                        {
//    cmn_MutexLock l(m_Reference_x);  not need locked by inode
    log_FUNC_m(DecrRef);
    m_inodeRef--;
    log_DBG_m(dbg_DETAIL, "Dec InoRef = " << m_inodeRef << ". INO " << IVD_PRINT_ID_FS(m_fInode));
    if (m_inodeRef == 0){
        log_DBG_m(dbg_NORM, "InoRef is 0. Inode of FH is going to delete. INO " << IVD_PRINT_ID_FS(m_fInode));
        delete this;
    }
}

Here is the caller graph for this function:

ivd_FileSize_t hsm_InoObj::GetChnSize ( void   )  const [inline]

Definition at line 80 of file include/ivd/hsm_InoObj.h.

References m_chnSize.

{ return m_chnSize;};

ivd_FileSize_t hsm_InoObj::GetChnSize ( void   )  const [inline]

Definition at line 119 of file client/hsmlist/hsm_InoObj.h.

References m_chnSize.

Referenced by hsm_FileHeader::Recalled().

{ return m_chnSize;};

Here is the caller graph for this function:

UInt16_t hsm_InoObj::GetData ( void   )  const [inline]

Definition at line 81 of file include/ivd/hsm_InoObj.h.

References m_Data.

{ return m_Data   ;};

ivd_FileID_t hsm_InoObj::GetFileId ( void   )  const [inline]

Definition at line 118 of file client/hsmlist/hsm_InoObj.h.

References m_fileId.

Referenced by hsm_FileHeader::GetFileID(), and hsm_FHrelc::Truncate().

{ return m_fileId ;};

Here is the caller graph for this function:

ivd_FileID_t hsm_InoObj::GetFileId ( void   )  const [inline]

Definition at line 79 of file include/ivd/hsm_InoObj.h.

References m_fileId.

{ return m_fileId ;};

ivd_FileSize_t hsm_InoObj::GetFileSize ( void   )  const [inline]
ivd_FileSize_t hsm_InoObj::GetFileSize ( void   )  const [inline]

Definition at line 77 of file include/ivd/hsm_InoObj.h.

References m_fileSize.

{ return m_fileSize;};

ivd_FileType_e hsm_InoObj::GetfType ( void   )  const [inline]

Definition at line 115 of file client/hsmlist/hsm_InoObj.h.

References m_fType.

Referenced by hsm_FileHeader::GetFileType(), and hsm_FileHeader::GetfType().

{ return m_fType     ;}; 

Here is the caller graph for this function:

UInt64_t hsm_InoObj::GetInode ( void   )  const [inline]

Definition at line 78 of file include/ivd/hsm_InoObj.h.

References m_fInode.

{ return m_fInode ;};

UInt64_t hsm_InoObj::GetInode ( void   )  const [inline]

Definition at line 116 of file client/hsmlist/hsm_InoObj.h.

References m_fInode.

Referenced by hsm_FileHeader::GetInode(), and IsEqual().

{ return m_fInode ;};

Here is the caller graph for this function:

hsm_ChgFlag_t hsm_InoObj::GetInodeChgFlag ( void   )  const [inline]
ivd_Time32_t hsm_InoObj::GetMigAllowedTime (  )  [inline]

Definition at line 145 of file client/hsmlist/hsm_InoObj.h.

References m_migAllowedTime.

Referenced by hsm_FileHeader::GetMigAllowedTime().

{return m_migAllowedTime;};

Here is the caller graph for this function:

bool hsm_InoObj::GetOffline ( void   )  const [inline]

Definition at line 123 of file client/hsmlist/hsm_InoObj.h.

References m_offline.

Referenced by hsm_FileHeader::GetOffline().

{ return m_offline;};

Here is the caller graph for this function:

UInt32_t hsm_InoObj::GetShortInode (  )  const [inline]

Definition at line 117 of file client/hsmlist/hsm_InoObj.h.

References IVD_FILE_INO, and m_fInode.

Referenced by hsm_FileHeader::GetShortInode().

{ return IVD_FILE_INO(m_fInode);};    

Here is the caller graph for this function:

void hsm_InoObj::IncrRef (  ) 
void hsm_InoObj::IncrRef (  ) 

method to increment reference to this object to know how many File header objects are referenced to it

Definition at line 140 of file hsm_InoObj.cpp.

References dbg_DETAIL, IVD_PRINT_ID_FS, log_DBG_m, log_FUNC_m, m_fInode, and m_inodeRef.

                        {
    log_FUNC_m(IncrRef);
//    cmn_MutexLock l(m_Reference_x);   not need locked by inode
    m_inodeRef++;
    log_DBG_m(dbg_DETAIL, "Inc InoRef = " << m_inodeRef << ". INO " << IVD_PRINT_ID_FS(m_fInode));
}

bool hsm_InoObj::IsDataInPacker (  )  [inline]

Definition at line 126 of file client/hsmlist/hsm_InoObj.h.

References m_dataInPacker.

Referenced by hsm_FileHeader::IsDataInPacker().

{ return m_dataInPacker;};

Here is the caller graph for this function:

bool hsm_InoObj::IsDeleted ( void   )  const [inline]

Definition at line 121 of file client/hsmlist/hsm_InoObj.h.

References CHG_DELETED_d, and m_inodeChgFlag.

Referenced by hsm_FileHeader::IsDeleted().

{ return (m_inodeChgFlag & CHG_DELETED_d) == CHG_DELETED_d;};

Here is the caller graph for this function:

bool hsm_InoObj::IsDirty ( void   )  const [inline]

Definition at line 122 of file client/hsmlist/hsm_InoObj.h.

References m_dirty.

Referenced by hsm_FileHeader::IsDirty().

{ return m_dirty;};

Here is the caller graph for this function:

bool hsm_InoObj::IsEqual ( hsm_InoObj a_InoObj  )  const
bool hsm_InoObj::IsEqual ( hsm_InoObj a_InoObj  )  const

method to check if object in input is equal to this object

Parameters:
a_InoObj I-node object to check
Returns:
true if they're equal otherwise false

Definition at line 174 of file hsm_InoObj.cpp.

References GetInode(), log_FUNC_m, m_fInode, and NULL.

                                                   {
    
    log_FUNC_m(IsEqual);
    if ( a_InoObj != NULL && a_InoObj->GetInode() == m_fInode) {
        return true;
    }
    else {
        return false;
    }
}

Here is the call graph for this function:

bool hsm_InoObj::operator== ( hsm_InoObj a_inodeObj  ) 

compare if two inodes are organicaly same have equal: inode, fileID, chunkSize

Definition at line 129 of file hsm_InoObj.cpp.

References log_FUNC_m, m_chnSize, m_fileId, and m_fInode.

                                               {
    log_FUNC_m(operator==inodeObj);
    return (    m_fInode  == a_inode.m_fInode 
            &&  m_fileId  == a_inode.m_fileId 
            &&  m_chnSize == a_inode.m_chnSize );
}

bool hsm_InoObj::operator== ( ivd_GenInode_t  a_inode  ) 

Definition at line 118 of file hsm_InoObj.cpp.

References log_FUNC_m, and m_fInode.

                                                  {
    log_FUNC_m(operator==inode);
    return m_fInode  == a_inode;
}

void hsm_InoObj::ResetDataInPacker (  )  [inline]

Definition at line 124 of file client/hsmlist/hsm_InoObj.h.

References m_dataInPacker.

Referenced by hsm_FileHeader::ResetDataInPacker().

{ m_dataInPacker = false;};

Here is the caller graph for this function:

void hsm_InoObj::SetChnData ( UInt16_t  a_Data  )  [inline]

Definition at line 83 of file include/ivd/hsm_InoObj.h.

References m_Data.

{ m_Data    = a_Data;};

void hsm_InoObj::SetChnSize ( ivd_FileSize_t  a_chnSize  )  [inline]

Definition at line 132 of file client/hsmlist/hsm_InoObj.h.

References m_chnSize.

{m_chnSize = a_chnSize;};

void hsm_InoObj::SetChnSize ( ivd_FileSize_t  a_chnSize  )  [inline]

Definition at line 86 of file include/ivd/hsm_InoObj.h.

References m_chnSize.

{m_chnSize = a_chnSize;};

void hsm_InoObj::SetDataInPacker (  )  [inline]

Definition at line 125 of file client/hsmlist/hsm_InoObj.h.

References m_dataInPacker.

Referenced by hsm_FileHeader::SetDataInPacker().

{ m_dataInPacker = true;};

Here is the caller graph for this function:

void hsm_InoObj::SetDirty ( bool  a_dirty  )  [inline]

Definition at line 127 of file client/hsmlist/hsm_InoObj.h.

References m_dirty.

{ m_dirty = a_dirty;};

void hsm_InoObj::SetFileId ( ivd_FileID_t  a_fileId  )  [inline]

Definition at line 84 of file include/ivd/hsm_InoObj.h.

References m_fileId.

{m_fileId  = a_fileId;};

void hsm_InoObj::SetFileID ( ivd_FileID_t  a_fileId  ) 

set fileID and extend atributes

Definition at line 186 of file hsm_InoObj.cpp.

References file, g_fs_api_p, m_chnSize, m_fileId, m_fInode, and ivd_FS_File::SetFileID().

Referenced by hsm_FileHeader::SetFileID().

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_InoObj::SetFileSize ( ivd_FileSize_t  a_fileSize  )  [inline]

Definition at line 131 of file client/hsmlist/hsm_InoObj.h.

References m_fileSize.

Referenced by hsm_FileHeader::SetFileSize().

{ m_fileSize = a_fileSize;};

Here is the caller graph for this function:

void hsm_InoObj::SetFileSize ( ivd_FileSize_t  a_fileSize  )  [inline]

Definition at line 85 of file include/ivd/hsm_InoObj.h.

References m_fileSize.

{ m_fileSize = a_fileSize;};

void hsm_InoObj::SetInode ( ivd_GenInode_t  a_fInode  )  [inline]

Definition at line 128 of file client/hsmlist/hsm_InoObj.h.

References m_fInode.

{ m_fInode  = a_fInode ;};

void hsm_InoObj::SetInode ( UInt64_t  a_fInode  )  [inline]

Definition at line 82 of file include/ivd/hsm_InoObj.h.

References m_fInode.

{ m_fInode  = a_fInode ;};

void hsm_InoObj::SetInodeChgFlag ( hsm_ChgFlag_t  a_inodeChgFlag  ) 

Definition at line 211 of file hsm_InoObj.cpp.

References CHG_DELETED_d, log_FUNC_m, and m_inodeChgFlag.

Referenced by hsm_FileHeader::NewName(), hsm_FileHeader::NewOwner(), and hsm_FileHeader::SetInodeChgFlag().

                                                             { 
    log_FUNC_m(SetInodeChgFlag);
    if (a_inodeChgFlag == CHG_DELETED_d) {
        m_inodeChgFlag = CHG_DELETED_d;
    }
    else {
        m_inodeChgFlag |= a_inodeChgFlag;
    }
}

Here is the caller graph for this function:

void hsm_InoObj::SetMigAllowedTime ( ivd_Time32_t  a_migAllowedTime  )  [inline]

Definition at line 144 of file client/hsmlist/hsm_InoObj.h.

References m_migAllowedTime.

Referenced by hsm_FileHeader::InodeChgGoToDirty().

{m_migAllowedTime = a_migAllowedTime;};

Here is the caller graph for this function:

void hsm_InoObj::SetOffline ( bool  a_offline,
const cmn_Path a_fullPath 
)

Definition at line 223 of file hsm_InoObj.cpp.

References ivd_FS_File::Close(), ivd_FS_File::e_Cache, file, g_fs_api_p, m_chnSize, m_fileId, m_fInode, m_offline, ivd_FS_File::Open(), ivd_FS_File::SetDataOffline(), ivd_FS_File::SetDataOnline(), and ivd_FS_File::SetFullPath().

Referenced by hsm_FileHeader::SetOffline().

                                                                      {
    m_offline = a_offline;

    ivd_FS_File file(*g_fs_api_p, m_fInode, m_fileId);
    file.SetFullPath(a_fullPath);
    file.Open(ivd_FS_File::e_Cache,a_fullPath);
    if (a_offline) {
        file.SetDataOffline(0, m_chnSize);
    }
    else {
        file.SetDataOnline(0, m_chnSize);
    }
    file.Close();

}

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_InoObj::UnSetInodeChgFlag ( hsm_ChgFlag_t  a_inodeChgFlag  )  [inline]

Definition at line 130 of file client/hsmlist/hsm_InoObj.h.

References m_inodeChgFlag.

Referenced by hsm_FileHeader::UnSetInodeChgFlag().

{ m_inodeChgFlag    &= ~a_inodeChgFlag;};

Here is the caller graph for this function:

void hsm_InoObj::Update ( ivd_FileID_t  a_fileId,
ivd_FileSize_t  a_fileSize = 0 
)
void hsm_InoObj::UpdateFileID ( ivd_FileID_t  a_fileId  ) 

set fileID and DOESN'T set EA

Definition at line 196 of file hsm_InoObj.cpp.

References m_fileId.

Referenced by hsm_FileHeader::UpdateFileID().

                                                   {
    m_fileId  = a_fileId;
}

Here is the caller graph for this function:


Member Data Documentation

Macro to add class name member s_className.

Definition at line 67 of file client/hsmlist/hsm_InoObj.h.

Definition at line 72 of file include/ivd/hsm_InoObj.h.

Referenced by GetData(), and SetChnData().

Definition at line 97 of file client/hsmlist/hsm_InoObj.h.

Referenced by IsDataInPacker(), ResetDataInPacker(), and SetDataInPacker().

bool hsm_InoObj::m_dirty [private]

dirty flag is set by constructor, but only for directories as owner NOTE!!! active object has not defined this flag

Definition at line 94 of file client/hsmlist/hsm_InoObj.h.

Referenced by IsDirty(), and SetDirty().

Whole file size - with all chunks.

Definition at line 84 of file client/hsmlist/hsm_InoObj.h.

Referenced by CleanChgFlag(), GetFileSize(), and SetFileSize().

Definition at line 63 of file include/ivd/hsm_InoObj.h.

File type eRegular, eSymlink, eDirectory, eDevice.

Definition at line 76 of file client/hsmlist/hsm_InoObj.h.

Referenced by GetfType().

which part of file is changed

Definition at line 89 of file client/hsmlist/hsm_InoObj.h.

Referenced by CleanChgFlag(), GetInodeChgFlag(), IsDeleted(), SetInodeChgFlag(), and UnSetInodeChgFlag().

Definition at line 86 of file client/hsmlist/hsm_InoObj.h.

Referenced by DecrRef(), and IncrRef().

Do not update HSMDB to often.

See also:
hsm_FileHeader::Event() method

Definition at line 108 of file client/hsmlist/hsm_InoObj.h.

Referenced by hsm_FileHeader::Event(), and hsm_FileHeader::RemoveFromActiveList().

when data or attr is changed this member is set to time when migratin is allowed.

current time + minFileAge.

Definition at line 103 of file client/hsmlist/hsm_InoObj.h.

Referenced by GetMigAllowedTime(), and SetMigAllowedTime().

bool hsm_InoObj::m_offline [private]

Definition at line 91 of file client/hsmlist/hsm_InoObj.h.

Referenced by GetOffline(), and SetOffline().


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