#include <rmdb.h>

Definition at line 531 of file rmdb.h.
| rm_MediumVol::rm_MediumVol | ( | ) |
Definition at line 3295 of file librmdb.exx.
References Select().
03296 : medVolId(ivd_UUID_STR_SIZE_d) { 03297 Select(a_mediumVolKey, a_medVolNr); 03298 }

| void rm_MediumVol::Insert | ( | ) | [private] |
Definition at line 3302 of file librmdb.exx.
References accessNr, accessTime, rm_String::cvalue_p, errorDesc(), initTime, lastVerification, log_FUNC_m, rm_TimeStamp::m_iscTime, mediumKey, medVolId, medVolNr, NAME, owriteNr, owriteTime, SQL_CHECK_M, status, totalData, validData, volSize, volType, volUsed, writeNr, and writeTime.
Referenced by rm_Operator::Add().
03302 { 03303 log_FUNC_m(Insert); 03304 03305 EXEC SQL 03306 SET TRANSACTION NAME readWriteTrans; 03307 03308 EXEC SQL 03309 INSERT TRANSACTION readWriteTrans 03310 INTO MEDIAVOL VALUES( 03311 :mediumKey, 03312 :medVolNr, 03313 :medVolId.cvalue_p, 03314 :status, 03315 :volType, 03316 :volUsed, 03317 :volSize, 03318 :accessNr, 03319 :writeNr, 03320 :owriteNr, 03321 :initTime.m_iscTime, 03322 :accessTime.m_iscTime, 03323 :writeTime.m_iscTime, 03324 :owriteTime.m_iscTime, 03325 :lastVerification.m_iscTime, 03326 :totalData, 03327 :validData 03328 ); 03329 string sqlErrDesc = errorDesc(SQLCODE,"Insert record into MediumVol"); 03330 SQL_CHECK_M( sqlErrDesc ); 03331 03332 }// rm_insert_MediumVol


| void rm_MediumVol::Update | ( | ) | [private] |
Definition at line 3357 of file librmdb.exx.
References accessNr, accessTime, rm_String::cvalue_p, errorDesc(), initTime, lastVerification, log_FUNC_m, rm_TimeStamp::m_iscTime, mediumKey, medVolId, medVolNr, NAME, owriteNr, owriteTime, SQL_CHECK_M, status, totalData, validData, volSize, volType, volUsed, writeNr, and writeTime.
Referenced by rm_Operator::ClearRecoveryFlag(), rm_Operator::ReleaseResources(), rm_Operator::SetRecoveryFlag(), rm_Operator::Update(), rm_Operator::VolumeEmpty(), and rm_Operator::VolumeFull().
03357 { 03358 log_FUNC_m(Update); 03359 03360 EXEC SQL 03361 SET TRANSACTION NAME readWriteTrans; 03362 03363 EXEC SQL 03364 UPDATE TRANSACTION readWriteTrans 03365 MEDIAVOL SET 03366 MEDVOLID = :medVolId.cvalue_p, 03367 STATUS = :status, 03368 VOLTYPE = :volType, 03369 VOLUSED = :volUsed, 03370 VOLSIZE = :volSize, 03371 ACCESSNR = :accessNr, 03372 WRITENR = :writeNr, 03373 OWRITENR = :owriteNr, 03374 INITTIME = :initTime.m_iscTime, 03375 ACCESSTIME = :accessTime.m_iscTime, 03376 WRITETIME = :writeTime.m_iscTime, 03377 OWRITETIME = :owriteTime.m_iscTime, 03378 LASTVERIFICATION = :lastVerification.m_iscTime, 03379 TOTALDATA = :totalData, 03380 VALIDDATA = :validData 03381 WHERE MEDIAKEY = :mediumKey AND MEDVOLNR = :medVolNr; 03382 03383 string sqlErrDesc = errorDesc(SQLCODE,"Update MediumVol record"); 03384 SQL_CHECK_M( sqlErrDesc ); 03385 }// rm_insert_MediumVol


Definition at line 3337 of file librmdb.exx.
References errorDesc(), log_FUNC_m, NAME, and SQL_CHECK_M.
Referenced by rm_Operator::RemoveMediumVol().
03337 { 03338 log_FUNC_m(Remove); 03339 03340 EXEC SQL 03341 SET TRANSACTION NAME readWriteTrans; 03342 03343 EXEC SQL 03344 DELETE TRANSACTION readWriteTrans 03345 FROM MEDIAVOL 03346 WHERE 03347 MEDIAKEY = :a_mediumKey AND 03348 MEDVOLNR = :a_medVolNr; 03349 03350 string sqlErrDesc = errorDesc(SQLCODE,"Remove MediumVol record"); 03351 SQL_CHECK_M( sqlErrDesc ); 03352 }// rm_insert_MediumVol


