Skip to content

Commit 4df76a1

Browse files
committed
nit: copyright and format
1 parent 01a0a99 commit 4df76a1

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

src/execution/execution_common.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// BusTub
4+
//
5+
// execution_common.cpp
6+
//
7+
// Identification: src/execution/execution_common.cpp
8+
//
9+
// Copyright (c) 2024-2024, Carnegie Mellon University Database Group
10+
//
11+
//===----------------------------------------------------------------------===//
12+
113
#include "execution/execution_common.h"
14+
215
#include "catalog/catalog.h"
3-
#include "common/config.h"
416
#include "common/macros.h"
517
#include "concurrency/transaction_manager.h"
618
#include "fmt/core.h"
719
#include "storage/table/table_heap.h"
8-
#include "type/value.h"
9-
#include "type/value_factory.h"
1020

1121
namespace bustub {
1222

@@ -38,6 +48,7 @@ auto ReconstructTuple(const Schema *schema, const Tuple &base_tuple, const Tuple
3848
const std::vector<UndoLog> &undo_logs) -> std::optional<Tuple> {
3949
UNIMPLEMENTED("not implemented");
4050
}
51+
4152
/**
4253
* @brief Collects the undo logs sufficient to reconstruct the tuple w.r.t. the txn.
4354
*
@@ -54,6 +65,7 @@ auto CollectUndoLogs(RID rid, const TupleMeta &base_meta, const Tuple &base_tupl
5465
Transaction *txn, TransactionManager *txn_mgr) -> std::optional<std::vector<UndoLog>> {
5566
UNIMPLEMENTED("not implemented");
5667
}
68+
5769
/**
5870
* @brief Generates a new undo log as the transaction tries to modify this tuple at the first time.
5971
*
@@ -69,6 +81,7 @@ auto GenerateNewUndoLog(const Schema *schema, const Tuple *base_tuple, const Tup
6981
UndoLink prev_version) -> UndoLog {
7082
UNIMPLEMENTED("not implemented");
7183
}
84+
7285
/**
7386
* @brief Generate the updated undo log to replace the old one, whereas the tuple is already modified by this txn once.
7487
*
@@ -83,6 +96,7 @@ auto GenerateUpdatedUndoLog(const Schema *schema, const Tuple *base_tuple, const
8396
const UndoLog &log) -> UndoLog {
8497
UNIMPLEMENTED("not implemented");
8598
}
99+
86100
void TxnMgrDbg(const std::string &info, TransactionManager *txn_mgr, const TableInfo *table_info,
87101
TableHeap *table_heap) {
88102
// always use stderr for printing logs...

src/include/execution/execution_common.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// BusTub
4+
//
5+
// execution_common.h
6+
//
7+
// Identification: src/include/execution/execution_common.h
8+
//
9+
// Copyright (c) 2014-2024, Carnegie Mellon University Database Group
10+
//
11+
//===----------------------------------------------------------------------===//
112
#pragma once
213

314
#include <string>
@@ -43,12 +54,16 @@ auto GenerateSortKey(const Tuple &tuple, const std::vector<OrderBy> &order_bys,
4354

4455
auto ReconstructTuple(const Schema *schema, const Tuple &base_tuple, const TupleMeta &base_meta,
4556
const std::vector<UndoLog> &undo_logs) -> std::optional<Tuple>;
57+
4658
auto CollectUndoLogs(RID rid, const TupleMeta &base_meta, const Tuple &base_tuple, std::optional<UndoLink> undo_link,
4759
Transaction *txn, TransactionManager *txn_mgr) -> std::optional<std::vector<UndoLog>>;
60+
4861
auto GenerateNewUndoLog(const Schema *schema, const Tuple *base_tuple, const Tuple *target_tuple, timestamp_t ts,
4962
UndoLink prev_version) -> UndoLog;
63+
5064
auto GenerateUpdatedUndoLog(const Schema *schema, const Tuple *base_tuple, const Tuple *target_tuple,
5165
const UndoLog &log) -> UndoLog;
66+
5267
void TxnMgrDbg(const std::string &info, TransactionManager *txn_mgr, const TableInfo *table_info,
5368
TableHeap *table_heap);
5469

@@ -57,11 +72,9 @@ void TxnMgrDbg(const std::string &info, TransactionManager *txn_mgr, const Table
5772
// To give you a sense of what can be shared across executors / transaction manager, here are the
5873
// list of helper function names that we defined in the reference solution. You should come up with
5974
// your own when you go through the process.
60-
// * CollectUndoLogs
6175
// * WalkUndoLogs
6276
// * Modify
6377
// * IsWriteWriteConflict
64-
// * GenerateDiffLog
6578
// * GenerateNullTupleForSchema
6679
// * GetUndoLogSchema
6780
//

0 commit comments

Comments
 (0)