Author: kpvdr
Date: 2009-01-21 11:50:17 -0500 (Wed, 21 Jan 2009)
New Revision: 3063
Modified:
store/trunk/cpp/lib/jrnl/enq_map.cpp
store/trunk/cpp/lib/jrnl/enq_map.hpp
store/trunk/cpp/tests/jrnl/_ut_enq_map.cpp
Log:
Further preparation for auto-expand: Additional changed to class enq_map that were
previously overlooked.
Modified: store/trunk/cpp/lib/jrnl/enq_map.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/enq_map.cpp 2009-01-21 16:19:47 UTC (rev 3062)
+++ store/trunk/cpp/lib/jrnl/enq_map.cpp 2009-01-21 16:50:17 UTC (rev 3063)
@@ -78,7 +78,7 @@
{
std::ostringstream oss;
oss << std::hex << "rid=0x" << rid << "
pfid=0x" << pfid;
- throw jexception(jerrno::JERR_MAP_DUPLICATE, oss.str(), "enq_map",
"insert");
+ throw jexception(jerrno::JERR_MAP_DUPLICATE, oss.str(), "enq_map",
"insert_pfid");
}
_pfid_enq_cnt.incr(pfid);
}
@@ -95,13 +95,13 @@
{
std::ostringstream oss;
oss << std::hex << "rid=0x" << rid;
- throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "enq_map",
"get_fid");
+ throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "enq_map",
"get_pfid");
}
if (itr->second._lock)
{
std::ostringstream oss;
oss << std::hex << "rid=0x" << rid;
- throw jexception(jerrno::JERR_MAP_LOCKED, oss.str(), "enq_map",
"get_fid");
+ throw jexception(jerrno::JERR_MAP_LOCKED, oss.str(), "enq_map",
"get_pfid");
}
return itr->second._pfid;
}
@@ -115,13 +115,13 @@
{
std::ostringstream oss;
oss << std::hex << "rid=0x" << rid;
- throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "enq_map",
"get_remove_fid");
+ throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "enq_map",
"get_remove_pfid");
}
if (itr->second._lock && !txn_flag) // locked, but not a commit/abort
{
std::ostringstream oss;
oss << std::hex << "rid=0x" << rid;
- throw jexception(jerrno::JERR_MAP_LOCKED, oss.str(), "enq_map",
"get_remove_fid");
+ throw jexception(jerrno::JERR_MAP_LOCKED, oss.str(), "enq_map",
"get_remove_pfid");
}
u_int16_t pfid = itr->second._pfid;
_map.erase(itr);
@@ -150,7 +150,7 @@
{
std::ostringstream oss;
oss << std::hex << "rid=0x" << rid;
- throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "enq_map",
"get_remove_fid");
+ throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "enq_map",
"lock");
}
itr->second._lock = true;
}
@@ -164,7 +164,7 @@
{
std::ostringstream oss;
oss << std::hex << "rid=0x" << rid;
- throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "enq_map",
"get_remove_fid");
+ throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "enq_map",
"unlock");
}
itr->second._lock = false;
}
@@ -181,7 +181,7 @@
{
std::ostringstream oss;
oss << std::hex << "rid=0x" << rid;
- throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "enq_map",
"get_fid");
+ throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "enq_map",
"is_locked");
}
return itr->second._lock;
}
@@ -198,7 +198,7 @@
}
void
-enq_map::fid_list(std::vector<u_int16_t>& fv)
+enq_map::pfid_list(std::vector<u_int16_t>& fv)
{
fv.clear();
{
Modified: store/trunk/cpp/lib/jrnl/enq_map.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/enq_map.hpp 2009-01-21 16:19:47 UTC (rev 3062)
+++ store/trunk/cpp/lib/jrnl/enq_map.hpp 2009-01-21 16:50:17 UTC (rev 3063)
@@ -109,7 +109,7 @@
inline bool empty() const { return _map.empty(); }
inline u_int32_t size() const { return u_int32_t(_map.size()); }
void rid_list(std::vector<u_int64_t>& rv);
- void fid_list(std::vector<u_int16_t>& fv);
+ void pfid_list(std::vector<u_int16_t>& fv);
};
} // namespace journal
Modified: store/trunk/cpp/tests/jrnl/_ut_enq_map.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_enq_map.cpp 2009-01-21 16:19:47 UTC (rev 3062)
+++ store/trunk/cpp/tests/jrnl/_ut_enq_map.cpp 2009-01-21 16:50:17 UTC (rev 3063)
@@ -224,17 +224,17 @@
u_int64_t rid_incr_1 = 4ULL;
u_int64_t num_incr_1 = (rid_end - rid_begin)/rid_incr_1;
vector<u_int64_t> rid_list;
- vector<u_int16_t> fid_list;
+ vector<u_int16_t> pfid_list;
enq_map e5;
for (rid = rid_begin, pfid = pfid_start; rid < rid_end; rid += rid_incr_1,
pfid++)
{
e5.insert_pfid(rid, pfid);
rid_list.push_back(rid);
- fid_list.push_back(pfid);
+ pfid_list.push_back(pfid);
}
BOOST_CHECK_EQUAL(e5.size(), num_incr_1);
BOOST_CHECK_EQUAL(rid_list.size(), num_incr_1);
- BOOST_CHECK_EQUAL(fid_list.size(), num_incr_1);
+ BOOST_CHECK_EQUAL(pfid_list.size(), num_incr_1);
vector<u_int64_t> ret_rid_list;
e5.rid_list(ret_rid_list);
@@ -242,11 +242,11 @@
for (unsigned i=0; i<ret_rid_list.size(); i++)
BOOST_CHECK_EQUAL(rid_list[i], ret_rid_list[i]);
- vector<u_int16_t> ret_fid_list;
- e5.fid_list(ret_fid_list);
- BOOST_CHECK_EQUAL(ret_fid_list.size(), num_incr_1);
- for (unsigned i=0; i<ret_fid_list.size(); i++)
- BOOST_CHECK_EQUAL(fid_list[i], ret_fid_list[i]);
+ vector<u_int16_t> ret_pfid_list;
+ e5.pfid_list(ret_pfid_list);
+ BOOST_CHECK_EQUAL(ret_pfid_list.size(), num_incr_1);
+ for (unsigned i=0; i<ret_pfid_list.size(); i++)
+ BOOST_CHECK_EQUAL(pfid_list[i], ret_pfid_list[i]);
cout << "ok" << endl;
}