Definition at line 3390 of file librmdb.exx.
References accessNr, accessTime, cmn_Num2Str(), errorDesc(), initTime, ivd_UUID_STR_SIZE_d, lastVerification, log_FUNC_m, rm_TimeStamp::m_iscTime, mediumKey, medVolId, medVolNr, NAME, owriteNr, owriteTime, SQL_CHECKREAD_M, SQL_NOERROR, status, totalData, validData, volSize, volType, volUsed, writeNr, and writeTime.
Referenced by rm_Operator::AllocateMigCollocation(), rm_Operator::RemoveMediumVol(), rm_MediumVol(), rm_Operator::SelectMediumForMig(), rm_Operator::SelectMediumVol(), rm_Operator::SelectMediumVolumeCol(), rm_Operator::SelectMediumVolumeMig(), and rm_Operator::Update().
03390 { 03391 log_FUNC_m(Select); 03392 03393 EXEC SQL 03394 SET TRANSACTION NAME readTrans 03395 READ ONLY 03396 ISOLATION LEVEL READ COMMITTED; 03397 03398 03399 char medVolIdVal[ivd_UUID_STR_SIZE_d + 1]; 03400 EXEC SQL 03401 SELECT TRANSACTION readTrans 03402 * INTO 03403 :mediumKey, 03404 :medVolNr, 03405 :medVolIdVal, 03406 :status, 03407 :volType, 03408 :volUsed, 03409 :volSize, 03410 :accessNr, 03411 :writeNr, 03412 :owriteNr, 03413 :initTime.m_iscTime, 03414 :accessTime.m_iscTime, 03415 :writeTime.m_iscTime, 03416 :owriteTime.m_iscTime, 03417 :lastVerification.m_iscTime, 03418 :totalData, 03419 :validData 03420 FROM MEDIAVOL WHERE 03421 MEDIAKEY = :a_mediumKey AND 03422 MEDVOLNR = :a_medVolNr; 03423 if (SQLCODE == SQL_NOERROR) { 03424 medVolId = medVolIdVal; 03425 initTime = initTime.m_iscTime; 03426 accessTime = accessTime.m_iscTime; 03427 writeTime = writeTime.m_iscTime; 03428 owriteTime = owriteTime.m_iscTime; 03429 lastVerification= lastVerification.m_iscTime; 03430 }; 03431 string sqlErrDesc = errorDesc(SQLCODE, 03432 "Select MediumVol record with medVolNum:" 03433 + cmn_Num2Str(a_medVolNr) + 03434 +" mediumKey: " + cmn_Num2Str(a_mediumKey)); 03435 SQL_CHECKREAD_M( sqlErrDesc ); 03436 03437 }// rm_select_MediumVol


| void rm_MediumVol::SelectByMedVolId | ( | rm_String & | a_medVolId | ) |
Definition at line 3441 of file librmdb.exx.
References accessNr, accessTime, rm_String::cvalue_p, errorDesc(), initTime, ivd_UUID_STR_SIZE_d, lastVerification, log_FUNC_m, rm_TimeStamp::m_iscTime, mediumKey, medVolId, medVolNr, NAME, owriteNr, owriteTime, SQL_CHECKREAD_M, SQL_NOERROR, status, totalData, validData, volSize, volType, volUsed, writeNr, and writeTime.
Referenced by rm_Operator::ClearRecoveryFlag(), rm_Operator::SelectMediumVol(), rm_Operator::SetRecoveryFlag(), rm_Operator::VolumeEmpty(), and rm_Operator::VolumeFull().
03441 { 03442 log_FUNC_m(SelectByMedVolId); 03443 EXEC SQL 03444 SET TRANSACTION NAME readTrans 03445 READ ONLY 03446 ISOLATION LEVEL READ COMMITTED; 03447 03448 char medVolIdVal[ivd_UUID_STR_SIZE_d + 1]; 03449 03450 EXEC SQL 03451 SELECT TRANSACTION readTrans 03452 * INTO 03453 :mediumKey, 03454 :medVolNr, 03455 :medVolIdVal, 03456 :status, 03457 :volType, 03458 :volUsed, 03459 :volSize, 03460 :accessNr, 03461 :writeNr, 03462 :owriteNr, 03463 :initTime.m_iscTime, 03464 :accessTime.m_iscTime, 03465 :writeTime.m_iscTime, 03466 :owriteTime.m_iscTime, 03467 :lastVerification.m_iscTime, 03468 :totalData, 03469 :validData 03470 FROM MEDIAVOL WHERE 03471 MEDVOLID = :a_medVolId.cvalue_p; 03472 03473 if (SQLCODE == SQL_NOERROR) { 03474 medVolId = medVolIdVal; 03475 initTime = initTime.m_iscTime; 03476 accessTime = accessTime.m_iscTime; 03477 writeTime = writeTime.m_iscTime; 03478 owriteTime = owriteTime.m_iscTime; 03479 lastVerification = lastVerification.m_iscTime; 03480 }; 03481 string sqlErrDesc = errorDesc(SQLCODE,"Select MediumVol record with medVolId:" , medVolId); 03482 SQL_CHECKREAD_M( sqlErrDesc ); 03483 03484 }


