Classes | Typedefs | Enumerations | Functions | Variables

HSM Database
[Client]

Collaboration diagram for HSM Database:

Classes

struct  hdb_file2hdbID_t
struct  hdb_DirNode_t
 structure hdb_DirNode_t is used for store HSM active directories. More...
struct  hdb_NameOwner_t
struct  hdb_Active_t
struct  hdbWIN_Active_t
struct  hdbWIN_ReleaseCand_t
struct  hdbLNX_ReleaseCand_t
struct  hdb_ReleaseCand_t
struct  hdb_DirTree_t
class  hdb_Tables

Typedefs

typedef vector< hsm_FileHeader * > hsm_FileHeader_p_v_t
typedef
hsm_FileHeader_p_v_t::iterator 
hsm_FileHeader_p_v_i
typedef
hsm_FileHeader_p_v_t::size_type 
hsm_FileHeader_p_v_st
typedef fio_String
<&g_DirEntName_p
hdb_String
typedef vector< hdb_DirTree_thdb_DirTreeVec_t

Enumerations

enum  hdb_circList_e {
  clNoList, clMigration,
  clRecall, clSmall
}

Functions

cmn_Path IVD_HSMDB_DECL_d hsmdbGetPath (hdb_DirNode_t &a_dir)
cmn_Path IVD_HSMDB_DECL_d hsmdbGetPath (hdb_DirNode_t &a_dir, hdb_DirTreeVec_t &dirNode_v)
void IVD_HSMDB_DECL_d hdbReadNameOwnRec (ivd_RecordIDX_t a_nameOwnIdx, ivd_RecordIDX_t &a_dirTreeIdx, hdb_String &a_name, hdb_DirNode_t &a_ownerRec)
 get name, owner inode and oner nameOwnIdx from DB by using nameOwnIdx.
void IVD_HSMDB_DECL_d hdb_RemoveName (ivd_RecordIDX_t a_nameOwnIdx, fio_Transaction &a_trans)

Variables

IVD_HSMDB_DECL_d fio_VarLenRFTg_DirEntName_p
 global pointers to relative files
IVD_HSMDB_DECL_d fio_RelFileTransg_DirTree_p
IVD_HSMDB_DECL_d fio_RelFileTransg_NameOwner_p
IVD_HSMDB_DECL_d fio_RelFileTransg_File2hdbID_p
IVD_HSMDB_DECL_d fio_CirFileTransg_Active_p
IVD_HSMDB_DECL_d fio_CirFileTransg_RelCandRecal_p
IVD_HSMDB_DECL_d fio_CirFileTransg_RelCandMigrt_p
IVD_HSMDB_DECL_d fio_CirFileTransg_RelCandSmall_p
IVD_HSMDB_DECL_d fio_DataBaseg_hsmDB_p

Typedef Documentation

Definition at line 85 of file hdb_Tables.h.

Definition at line 81 of file hdb_Tables.h.

typedef hsm_FileHeader_p_v_t::iterator hsm_FileHeader_p_v_i

Definition at line 46 of file hdb_common.h.

typedef hsm_FileHeader_p_v_t::size_type hsm_FileHeader_p_v_st

Definition at line 47 of file hdb_common.h.

Definition at line 43 of file hdb_common.h.


Enumeration Type Documentation

Enumerator:
clNoList 
clMigration 
clRecall 
clSmall 

Definition at line 52 of file hdb_common.h.

                     {
    clNoList,
    clMigration,
    clRecall,
    clSmall
};


Function Documentation

void IVD_HSMDB_DECL_d hdb_RemoveName ( ivd_RecordIDX_t  a_nameOwnIdx,
fio_Transaction a_trans 
)

Definition at line 378 of file hdb_Tables.cpp.

References fio_Transaction::EndTransaction(), log_FUNC_m, hdb_NameOwner_t::nameIdx, hdb_NameOwner_t::nameSize, fio_RelFile::ReadRec(), fio_RelFileTrans::ReleaseVectorIdx(), size, fio_Transaction::StartTransaction(), and fio_BasicString::Write2DB().

