rm_Partition Class Reference
[Resource Manager Database Library]

#include <rmdb.h>

Collaboration diagram for rm_Partition:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 669 of file rmdb.h.


Public Member Functions

 rm_Partition ()
 rm_Partition (const rm_Partition &a_part)
rm_Partitionoperator= (const rm_Partition &a_part)
bool operator== (const rm_Partition &part) const

Public Attributes

rm_String partitionUUIDString
rm_String partitionName
Int32_t options
rm_String fsHost
rm_String fsMountpoint
Int32_t migIdTime
Int32_t migIdCount
Int32_t status
rm_String fsID
cmn_UUID_t partUUID
rm_MigIdGen m_migIdGen
 log_CLASSID_m

Private Member Functions

void Insert ()
void Update ()
void Remove (const rm_String &a_partName)
void Select (const rm_String &a_partUUID)
void SelectByName (const rm_String &a_partName)
void SelectByUuid (const rm_String &a_partUuid)
void StartSelectAll ()
void EndSelectAll ()
rm_PartitionNext ()
void Init (const string &a_partName)

Friends

class rm_Operator
class rm_MigIdGen
class dbo_InitPartition
class dbo_InsertPartition
class dbo_RemovePartition
class dbo_SelectPartition
class rm_Medium

Constructor & Destructor Documentation

rm_Partition::rm_Partition (  ) 

Definition at line 3934 of file librmdb.exx.

References rm_MigIdGen::Init(), log_FUNC_m, and m_migIdGen.

Here is the call graph for this function:

rm_Partition::rm_Partition ( const rm_Partition a_part  ) 

Definition at line 3959 of file librmdb.exx.

References fsHost, fsID, fsMountpoint, rm_MigIdGen::Init(), log_FUNC_m, m_migIdGen, migIdCount, migIdTime, options, partitionName, partitionUUIDString, partUUID, and status.

03960     :   partitionUUIDString(ivd_UUID_STR_SIZE_d + 1),
03961         partitionName(rmdb_MAX_PARTITIONNAME),
03962         fsHost(rmdb_MAX_HOSTNAME),
03963         fsMountpoint(rmdb_MAX_HOSTNAME),
03964         fsID(rmdb_MAX_FSID)
03965 {
03966     log_FUNC_m(rm_Partition);
03967 
03968     partitionUUIDString = a_part.partitionUUIDString;
03969     partitionName       = a_part.partitionName;
03970     options             = a_part.options;
03971     fsHost              = a_part.fsHost;
03972     fsMountpoint        = a_part.fsMountpoint;
03973     migIdTime           = a_part.migIdTime;
03974     migIdCount          = a_part.migIdCount;
03975     status              = a_part.status;
03976     partUUID            = a_part.partUUID;
03977     fsID                = a_part.fsID;
03978 
03979     m_migIdGen.Init(this);
03980 }

Here is the call graph for this function:


Member Function Documentation

void rm_Partition::Insert (  )  [private]

Definition at line 3985 of file librmdb.exx.

References rm_String::cvalue_p, errorDesc(), fsHost, fsID, fsMountpoint, log_FUNC_m, migIdCount, migIdTime, NAME, options, partitionName, partitionUUIDString, SQL_CHECK_M, and status.

Referenced by rm_Operator::InsertPartition().

03985                           {
03986     log_FUNC_m(Insert);
03987     EXEC SQL
03988         SET TRANSACTION NAME readWriteTrans;
03989     EXEC SQL
03990         INSERT TRANSACTION readWriteTrans
03991         INTO Partition VALUES(
03992                               :partitionUUIDString.cvalue_p,
03993                               :partitionName.cvalue_p,
03994                               :migIdTime,
03995                               :migIdCount,
03996                               :status,
03997                               :options,
03998                               :fsHost.cvalue_p,
03999                               :fsMountpoint.cvalue_p,
04000                               :fsID.cvalue_p
04001                              );
04002 
04003     string sqlErrDesc = errorDesc(SQLCODE,"Insert record into Partition with uuid " + partitionUUIDString );
04004     SQL_CHECK_M( sqlErrDesc );
04005 
04006 } // rm_Partition::Insert()

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_Partition::Update (  )  [private]