| vector< rm_MediumVol > rm_MediumVol::SelectByPartition | ( | rm_String | a_partName | ) |
Definition at line 3570 of file librmdb.exx.
References accessNr, accessTime, cmn_Num2Str(), rm_String::cvalue_p, dbg_DETAIL, dbg_LOW, dbg_NORM, errorDesc(), ie_RMDB_ERROR, initTime, ivd_Error, ivd_UUID_STR_SIZE_d, lastVerification, log_DBG_m, log_FUNC_m, rm_TimeStamp::m_iscTime, mediumKey, medVolId, medVolNr, NAME, owriteNr, owriteTime, SQL_CHECKREAD_M, SQL_NOERROR, SQL_NOTFOUND, status, totalData, validData, volSize, volType, volUsed, writeNr, and writeTime.
Referenced by rm_Operator::IsSomeVolumeUsed(), and rm_Operator::SelectAllMediumVolByPart().
03570 { 03571 log_FUNC_m(SelectByPartition); 03572 03573 EXEC SQL 03574 SET TRANSACTION NAME readTrans 03575 READ ONLY 03576 ISOLATION LEVEL READ COMMITTED; 03577 03578 EXEC SQL 03579 DECLARE SELECT_MEDIAVOL_BY_PARTITION CURSOR FOR 03580 SELECT MEDIAVOL.* 03581 FROM MEDIAVOL, MEDIA, MEDIAPOOL, PARTITION 03582 WHERE 03583 MEDIAVOL.MEDIAKEY = MEDIA.MEDIAKEY AND 03584 MEDIA.MEDIAPOOLKEY = MEDIAPOOL.MEDIAPOOLKEY AND 03585 MEDIAPOOL.PARTITIONUUID = PARTITION.PARTUUID AND 03586 PARTITION.PARTNAME = :a_partName.cvalue_p 03587 ORDER BY MEDIA.MEDIAKEY, MEDIAVOL.MEDVOLNR; 03588 03589 log_DBG_m(dbg_DETAIL,"will select all volumes for Partition:" << a_partName); 03590 03591 if (SQLCODE != SQL_NOERROR) { 03592 log_DBG_m(dbg_DETAIL,"SQLERROR when declaring Cursor SELECT_MEDIAVOL_BY_PARTITION " << SQLCODE); 03593 throw ivd_Error(ie_RMDB_ERROR, "Declare SELECT_MEDIAVOL_BY_PARTITION Cursor failed"); 03594 } 03595 03596 EXEC SQL 03597 OPEN TRANSACTION readTrans 03598 SELECT_MEDIAVOL_BY_PARTITION; 03599 03600 vector<rm_MediumVol> mvVec; 03601 bool endOfCursor = false; 03602 do { 03603 char medVolIdVal[ivd_UUID_STR_SIZE_d + 1]; 03604 EXEC SQL 03605 FETCH SELECT_MEDIAVOL_BY_PARTITION 03606 INTO 03607 :mediumKey, 03608 :medVolNr, 03609 :medVolIdVal, 03610 :status, 03611 :volType, 03612 :volUsed, 03613 :volSize, 03614 :accessNr, 03615 :writeNr, 03616 :owriteNr, 03617 :initTime.m_iscTime, 03618 :accessTime.m_iscTime, 03619 :writeTime.m_iscTime, 03620 :owriteTime.m_iscTime, 03621 :lastVerification.m_iscTime, 03622 :totalData, 03623 :validData; 03624 03625 03626 03627 if (SQLCODE == SQL_NOERROR) { 03628 medVolId = medVolIdVal; 03629 initTime = initTime.m_iscTime; 03630 accessTime = accessTime.m_iscTime; 03631 writeTime = writeTime.m_iscTime; 03632 owriteTime = owriteTime.m_iscTime; 03633 lastVerification= lastVerification.m_iscTime; 03634 log_DBG_m(dbg_DETAIL,"Selected volume [MedVolNr, MediumKey, PartName]: [" 03635 << medVolNr << "," << mediumKey << "," << a_partName ); 03636 03637 mvVec.push_back(*this); 03638 } 03639 else if (SQLCODE == SQL_NOTFOUND) { 03640 log_DBG_m(dbg_NORM,"reached end of cursor"); 03641 endOfCursor = true; 03642 } 03643 else { 03644 log_DBG_m(dbg_LOW,"Fatal MedVol error sqlcode: " << SQLCODE ); 03645 throw ivd_Error ( 03646 ie_RMDB_ERROR, 03647 "Fatal MediumVol select by Partition error sqlcode:" 03648 + cmn_Num2Str((Int32_t)SQLCODE), 03649 true); 03650 }; 03651 03652 } while (endOfCursor == false); 03653 03654 EXEC SQL 03655 CLOSE SELECT_MEDIAVOL_BY_PARTITION; 03656 string sqlErrDesc = errorDesc(SQLCODE, "CLOSE SELECT_ALL_MEDIAVOL_BY_PARTITION" ); 03657 SQL_CHECKREAD_M( sqlErrDesc ); 03658 return mvVec; 03659 }


