@@ -41,7 +41,6 @@ auto UsageMessage() -> std::string {
41
41
using BPT = BPlusTree<GenericKey<8 >, RID, GenericComparator<8 >>;
42
42
BPT *tree = nullptr ;
43
43
BufferPoolManager *bpm = nullptr ;
44
- Transaction *transaction = nullptr ;
45
44
std::unique_ptr<bustub::Schema> key_schema = nullptr ;
46
45
47
46
extern " C" {
@@ -60,11 +59,9 @@ auto BusTubInit(int leaf_max_size, int internal_max_size) -> int {
60
59
auto *disk_manager = new DiskManager (" test.bustub" );
61
60
bpm = new BufferPoolManager (100 , disk_manager);
62
61
// create header_page
63
- page_id_t page_id;
64
- bpm->NewPage (&page_id);
62
+ auto page_id = bpm->NewPage ();
65
63
// create b+ tree
66
64
tree = new BPT (" foo_pk" , page_id, bpm, comparator, leaf_max_size, internal_max_size);
67
- transaction = new Transaction (0 );
68
65
return 0 ;
69
66
}
70
67
@@ -87,7 +84,7 @@ auto BusTubApplyCommand(const char *input, char *output, uint16_t len) -> int {
87
84
return 1 ;
88
85
}
89
86
index_key.SetFromInteger (key);
90
- tree->Remove (index_key, transaction );
87
+ tree->Remove (index_key);
91
88
break ;
92
89
case ' i' :
93
90
ss >> key;
@@ -96,7 +93,7 @@ auto BusTubApplyCommand(const char *input, char *output, uint16_t len) -> int {
96
93
}
97
94
rid.Set (static_cast <int32_t >(key >> 32 ), static_cast <int >(key & 0xFFFFFFFF ));
98
95
index_key.SetFromInteger (key);
99
- tree->Insert (index_key, rid, transaction );
96
+ tree->Insert (index_key, rid);
100
97
break ;
101
98
case ' ?' :
102
99
std::cout << UsageMessage ();
0 commit comments