Definition at line 4029 of file librmdb.exx.

References rm_String::cvalue_p, errorDesc(), fsHost, fsID, fsMountpoint, log_FUNC_m, migIdCount, migIdTime, NAME, options, partitionName, partitionUUIDString, SQL_CHECK_M, and status.

Referenced by rm_MigIdGen::UpdateInDB(), and rm_Operator::UpdatePartition().

04029                           {
04030     log_FUNC_m(Update);
04031 
04032     EXEC SQL
04033         SET TRANSACTION NAME readWriteTrans;
04034     EXEC SQL
04035         UPDATE TRANSACTION readWriteTrans
04036         PARTITION SET
04037             PARTUUID    = :partitionUUIDString.cvalue_p,
04038             PARTNAME    = :partitionName.cvalue_p,
04039             OPTIONS     = :options,
04040             FSHOST      = :fsHost.cvalue_p,
04041             FSMOUNTPOINT = :fsMountpoint.cvalue_p,
04042             MIGIDTIME   = :migIdTime,
04043             MIGIDCOUNT  = :migIdCount,
04044             STATUS      = :status,
04045             FSID        = :fsID.cvalue_p
04046         WHERE
04047             PARTNAME = :partitionName.cvalue_p;
04048 
04049     string sqlErrDesc = errorDesc(SQLCODE,"Update record in Partition: " + partitionName);
04050     SQL_CHECK_M( sqlErrDesc );
04051 
04052 } // rm_update_Drivehost

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_Partition::Remove ( const rm_String a_partName  )  [private]

Definition at line 4011 of file librmdb.exx.

References rm_String::cvalue_p, errorDesc(), log_FUNC_m, NAME, and SQL_CHECK_M.

Referenced by rm_Operator::RemovePartition().

04011                                                     {
04012     log_FUNC_m(Remove);
04013 
04014     EXEC SQL
04015         SET TRANSACTION NAME readWriteTrans;
04016     EXEC SQL
04017         DELETE TRANSACTION readWriteTrans
04018         FROM Partition
04019             WHERE
04020                 partName = :a_partName.cvalue_p;
04021 
04022     string sqlErrDesc = errorDesc(SQLCODE,"Remove record from Partition with Name " + a_partName);
04023     SQL_CHECK_M( sqlErrDesc );
04024 } // rm_Partition::Remove()

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_Partition::Select ( const rm_String a_partUUID  )  [private]

Definition at line 4057 of file librmdb.exx.

References rm_String::cvalue_p, dbg_DETAIL, errorDesc(), fsHost, fsID, fsMountpoint, ivd_UUID_STR_SIZE_d, log_DBG_m, log_FUNC_m, migIdCount, migIdTime, NAME, options, partitionName, partitionUUIDString, partUUID, rmdb_MAX_FSID, rmdb_MAX_HOSTNAME, rmdb_MAX_MOUNTPOINT, rmdb_MAX_PARTITIONNAME, SQL_CHECKREAD_M, SQL_NOERROR, and status.

Referenced by rm_MigIdGen::CheckInDB().

04057                                                      {
04058     log_FUNC_m(Select);
04059 
04060     char uuidVal[ivd_UUID_STR_SIZE_d + 1 ];
04061     char partitionNameVal[rmdb_MAX_PARTITIONNAME];
04062     char fsHostVal[rmdb_MAX_HOSTNAME];
04063     char fsMountpointVal[rmdb_MAX_MOUNTPOINT];
04064     char fsIDVal[rmdb_MAX_FSID];
04065 
04066     EXEC SQL
04067         SET TRANSACTION NAME readTrans
04068             READ ONLY
04069             ISOLATION LEVEL READ COMMITTED;
04070 
04071     EXEC SQL
04072         SELECT TRANSACTION readTrans
04073         * INTO
04074             :uuidVal,
04075             :partitionNameVal,
04076             :migIdTime,
04077             :migIdCount,
04078             :status,
04079             :options,
04080             :fsHostVal,
04081             :fsMountpointVal,
04082             :fsIDVal
04083         FROM PARTITION WHERE (partUUID = :a_partUUID.cvalue_p);
04084 
04085     log_DBG_m(dbg_DETAIL, "selected Partition record " << SQLCODE);
04086 
04087 
04088     if (SQLCODE == SQL_NOERROR){
04089         partitionUUIDString = uuidVal;
04090         partitionName = partitionNameVal;
04091         fsHost = fsHostVal;
04092         fsMountpoint = fsMountpointVal;
04093         fsID = fsIDVal;
04094     }
04095     string sqlErrDesc = errorDesc(SQLCODE," Select Partition ", a_partUUID);
04096     SQL_CHECKREAD_M( sqlErrDesc );
04097 
04098 } // rm_Partition::Select

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_Partition::SelectByName ( const rm_String a_partName  )  [private]