| vector< rm_MediumVol > rm_MediumVol::SelectByMedium | ( | Int32_t | a_mediumKey | ) |
Definition at line 3486 of file librmdb.exx.
References accessNr, accessTime, cmn_Num2Str(), dbg_DETAIL, dbg_LOW, dbg_NORM, errorDesc(), ie_RMDB_ERROR, initTime, ivd_Error, ivd_UUID_STR_SIZE_d, lastVerification, log_DBG_m, log_FUNC_m, rm_TimeStamp::m_iscTime, mediumKey, medVolId, medVolNr, NAME, owriteNr, owriteTime, SQL_CHECKREAD_M, SQL_NOERROR, SQL_NOTFOUND, status, totalData, validData, volSize, volType, volUsed, writeNr, and writeTime.
Referenced by rm_Operator::CheckMediumFull(), rm_Operator::GetMediaInfo(), rm_Operator::SelectAllMediumVolByMedium(), rm_Operator::VolumeFull(), and rm_Operator::VolumeListStatusSet().
03486 { 03487 log_FUNC_m(SelectByMedium); 03488 03489 EXEC SQL 03490 SET TRANSACTION NAME readTrans 03491 READ ONLY 03492 ISOLATION LEVEL READ COMMITTED; 03493 03494 EXEC SQL 03495 DECLARE SELECT_MEDIAVOL_BY_MEDIA CURSOR FOR 03496 SELECT * FROM MEDIAVOL 03497 WHERE 03498 MEDIAKEY = :a_mediumKey 03499 ORDER BY MEDVOLNR; 03500 log_DBG_m(dbg_DETAIL,"will select all volumes for medium:" << a_mediumKey); 03501 03502 if (SQLCODE != SQL_NOERROR) { 03503 log_DBG_m(dbg_DETAIL,"SQLERROR when declaring Cursor SELECT_MEDIAVOL_BY_MEDIA " << SQLCODE); 03504 throw ivd_Error(ie_RMDB_ERROR, "Declare SELECT_MEDIAVOL_BY_MEDIA Cursor failed"); 03505 } 03506 03507 EXEC SQL 03508 OPEN TRANSACTION readTrans 03509 SELECT_MEDIAVOL_BY_MEDIA; 03510 03511 vector<rm_MediumVol> mvVec; 03512 bool endOfCursor = false; 03513 do { 03514 char medVolIdVal[ivd_UUID_STR_SIZE_d + 1]; 03515 EXEC SQL 03516 FETCH SELECT_MEDIAVOL_BY_MEDIA 03517 INTO 03518 :mediumKey, 03519 :medVolNr, 03520 :medVolIdVal, 03521 :status, 03522 :volType, 03523 :volUsed, 03524 :volSize, 03525 :accessNr, 03526 :writeNr, 03527 :owriteNr, 03528 :initTime.m_iscTime, 03529 :accessTime.m_iscTime, 03530 :writeTime.m_iscTime, 03531 :owriteTime.m_iscTime, 03532 :lastVerification.m_iscTime, 03533 :totalData, 03534 :validData; 03535 log_DBG_m(dbg_DETAIL,"Selected one volume num:" << medVolNr << " SQLCODE " << SQLCODE); 03536 03537 if (SQLCODE == SQL_NOERROR) { 03538 medVolId = medVolIdVal; 03539 initTime = initTime.m_iscTime; 03540 accessTime = accessTime.m_iscTime; 03541 writeTime = writeTime.m_iscTime; 03542 owriteTime = owriteTime.m_iscTime; 03543 lastVerification= lastVerification.m_iscTime; 03544 log_DBG_m(dbg_DETAIL,"found medvol for medium with key :" << a_mediumKey); 03545 mvVec.push_back(*this); 03546 } 03547 else if (SQLCODE == SQL_NOTFOUND) { 03548 log_DBG_m(dbg_NORM,"reached end of cursor"); 03549 endOfCursor = true; 03550 } 03551 else { 03552 log_DBG_m(dbg_LOW,"Fatal MedVol error sqlcode: " << SQLCODE); 03553 throw ivd_Error ( 03554 ie_RMDB_ERROR, 03555 "Fatal MediumVol select by Medium error sqlcode:" 03556 + cmn_Num2Str((Int32_t)SQLCODE), 03557 true); 03558 }; 03559 03560 } while (endOfCursor == false); 03561 03562 EXEC SQL 03563 CLOSE SELECT_MEDIAVOL_BY_MEDIA; 03564 string sqlErrDesc = errorDesc(SQLCODE, "CLOSE SELECT_ALL_MEDIAVOL" ); 03565 SQL_CHECKREAD_M( sqlErrDesc ); 03566 return mvVec; 03567 }