Referenced by hsm_ActiveFH::ActiveToList(), and hsm_ActiveFH::OrphanedToMigList().

                                              {
    log_FUNC_m(ActiveToList);
    if (a_nameOwnIdx == 0) {
        return;
    }

    // get name from DB
    hdb_NameOwner_t nameOwn;
    g_NameOwner_p->ReadRec(a_nameOwnIdx, &nameOwn);

    hdb_String name(nameOwn.nameSize, nameOwn.nameIdx);

    a_trans.StartTransaction();

    // remove nameOwnIdx
    g_NameOwner_p->ReleaseVectorIdx(a_nameOwnIdx, 1, &a_trans);
    // remove name
    ivd_RecordIDX_t nameIdx(0);
    ivd_VectorSize_t size(0);
    name.erase();
    name.Write2DB(size, nameIdx, a_trans);  // release old name

    a_trans.EndTransaction();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void IVD_HSMDB_DECL_d hdbReadNameOwnRec ( ivd_RecordIDX_t  a_nameOwnIdx,
ivd_RecordIDX_t a_dirTreeIdx,
hdb_String a_name,
hdb_DirNode_t a_ownerRec 
)

get name, owner inode and oner nameOwnIdx from DB by using nameOwnIdx.

helper method return name and fill owner's dirNode struct

Definition at line 348 of file hdb_Tables.cpp.

References hdb_DirNode_t::Clear(), dbg_DETAIL, hdb_NameOwner_t::dirTreeIdx, hdbReadNameOwnRec(), log_DBG_m, log_FUNC_m, hdb_NameOwner_t::nameIdx, hdb_NameOwner_t::nameSize, and fio_RelFile::ReadRec().

Referenced by hsm_ActiveFH::ActiveToList(), hdb_Tables::DumpActiveEntries(), hdb_Tables::DumpMigratedFiles(), hdb_Tables::DumpReleaseCand(), hdbReadNameOwnRec(), hsmdbGetPath(), hsmGetDirFH(), hsm_FileHeader::InitActive(), hsm_ActiveFH::OrphanedToMigList(), and hsm_FHrelc::Truncate().

                                                    {
    
    log_FUNC_m(hdbReadNameOwnRec);
    // get name and owner from DB
    log_DBG_m(dbg_DETAIL, "Read NameOwnRec from idx " << a_nameOwnIdx);
    hdb_NameOwner_t nameOwn;
    if (a_nameOwnIdx > 0) {
        g_NameOwner_p->ReadRec(a_nameOwnIdx, &nameOwn);
        hdb_String name(nameOwn.nameSize, nameOwn.nameIdx);
        a_name = name;

        log_DBG_m(dbg_DETAIL, "Got NameOwnRec  " << nameOwn);
        if (nameOwn.dirTreeIdx > 0) {
            g_DirTree_p->ReadRec(nameOwn.dirTreeIdx, &a_ownerRec);
        }
        else {
            a_ownerRec.Clear();
        }
    }
    else {
        a_ownerRec.Clear();
        a_name.empty();
    }
    a_dirTreeIdx = nameOwn.dirTreeIdx;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cmn_Path IVD_HSMDB_DECL_d hsmdbGetPath ( hdb_DirNode_t a_dir  ) 

Definition at line 307 of file hdb_Tables.cpp.

References hdbReadNameOwnRec(), hsmdbGetPath(), log_FUNC_m, and hdb_DirNode_t::nameOwnIdx.

Referenced by hsm_ActiveFH::ActiveToList(), hdb_Tables::DumpActiveEntries(), hdb_Tables::DumpMigratedFiles(), hdb_Tables::DumpReleaseCand(), hsmdbGetPath(), hsmGetDirFH(), hsm_ActiveFH::OrphanedToMigList(), and hsm_FHrelc::Truncate().

                                             {
    log_FUNC_m(hsmdbGetPath);
    // try to find FH by inode
        
    hdb_String name;
    hdb_DirNode_t ownDir;
    ivd_RecordIDX_t dirIdx;
    // get dir name and ownerDirNode record
    hdbReadNameOwnRec(a_dir.nameOwnIdx, dirIdx, name, ownDir);

    if (ownDir.nameOwnIdx > 0) {  // if has owner get it
        // ivoke to recursion, call itself
        return hsmdbGetPath(ownDir) + name;
    }
        
    return name;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cmn_Path IVD_HSMDB_DECL_d hsmdbGetPath ( hdb_DirNode_t a_dir,
hdb_DirTreeVec_t dirNode_v 
)

Variable Documentation

IVD_HSMDB_DECL_d fio_CirFileTrans* g_Active_p

Definition at line 60 of file hdb_Tables.cpp.

Referenced by hsm_Containers::hsm_Containers().

IVD_HSMDB_DECL_d fio_VarLenRFT* g_DirEntName_p

global pointers to relative files

Definition at line 56 of file hdb_Tables.cpp.

IVD_HSMDB_DECL_d fio_RelFileTrans* g_DirTree_p

Definition at line 57 of file hdb_Tables.cpp.

Referenced by hsm_FileHeader::StoreDirTreeRec().

IVD_HSMDB_DECL_d fio_RelFileTrans* g_File2hdbID_p
IVD_HSMDB_DECL_d fio_DataBase* g_hsmDB_p
IVD_HSMDB_DECL_d fio_RelFileTrans* g_NameOwner_p

Definition at line 62 of file hdb_Tables.cpp.

Referenced by main().

Definition at line 61 of file hdb_Tables.cpp.

Referenced by main().

Definition at line 63 of file hdb_Tables.cpp.

Referenced by main().