Public Attributes | Private Member Functions | Private Attributes | Friends

rm_MajorCol Class Reference
[Resource Manager Database Library]

#include <rmdb.h>

Collaboration diagram for rm_MajorCol:
Collaboration graph
[legend]

List of all members.

Public Attributes

 log_CLASSID_m

Private Member Functions

 rm_MajorCol ()
 rm_MajorCol (UInt64_t a_majColId)
void Insert ()
void Update ()
void Remove (UInt64_t a_majColId)
void Select (UInt64_t a_majColId)
void StartSelectAll ()
void EndSelectAll ()
rm_MajorColNext ()

Private Attributes

UInt64_t majColId
UInt32_t majColSize
rm_String partUUID
UInt32_t flags

Friends

class rm_Operator

Detailed Description

Definition at line 887 of file rmdb.h.


Constructor & Destructor Documentation

rm_MajorCol::rm_MajorCol (  )  [private]

Definition at line 5693 of file librmdb.exx.

References log_FUNC_m.

rm_MajorCol::rm_MajorCol ( UInt64_t  a_majColId  )  [private]

Definition at line 5689 of file librmdb.exx.

References Select().

                                            {
    Select(a_majColId);
}

Here is the call graph for this function:


Member Function Documentation

void rm_MajorCol::EndSelectAll (  )  [private]

Definition at line 5845 of file librmdb.exx.

References errorDesc(), log_FUNC_A_m, SQL_CHECKREAD_M, and cmn_Mutex::Unlock().

                               {
    log_FUNC_A_m(EndSelectAll, "MajorCollocation");

    EXEC SQL
        CLOSE SELECT_ALL_MAJORCOL;

    g_majorColCursor_x.Unlock();
    string sqlErrDesc = errorDesc(SQLCODE,"EXEC SQL CLOSE SELECT_ALL_MAJORCOL");
    SQL_CHECKREAD_M(sqlErrDesc);

}//rm_majorCol::EndSelectAll

Here is the call graph for this function:

void rm_MajorCol::Insert (  )  [private]

Definition at line 5700 of file librmdb.exx.

References rm_String::cvalue_p, dbg_DETAIL, errorDesc(), flags, log_DBG_m, log_FUNC_A_m, majColId, majColSize, NAME, partUUID, RMDB_COL_ID_HI, RMDB_COL_ID_LO, and SQL_CHECK_M.

Referenced by rm_Operator::Add().

                         {

    log_FUNC_A_m(Insert, "MajorCollocation");

    Int32_t majColIdHi = RMDB_COL_ID_HI(majColId);
    Int32_t majColIdLo = RMDB_COL_ID_LO(majColId);

    log_DBG_m(dbg_DETAIL,"EXECUTING: " << endl
                        << "INSERT TRANSACTION readWriteTrans INTO MAJORCOL VALUES("
                        << majColIdHi << ", "
                        << majColIdLo << ", "
                        << majColSize << ", "
                        << partUUID.cvalue_p << ", "
                        << flags << "); ");

    EXEC SQL
        SET TRANSACTION NAME readWriteTrans;

    EXEC SQL
        INSERT TRANSACTION readWriteTrans INTO
            MAJORCOL VALUES(
                        :majColIdHi,
                        :majColIdLo,
                        :majColSize,
                        :partUUID.cvalue_p,
                        :flags
                     );

    string sqlErrDesc = errorDesc(SQLCODE,"Create Major Colocation ID", majColId);
    SQL_CHECK_M( sqlErrDesc );
}// rm_MajorCol::Insert()

Here is the call graph for this function:

Here is the caller graph for this function:

rm_MajorCol & rm_MajorCol::Next (  )  [private]

Definition at line 5858 of file librmdb.exx.

References errorDesc(), flags, ivd_UUID_STR_SIZE_d, log_FUNC_A_m, majColId, majColSize, partUUID, RMDB_COL_ID, RMDB_COL_ID_HI, RMDB_COL_ID_LO, SQL_CHECKREAD_M, SQL_NOERROR, and cmn_Mutex::Unlock().