| vector< rm_MediumVol > rm_MediumVol::SelectEmptyCollocation | ( | UInt32_t | a_poolKey | ) |
Definition at line 3742 of file librmdb.exx.
References accessNr, accessTime, cmn_Num2Str(), dbg_DETAIL, dbg_LOW, dbg_NORM, errorDesc(), ie_RMDB_ERROR, initTime, ivd_Error, ivd_UUID_STR_SIZE_d, lastVerification, log_DBG_m, log_FUNC_m, rm_TimeStamp::m_iscTime, mediumKey, medVolId, medVolNr, NAME, owriteNr, owriteTime, SQL_CHECKREAD_M, SQL_NOERROR, SQL_NOTFOUND, status, totalData, validData, volSize, volType, volUsed, writeNr, and writeTime.
03742 { 03743 log_FUNC_m(SelectEmptyCollocation); 03744 03745 EXEC SQL 03746 SET TRANSACTION NAME readTrans 03747 READ ONLY 03748 ISOLATION LEVEL READ COMMITTED; 03749 03750 EXEC SQL 03751 DECLARE SELECT_MEDIAVOL_COLLOCATION CURSOR FOR 03752 SELECT MEDIAVOL.* 03753 FROM MEDIAVOL, MEDIA, MEDIAPOOL 03754 WHERE 03755 MEDIAVOL.MEDIAKEY = MEDIA.MEDIAKEY AND 03756 MEDIA.MEDIAPOOLKEY = MEDIAPOOL.MEDIAPOOLKEY AND 03757 MEDIAPOOL.MEDIAPOOLKEY = :a_poolKey 03758 ORDER BY MEDIAVOL.VOLSIZE; 03759 03760 log_DBG_m(dbg_DETAIL,"will select all volumes for Ppool:" << a_poolKey); 03761 03762 if (SQLCODE != SQL_NOERROR) { 03763 log_DBG_m(dbg_DETAIL,"SQLERROR when declaring Cursor SELECT_MEDIAVOL_BY_PARTITION " << SQLCODE); 03764 throw ivd_Error(ie_RMDB_ERROR, "Declare SELECT_MEDIAVOL_BY_PARTITION Cursor failed"); 03765 } 03766 03767 EXEC SQL 03768 OPEN TRANSACTION readTrans 03769 SELECT_MEDIAVOL_COLLOCATION; 03770 03771 vector<rm_MediumVol> mvVec; 03772 bool endOfCursor = false; 03773 do { 03774 char medVolIdVal[ivd_UUID_STR_SIZE_d + 1]; 03775 EXEC SQL 03776 FETCH SELECT_MEDIAVOL_COLLOCATION 03777 INTO 03778 :mediumKey, 03779 :medVolNr, 03780 :medVolIdVal, 03781 :status, 03782 :volType, 03783 :volUsed, 03784 :volSize, 03785 :accessNr, 03786 :writeNr, 03787 :owriteNr, 03788 :initTime.m_iscTime, 03789 :accessTime.m_iscTime, 03790 :writeTime.m_iscTime, 03791 :owriteTime.m_iscTime, 03792 :lastVerification.m_iscTime, 03793 :totalData, 03794 :validData; 03795 03796 if (SQLCODE == SQL_NOERROR) { 03797 medVolId = medVolIdVal; 03798 initTime = initTime.m_iscTime; 03799 accessTime = accessTime.m_iscTime; 03800 writeTime = writeTime.m_iscTime; 03801 owriteTime = owriteTime.m_iscTime; 03802 lastVerification= lastVerification.m_iscTime; 03803 log_DBG_m(dbg_DETAIL,"Selected volume [MedVolNr, MediumKey, PoolKey]: [" 03804 << medVolNr << "," << mediumKey << "," << a_poolKey ); 03805 03806 mvVec.push_back(*this); 03807 } 03808 else if (SQLCODE == SQL_NOTFOUND) { 03809 log_DBG_m(dbg_NORM,"reached end of cursor"); 03810 endOfCursor = true; 03811 } 03812 else { 03813 log_DBG_m(dbg_LOW,"Fatal MedVol error sqlcode: " << SQLCODE ); 03814 throw ivd_Error ( 03815 ie_RMDB_ERROR, 03816 "Fatal MediumVol select by Poolkey error sqlcode:" 03817 + cmn_Num2Str((Int32_t)SQLCODE), 03818 true); 03819 }; 03820 03821 } while (endOfCursor == false); 03822 03823 EXEC SQL 03824 CLOSE SELECT_MEDIAVOL_COLLOCATION; 03825 string sqlErrDesc = errorDesc(SQLCODE, "CLOSE SELECT_MEDIAVOL_COLLOCATION" ); 03826 SQL_CHECKREAD_M( sqlErrDesc ); 03827 return mvVec; 03828 }