Definition at line 4101 of file librmdb.exx.

References rm_String::cvalue_p, dbg_DETAIL, errorDesc(), fsHost, fsID, fsMountpoint, ivd_UUID_STR_SIZE_d, log_DBG_m, log_FUNC_m, migIdCount, migIdTime, NAME, options, partitionName, partitionUUIDString, rmdb_MAX_FSID, rmdb_MAX_HOSTNAME, rmdb_MAX_MOUNTPOINT, rmdb_MAX_PARTITIONNAME, SQL_CHECKREAD_M, SQL_NOERROR, and status.

Referenced by Init(), and rm_Operator::SelectPartition().

04101                                                            {
04102     log_FUNC_m(SelectByName);
04103 
04104     char uuidVal[ivd_UUID_STR_SIZE_d + 1];
04105     char partitionNameVal[rmdb_MAX_PARTITIONNAME];
04106     char fsHostVal[rmdb_MAX_HOSTNAME];
04107     char fsMountpointVal[rmdb_MAX_MOUNTPOINT];
04108     char fsIDVal[rmdb_MAX_FSID];
04109 
04110     EXEC SQL
04111         SET TRANSACTION NAME readTrans
04112             READ ONLY
04113             ISOLATION LEVEL READ COMMITTED;
04114 
04115     EXEC SQL
04116         SELECT TRANSACTION readTrans
04117         * INTO
04118             :uuidVal,
04119             :partitionNameVal,
04120             :migIdTime,
04121             :migIdCount,
04122             :status,
04123             :options,
04124             :fsHostVal,
04125             :fsMountpointVal,
04126             :fsIDVal
04127         FROM PARTITION WHERE (partName = :a_partName.cvalue_p);
04128 
04129     log_DBG_m(dbg_DETAIL, "selected Partition record. SQLCODE: " << SQLCODE);
04130 
04131     if (SQLCODE == SQL_NOERROR){
04132         partitionUUIDString = uuidVal;
04133         partitionName = partitionNameVal;
04134         fsHost = fsHostVal;
04135         fsMountpoint = fsMountpointVal;
04136         fsID = fsIDVal;
04137     }
04138 
04139     string sqlErrDesc = errorDesc(SQLCODE," Select Partition " , a_partName);
04140     SQL_CHECKREAD_M( sqlErrDesc );
04141 
04142 } // rm_Partition::Select

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_Partition::SelectByUuid ( const rm_String a_partUuid  )  [private]

Definition at line 4145 of file librmdb.exx.

References rm_String::cvalue_p, dbg_DETAIL, errorDesc(), fsHost, fsID, fsMountpoint, ivd_UUID_STR_SIZE_d, log_DBG_m, log_FUNC_m, migIdCount, migIdTime, NAME, options, partitionName, partitionUUIDString, partUUID, rmdb_MAX_FSID, rmdb_MAX_HOSTNAME, rmdb_MAX_MOUNTPOINT, rmdb_MAX_PARTITIONNAME, SQL_CHECKREAD_M, SQL_NOERROR, and status.

Referenced by rm_Medium::Convert2Corba(), rm_Operator::SelectMedium(), and rm_Operator::SelectPartitionByUuid().

