@@ -775,14 +775,13 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
775
775
gc_object_set->emplace_back (database_oid, table_oid, index_oid);
776
776
}
777
777
778
- // Call the GetIterator() function to explicitly lock the cuckoohash
779
- // and initilaize the iterator
780
- auto rw_set_lt = rw_set.GetConstIterator ();
781
-
782
778
oid_t database_id = 0 ;
783
779
if (static_cast <StatsType>(settings::SettingsManager::GetInt (settings::SettingId::stats_mode)) !=
784
780
StatsType::INVALID) {
785
781
if (!rw_set.IsEmpty ()) {
782
+ // Call the GetIterator() function to explicitly lock the cuckoohash
783
+ // and initilaize the iterator
784
+ auto rw_set_lt = rw_set.GetConstIterator ();
786
785
const auto tile_group_id = rw_set_lt.begin ()->first .block ;
787
786
database_id = manager.GetTileGroup (tile_group_id)->GetDatabaseId ();
788
787
}
@@ -793,9 +792,10 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
793
792
// 2. install an empty version for delete operations;
794
793
// 3. install a new tuple for insert operations.
795
794
// Iterate through each item pointer in the read write set
795
+
796
796
// TODO: This might be inefficient since we will have to get the
797
797
// tile_group_header for each entry. Check if this needs to be consolidated
798
- for (const auto &tuple_entry : rw_set_lt ) {
798
+ for (const auto &tuple_entry : rw_set. GetConstIterator () ) {
799
799
ItemPointer item_ptr = tuple_entry.first ;
800
800
oid_t tile_group_id = item_ptr.block ;
801
801
oid_t tuple_slot = item_ptr.offset ;
@@ -951,15 +951,13 @@ ResultType TimestampOrderingTransactionManager::AbortTransaction(
951
951
gc_object_set->emplace_back (database_oid, table_oid, index_oid);
952
952
}
953
953
954
-
955
- // Call the GetIterator() function to explicitly lock the cuckoohash
956
- // and initilaize the iterator
957
- auto rw_set_lt = rw_set.GetConstIterator ();
958
-
959
954
oid_t database_id = 0 ;
960
955
if (static_cast <StatsType>(settings::SettingsManager::GetInt (settings::SettingId::stats_mode)) !=
961
956
StatsType::INVALID) {
962
957
if (!rw_set.IsEmpty ()) {
958
+ // Call the GetIterator() function to explicitly lock the cuckoohash
959
+ // and initilaize the iterator
960
+ auto rw_set_lt = rw_set.GetConstIterator ();
963
961
const auto tile_group_id = rw_set_lt.begin ()->first .block ;
964
962
database_id = manager.GetTileGroup (tile_group_id)->GetDatabaseId ();
965
963
}
@@ -968,7 +966,7 @@ ResultType TimestampOrderingTransactionManager::AbortTransaction(
968
966
// Iterate through each item pointer in the read write set
969
967
// TODO: This might be inefficient since we will have to get the
970
968
// tile_group_header for each entry. Check if this needs to be consolidated
971
- for (const auto &tuple_entry : rw_set_lt ) {
969
+ for (const auto &tuple_entry : rw_set. GetConstIterator () ) {
972
970
ItemPointer item_ptr = tuple_entry.first ;
973
971
oid_t tile_group_id = item_ptr.block ;
974
972
oid_t tuple_slot = item_ptr.offset ;
0 commit comments