| vector< rm_MediumVol > rm_MediumVol::SelectByMajColId | ( | UInt64_t | a_majColId | ) |
Definition at line 3831 of file librmdb.exx.
References accessNr, accessTime, cmn_Num2Str(), dbg_DETAIL, dbg_LOW, dbg_NORM, errorDesc(), ie_RMDB_ERROR, initTime, ivd_Error, ivd_UUID_STR_SIZE_d, lastVerification, log_DBG_m, log_FUNC_m, rm_TimeStamp::m_iscTime, mediumKey, medVolId, medVolNr, NAME, owriteNr, owriteTime, RMDB_COL_ID_HI, RMDB_COL_ID_LO, SQL_CHECKREAD_M, SQL_NOERROR, SQL_NOTFOUND, status, totalData, validData, volSize, volType, volUsed, writeNr, and writeTime.
03831 { 03832 log_FUNC_m(SelectByMajColId); 03833 03834 Int32_t majHi = RMDB_COL_ID_HI(a_majColId); 03835 Int32_t majLo = RMDB_COL_ID_LO(a_majColId); 03836 03837 EXEC SQL 03838 SET TRANSACTION NAME readTrans 03839 READ ONLY 03840 ISOLATION LEVEL READ COMMITTED; 03841 03842 EXEC SQL 03843 DECLARE SELECT_MEDIAVOL_MAJCOLID CURSOR FOR 03844 SELECT MEDIAVOL.* 03845 FROM MEDIAVOL, MAJORCOL, MINORCOL, COLMEDIAVOL 03846 WHERE 03847 MAJORCOL.MAJCOLIDHI = :majHi AND 03848 MAJORCOL.MAJCOLIDLO = :majLo AND 03849 MINORCOL.MINCOLIDHI = COLMEDIAVOL.MINCOLIDHI AND 03850 MINORCOL.MINCOLIDLO = COLMEDIAVOL.MINCOLIDLO AND 03851 MEDIAVOL.MEDVOLNR = COLMEDIAVOL.MEDVOLNR AND 03852 MAJORCOL.MAJCOLIDHI = MINORCOL.MAJCOLIDHI AND 03853 MAJORCOL.MAJCOLIDLO = MINORCOL.MAJCOLIDLO 03854 03855 ORDER BY MEDIAVOL.VOLSIZE; 03856 03857 log_DBG_m(dbg_DETAIL,"will select all volumes for majCol:" << a_majColId); 03858 03859 if (SQLCODE != SQL_NOERROR) { 03860 log_DBG_m(dbg_DETAIL,"SQLERROR when declaring Cursor SELECT_MEDIAVOL_MAJCOLID " << SQLCODE); 03861 throw ivd_Error(ie_RMDB_ERROR, "Declare SELECT_MEDIAVOL_MAJCOLID Cursor failed"); 03862 } 03863 03864 EXEC SQL 03865 OPEN TRANSACTION readTrans 03866 SELECT_MEDIAVOL_MAJCOLID; 03867 03868 vector<rm_MediumVol> mvVec; 03869 bool endOfCursor = false; 03870 do { 03871 char medVolIdVal[ivd_UUID_STR_SIZE_d + 1]; 03872 EXEC SQL 03873 FETCH SELECT_MEDIAVOL_MAJCOLID 03874 INTO 03875 :mediumKey, 03876 :medVolNr, 03877 :medVolIdVal, 03878 :status, 03879 :volType, 03880 :volUsed, 03881 :volSize, 03882 :accessNr, 03883 :writeNr, 03884 :owriteNr, 03885 :initTime.m_iscTime, 03886 :accessTime.m_iscTime, 03887 :writeTime.m_iscTime, 03888 :owriteTime.m_iscTime, 03889 :lastVerification.m_iscTime, 03890 :totalData, 03891 :validData; 03892 03893 if (SQLCODE == SQL_NOERROR) { 03894 medVolId = medVolIdVal; 03895 initTime = initTime.m_iscTime; 03896 accessTime = accessTime.m_iscTime; 03897 writeTime = writeTime.m_iscTime; 03898 owriteTime = owriteTime.m_iscTime; 03899 lastVerification= lastVerification.m_iscTime; 03900 03901 mvVec.push_back(*this); 03902 } 03903 else if (SQLCODE == SQL_NOTFOUND) { 03904 log_DBG_m(dbg_NORM,"reached end of cursor"); 03905 endOfCursor = true; 03906 } 03907 else { 03908 log_DBG_m(dbg_LOW,"Fatal MedVol error sqlcode: " << SQLCODE ); 03909 throw ivd_Error ( 03910 ie_RMDB_ERROR, 03911 "Fatal MediumVol select by majColID error sqlcode:" 03912 + cmn_Num2Str((Int32_t)SQLCODE), 03913 true); 03914 }; 03915 03916 } while (endOfCursor == false); 03917 03918 EXEC SQL 03919 CLOSE SELECT_MEDIAVOL_MAJCOLID; 03920 string sqlErrDesc = errorDesc(SQLCODE, "CLOSE SELECT_MEDIAVOL_MAJCOLID" ); 03921 SQL_CHECKREAD_M( sqlErrDesc ); 03922 return mvVec; 03923 }