04145                                                            {
04146     log_FUNC_m(SelectByNameByUuid);
04147 
04148     char uuidVal[ivd_UUID_STR_SIZE_d + 1];
04149     char partitionNameVal[rmdb_MAX_PARTITIONNAME];
04150     char fsHostVal[rmdb_MAX_HOSTNAME];
04151     char fsMountpointVal[rmdb_MAX_MOUNTPOINT];
04152     char fsIDVal[rmdb_MAX_FSID];
04153 
04154     EXEC SQL
04155         SET TRANSACTION NAME readTrans
04156         READ ONLY
04157         ISOLATION LEVEL READ COMMITTED;
04158 
04159     EXEC SQL
04160         SELECT TRANSACTION readTrans
04161         * INTO
04162         :uuidVal,
04163         :partitionNameVal,
04164         :migIdTime,
04165         :migIdCount,
04166         :status,
04167         :options,
04168         :fsHostVal,
04169         :fsMountpointVal,
04170         :fsIDVal
04171         FROM PARTITION WHERE (partUUID = :a_partUuid.cvalue_p);
04172 
04173     log_DBG_m(dbg_DETAIL, "selected Partition record " << SQLCODE);
04174 
04175     if (SQLCODE == SQL_NOERROR){
04176         partitionUUIDString = uuidVal;
04177         partitionName = partitionNameVal;
04178         fsHost = fsHostVal;
04179         fsMountpoint = fsMountpointVal;
04180         fsID = fsIDVal;
04181     }
04182 
04183     string sqlErrDesc = errorDesc(SQLCODE," Select Partition By UUID " , a_partUuid);
04184     SQL_CHECKREAD_M( sqlErrDesc );
04185 
04186 } // rm_Partition::SelectByNameByUuid

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_Partition::StartSelectAll (  )  [private]

Definition at line 4188 of file librmdb.exx.

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

Referenced by rm_Operator::SelectAllPart().

04188                                  {
04189     log_FUNC_m(StartSelectAll);
04190 
04191     g_partitionCursor_x.Lock();
04192 
04193     EXEC SQL
04194         SET TRANSACTION NAME readTrans
04195             READ ONLY
04196             ISOLATION LEVEL READ COMMITTED;
04197 
04198     EXEC SQL
04199         OPEN TRANSACTION readTrans
04200         SELECT_ALL_PARTITION;
04201 
04202     if ( SQLCODE != SQL_NOERROR ) {
04203         string sqlErrDesc = errorDesc(SQLCODE, "Opening SELECT_ALL_PARTITION Cursor failed");
04204         log_ERR_m(sqlErrDesc);
04205         g_partitionCursor_x.Unlock();
04206         throw ivd_DBException( SQLCODE ,sqlErrDesc, true);
04207     }
04208 
04209 }

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_Partition::EndSelectAll (  )  [private]

Definition at line 4211 of file librmdb.exx.

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

04211                                {
04212     log_FUNC_m(EndSelectAll);
04213 
04214     EXEC SQL
04215         CLOSE SELECT_ALL_PARTITION;
04216 
04217     g_partitionCursor_x.Unlock();
04218 
04219     string sqlErrDesc = errorDesc(SQLCODE, "Closing SELECT_ALL_PARTITION Cursor failed");
04220     SQL_CHECKREAD_M(sqlErrDesc);
04221 
04222 }

Here is the call graph for this function:

rm_Partition & rm_Partition::Next (  )  [private]

Definition at line 4224 of file librmdb.exx.

References errorDesc(), fsHost, fsID, fsMountpoint, ivd_UUID_STR_SIZE_d, log_FUNC_m, migIdCount, migIdTime, options, partitionName, partitionUUIDString, rmdb_MAX_FSID, rmdb_MAX_HOSTNAME, rmdb_MAX_MOUNTPOINT, rmdb_MAX_PARTITIONNAME, SQL_CHECKREAD_M, SQL_NOERROR, status, and cmn_Mutex::Unlock().

Referenced by rm_Operator::SelectAllPart().