Referenced by rm_Operator::SelectAllMajorCol().

                               {
    log_FUNC_A_m(Next, "MajorCollocation");

    Int32_t majColIdHi = RMDB_COL_ID_HI(majColId);
    Int32_t majColIdLo = RMDB_COL_ID_LO(majColId);
    char partUUIDStringVal[ivd_UUID_STR_SIZE_d + 1];

    EXEC SQL
        FETCH SELECT_ALL_MAJORCOL
                    INTO
                        :majColIdHi,
                        :majColIdLo,
                        :majColSize,
                        :partUUIDStringVal,
                        :flags;
    if (SQLCODE == SQL_NOERROR) {
        if (majColId == 0) majColId = -1;
    }
    else {
        int fetchCode = SQLCODE;
        EXEC SQL
            CLOSE SELECT_ALL_MAJORCOL;
        g_majorColCursor_x.Unlock();
        SQLCODE = fetchCode;
        string sqlErrDesc = errorDesc(fetchCode, "reached end of SELECT_ALL_MAJORCOL cursor");
        SQL_CHECKREAD_M(sqlErrDesc);
    };
    majColId = RMDB_COL_ID(majColIdHi, majColIdLo);
    partUUID = partUUIDStringVal;
    return *this;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_MajorCol::Remove ( UInt64_t  a_majColId  )  [private]

Definition at line 5734 of file librmdb.exx.

References dbg_NORM, errorDesc(), log_DBG_m, log_FUNC_A_m, majColId, NAME, RMDB_COL_ID_HI, RMDB_COL_ID_LO, and SQL_CHECK_M.

Referenced by rm_Operator::RemoveMajorCol().

                                            {
    log_FUNC_A_m(Remove, "MajorCollocation");

    log_DBG_m(dbg_NORM, "MajColId accept: " << a_majColId);
    Int32_t majColIdHi = RMDB_COL_ID_HI(a_majColId);
    Int32_t majColIdLo = RMDB_COL_ID_LO(a_majColId);

    EXEC SQL
        SET TRANSACTION NAME readWriteTrans;

    EXEC SQL
        DELETE TRANSACTION readWriteTrans
        FROM MAJORCOL WHERE majColIdHi = :majColIdHi AND majColIdLo = :majColIdLo;

    log_DBG_m(dbg_NORM, "MajColId removed!:  " << majColId);
    string sqlErrDesc = errorDesc(SQLCODE,"Remove major colocation record", a_majColId);
    SQL_CHECK_M( sqlErrDesc );
    log_DBG_m(dbg_NORM, "MajColId removed!:  " << majColId);

} // rm_MajorCol::Remove

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_MajorCol::Select ( UInt64_t  a_majColId  )  [private]

Definition at line 5784 of file librmdb.exx.

References dbg_DETAIL, dbg_NORM, errorDesc(), flags, ivd_UUID_STR_SIZE_d, log_DBG_m, log_FUNC_A_m, majColId, majColSize, NAME, partUUID, RMDB_COL_ID, RMDB_COL_ID_HI, RMDB_COL_ID_LO, and SQL_CHECKREAD_M.

Referenced by rm_Operator::AllocateMigCollocation(), rm_MajorCol(), rm_Operator::SelectMajorCol(), and rm_Operator::Update().

                                            {
    log_FUNC_A_m(Select, "MajorCollocation");

    Int32_t majColIdHi = RMDB_COL_ID_HI(a_majColId);
    Int32_t majColIdLo = RMDB_COL_ID_LO(a_majColId);
    char partUUIDStringVal[ivd_UUID_STR_SIZE_d + 1];

    log_DBG_m(dbg_NORM, "MajColId:  " << a_majColId);

    EXEC SQL
        SET TRANSACTION NAME readTrans
            READ ONLY
            ISOLATION LEVEL READ COMMITTED;

    EXEC SQL
        SELECT TRANSACTION readTrans
        * INTO
                :majColIdHi,
                :majColIdLo,
                :majColSize,
                :partUUIDStringVal,
                :flags
        FROM MAJORCOL WHERE majColIdHi = :majColIdHi AND majColIdLo = :majColIdLo;

    majColId = RMDB_COL_ID(majColIdHi, majColIdLo);

    log_DBG_m(dbg_DETAIL, "Selected: "
                            << majColIdHi << ", "
                            << majColIdLo << ", "
                            << majColSize << ", "
                            << partUUIDStringVal << ", "
                            << flags);

    string sqlErrDesc = errorDesc(SQLCODE,"Select record from MajorCol", majColId);
    SQL_CHECKREAD_M( sqlErrDesc );
    partUUID = partUUIDStringVal;

}// rm_MajorCol::Select

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_MajorCol::StartSelectAll (  )  [private]

Definition at line 5824 of file librmdb.exx.

References errorDesc(), cmn_Mutex::Lock(), log_ERR_m, log_FUNC_A_m, NAME, SQL_NOERROR, and cmn_Mutex::Unlock().

Referenced by rm_Operator::SelectAllMajorCol().

                                 {
    log_FUNC_A_m(StartSelectAll, "MajorCollocation");

    g_majorColCursor_x.Lock();

    EXEC SQL
        SET TRANSACTION NAME readTrans
            READ ONLY
            ISOLATION LEVEL READ COMMITTED;

    EXEC SQL
        OPEN TRANSACTION readTrans SELECT_ALL_MAJORCOL;

    if ( SQLCODE != SQL_NOERROR ) {
        string sqlErrDesc = errorDesc(SQLCODE, "Opening SELECT_ALL_MAJORCOL Cursor failed");
        log_ERR_m(sqlErrDesc);
        g_majorColCursor_x.Unlock();
        throw ivd_DBException( SQLCODE ,sqlErrDesc, true);
    }
}// rm_majorCol::StartSelectAll()

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_MajorCol::Update (  )  [private]

Definition at line 5757 of file librmdb.exx.

References dbg_DETAIL, errorDesc(), flags, log_DBG_m, log_FUNC_A_m, majColId, majColSize, NAME, RMDB_COL_ID_HI, RMDB_COL_ID_LO, and SQL_CHECK_M.

Referenced by rm_Operator::Update().

                         {
    log_FUNC_A_m(Update, "MajorCollocation");

    Int32_t majColIdHi = RMDB_COL_ID_HI(majColId);
    Int32_t majColIdLo = RMDB_COL_ID_LO(majColId);

    EXEC SQL
        SET TRANSACTION NAME readWriteTrans;

    log_DBG_m(dbg_DETAIL,"UPDATE TRANSACTION readWriteTrans MAJORCOL SET "
                                      << majColSize << ", "
                                      << flags << "WHERE majColIdHi = " << majColIdHi
                                      << "AND majColIdLo = " << majColIdLo << ");");
    EXEC SQL
        UPDATE TRANSACTION readWriteTrans
        MAJORCOL SET
                        majColSize = :majColSize,
                        flags =      :flags
        WHERE majColIdHi = :majColIdHi AND majColIdLo = :majColIdLo;

    string sqlErrDesc = errorDesc(SQLCODE,"Update MajorCol record", majColId);
    SQL_CHECK_M( sqlErrDesc );

}// rm_MajorCOl::Update()

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class rm_Operator [friend]

Definition at line 889 of file rmdb.h.


Member Data Documentation

Definition at line 890 of file rmdb.h.


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