| void rm_MediumVol::StartSelectAll | ( | ) |
Definition at line 3662 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::SelectAllMediumVol().
03662 { 03663 log_FUNC_m(StartSelectAll); 03664 03665 g_mediumVolCursor_x.Lock(); 03666 EXEC SQL 03667 SET TRANSACTION NAME readTrans 03668 READ ONLY 03669 ISOLATION LEVEL READ COMMITTED; 03670 03671 EXEC SQL 03672 OPEN TRANSACTION readTrans 03673 SELECT_ALL_MEDIAVOL; 03674 03675 if ( SQLCODE != SQL_NOERROR ) { 03676 string sqlErrDesc = errorDesc(SQLCODE, "Opening SELECT_ALL_MEDIAVOL Cursor failed"); 03677 log_ERR_m(sqlErrDesc); 03678 g_mediumVolCursor_x.Unlock(); 03679 throw ivd_DBException( SQLCODE ,sqlErrDesc, true); 03680 } 03681 }


| void rm_MediumVol::EndSelectAll | ( | ) |
Definition at line 3683 of file librmdb.exx.
References errorDesc(), log_FUNC_m, SQL_CHECKREAD_M, and cmn_Mutex::Unlock().
03683 { 03684 log_FUNC_m(EndSelectAll); 03685 03686 EXEC SQL 03687 CLOSE SELECT_ALL_MEDIAVOL; 03688 g_mediumVolCursor_x.Unlock(); 03689 string sqlErrDesc = errorDesc(SQLCODE, "CLOSE SELECT_ALL_MEDIAVOL" ); 03690 SQL_CHECKREAD_M( sqlErrDesc ); 03691 }