04224                                  {
04225     log_FUNC_m(Next);
04226 
04227     char uuidVal[ivd_UUID_STR_SIZE_d + 1];
04228     char partitionNameVal[rmdb_MAX_PARTITIONNAME];
04229     char fsHostVal[rmdb_MAX_HOSTNAME];
04230     char fsMountpointVal[rmdb_MAX_MOUNTPOINT];
04231     char fsIDVal[rmdb_MAX_FSID];
04232 
04233     EXEC SQL
04234         FETCH SELECT_ALL_PARTITION
04235             INTO
04236                 :uuidVal,
04237                 :partitionNameVal,
04238                 :migIdTime,
04239                 :migIdCount,
04240                 :status,
04241                 :options,
04242                 :fsHostVal,
04243                 :fsMountpointVal,
04244                 :fsIDVal;
04245 
04246     if (SQLCODE == SQL_NOERROR) {
04247         partitionUUIDString = uuidVal;
04248         partitionName = partitionNameVal;
04249         fsHost = fsHostVal;
04250         fsMountpoint = fsMountpointVal;
04251         fsID = fsIDVal;
04252     }
04253     else {
04254         int fetchCode = SQLCODE;
04255         EXEC SQL
04256             CLOSE SELECT_ALL_PARTITION;
04257 
04258         g_partitionCursor_x.Unlock();
04259         SQLCODE = fetchCode;
04260         string sqlErrDesc = errorDesc(fetchCode, "reached end of SELECT_ALL_PARTITION cursor");
04261         SQL_CHECKREAD_M(sqlErrDesc);
04262     };
04263     return *this;
04264 
04265 }

Here is the call graph for this function:

Here is the caller graph for this function:

void rm_Partition::Init ( const string &  a_partName  )  [private]

Definition at line 3947 of file librmdb.exx.

References rm_MigIdGen::Init(), log_FUNC_m, m_migIdGen, partitionName, partitionUUIDString, partUUID, rmdb_MAX_PARTITIONNAME, and SelectByName().

Referenced by dbo_InitPartition::Process().

03947                                                {
03948 
03949     log_FUNC_m(rm_Partition);
03950     //cmn_MutexLock l(g_rmdb_x);
03951 
03952     rm_String partitionName(rmdb_MAX_PARTITIONNAME);
03953     partitionName = a_partName;
03954     SelectByName(partitionName);
03955     partUUID = partitionUUIDString;
03956     m_migIdGen.Init(this);
03957 }

Here is the call graph for this function:

Here is the caller graph for this function:

rm_Partition & rm_Partition::operator= ( const rm_Partition a_part  ) 

Definition at line 4267 of file librmdb.exx.

References fsHost, fsID, fsMountpoint, rm_MigIdGen::Init(), log_FUNC_m, m_migIdGen, migIdCount, migIdTime, options, partitionName, partitionUUIDString, and status.

04267                                                                {
04268     log_FUNC_m(operator=);
04269     partitionUUIDString = a_part.partitionUUIDString;
04270     partitionName = a_part.partitionName;
04271     options = a_part.options;
04272     fsHost = a_part.fsHost;
04273     fsMountpoint = a_part.fsMountpoint;
04274     migIdTime = a_part.migIdTime;
04275     migIdCount = a_part.migIdCount;
04276     status = a_part.status;
04277     fsID= a_part.fsID;
04278     m_migIdGen.Init(this);
04279     return *this;
04280 }

Here is the call graph for this function:

bool rm_Partition::operator== ( const rm_Partition part  )  const [inline]

Definition at line 730 of file rmdb.h.

References partitionUUIDString.

00730                                                     {
00731         return (    ( partitionUUIDString == part.partitionUUIDString ) );
00732     };


Friends And Related Function Documentation

friend class rm_Operator [friend]

Definition at line 671 of file rmdb.h.

friend class rm_MigIdGen [friend]

Definition at line 672 of file rmdb.h.

friend class dbo_InitPartition [friend]

Definition at line 673 of file rmdb.h.

friend class dbo_InsertPartition [friend]

Definition at line 674 of file rmdb.h.

friend class dbo_RemovePartition [friend]

Definition at line 675 of file rmdb.h.

friend class dbo_SelectPartition [friend]

Definition at line 676 of file rmdb.h.

friend class rm_Medium [friend]

Definition at line 677 of file rmdb.h.


Member Data Documentation

Definition at line 732 of file rmdb.h.


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

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