| rm_MediumVol & rm_MediumVol::Next | ( | ) |
Definition at line 3693 of file librmdb.exx.
References accessNr, accessTime, errorDesc(), initTime, ivd_UUID_STR_SIZE_d, lastVerification, log_FUNC_m, rm_TimeStamp::m_iscTime, mediumKey, medVolId, medVolNr, owriteNr, owriteTime, SQL_CHECKREAD_M, SQL_NOERROR, status, totalData, cmn_Mutex::Unlock(), validData, volSize, volType, volUsed, writeNr, and writeTime.
Referenced by rm_Operator::SelectAllMediumVol().
03693 { 03694 log_FUNC_m(Next); 03695 char medVolIdVal[ivd_UUID_STR_SIZE_d + 1]; 03696 03697 EXEC SQL 03698 FETCH SELECT_ALL_MEDIAVOL 03699 INTO 03700 :mediumKey, 03701 :medVolNr, 03702 :medVolIdVal, 03703 :status, 03704 :volType, 03705 :volUsed, 03706 :volSize, 03707 :accessNr, 03708 :writeNr, 03709 :owriteNr, 03710 :initTime.m_iscTime, 03711 :accessTime.m_iscTime, 03712 :writeTime.m_iscTime, 03713 :owriteTime.m_iscTime, 03714 :lastVerification.m_iscTime, 03715 :totalData, 03716 :validData; 03717 03718 if (SQLCODE == SQL_NOERROR) { 03719 medVolId = medVolIdVal; 03720 initTime = initTime.m_iscTime; 03721 accessTime = accessTime.m_iscTime; 03722 writeTime = writeTime.m_iscTime; 03723 owriteTime = owriteTime.m_iscTime; 03724 lastVerification = lastVerification.m_iscTime; 03725 03726 } 03727 else { 03728 int fetchCode = SQLCODE; 03729 EXEC SQL 03730 CLOSE SELECT_ALL_MEDIAVOL; 03731 03732 g_mediumVolCursor_x.Unlock(); 03733 SQLCODE = fetchCode; 03734 string sqlErrDesc = errorDesc(fetchCode, "reached end of SELECT_ALL_MEDIAVOL cursor"); 03735 SQL_CHECKREAD_M( sqlErrDesc ); 03736 }; 03737 03738 return *this; 03739 03740 }


| bool rm_MediumVol::operator== | ( | const rm_MediumVol & | mv2 | ) | const [inline] |
friend class rm_Operator [friend] |
Definition at line 539 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), operator==(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::SelectMediumVolumeMig(), Update(), and rm_Operator::VolumeFull().
Definition at line 540 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateMigCollocation(), Insert(), Next(), operator==(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumForMig(), rm_Operator::SelectMediumVol(), rm_Operator::SelectMediumVolumeMig(), and Update().
Definition at line 541 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateMigCollocation(), Insert(), Next(), operator==(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumForMig(), rm_Operator::SelectMediumVol(), rm_Operator::SelectOpenedVolume(), rm_Operator::Update(), and Update().
Definition at line 542 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateMigCollocation(), rm_Operator::AutoDetect(), rm_Operator::ClearRecoveryFlag(), rm_Operator::GetBestCopy(), Insert(), Next(), rm_Operator::ReleaseResources(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::SelectMediumVolumeCol(), rm_Operator::SelectMediumVolumeMig(), rm_Operator::SetRecoveryFlag(), rm_Operator::Update(), Update(), rm_Operator::VolumeEmpty(), and rm_Operator::VolumeFull().
Definition at line 543 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), operator==(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::SelectMediumVolumeMig(), rm_Operator::Update(), and Update().
Definition at line 544 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
Definition at line 545 of file rmdb.h.
Referenced by rm_Operator::Add(), rm_Operator::AllocateMigCollocation(), Insert(), Next(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
Definition at line 546 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), rm_Operator::ReleaseResources(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
Definition at line 547 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), rm_Operator::ReleaseResources(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
Definition at line 548 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
Definition at line 549 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
Definition at line 550 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), rm_Operator::ReleaseResources(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
Definition at line 551 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), rm_Operator::ReleaseResources(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
Definition at line 552 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
Definition at line 553 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
Definition at line 554 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
Definition at line 555 of file rmdb.h.
Referenced by rm_Operator::Add(), Insert(), Next(), Select(), SelectByMajColId(), SelectByMedium(), SelectByMedVolId(), SelectByPartition(), SelectEmptyCollocation(), rm_Operator::SelectMediumVol(), rm_Operator::Update(), and Update().
1.5.6