Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
undo formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmwnshn committed Jun 26, 2018
1 parent 9b29a4c commit 2a965b2
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 53 deletions.
26 changes: 13 additions & 13 deletions src/concurrency/timestamp_ordering_transaction_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ void TimestampOrderingTransactionManager::YieldOwnership(
tile_group_header->SetTransactionId(tuple_id, INITIAL_TXN_ID);
}

bool TimestampOrderingTransactionManager::PerformRead(
TransactionContext *const current_txn, const ItemPointer &read_location,
storage::TileGroupHeader *tile_group_header, bool acquire_ownership) {
bool TimestampOrderingTransactionManager::PerformRead(TransactionContext *const current_txn,
const ItemPointer &read_location,
storage::TileGroupHeader *tile_group_header,
bool acquire_ownership) {
ItemPointer location = read_location;

//////////////////////////////////////////////////////////
Expand Down Expand Up @@ -346,8 +347,7 @@ void TimestampOrderingTransactionManager::PerformInsert(
oid_t tuple_id = location.offset;

auto storage_manager = storage::StorageManager::GetInstance();
auto tile_group_header =
storage_manager->GetTileGroup(tile_group_id)->GetHeader();
auto tile_group_header = storage_manager->GetTileGroup(tile_group_id)->GetHeader();
auto transaction_id = current_txn->GetTransactionId();

// check MVCC info
Expand Down Expand Up @@ -391,8 +391,9 @@ void TimestampOrderingTransactionManager::PerformUpdate(
// version.
PELOTON_ASSERT(tile_group_header->GetTransactionId(old_location.offset) ==
transaction_id);
PELOTON_ASSERT(tile_group_header->GetPrevItemPointer(old_location.offset)
.IsNull() == true);
PELOTON_ASSERT(
tile_group_header->GetPrevItemPointer(old_location.offset).IsNull() ==
true);

// check whether the new version is empty.
PELOTON_ASSERT(new_tile_group_header->GetTransactionId(new_location.offset) ==
Expand Down Expand Up @@ -496,8 +497,9 @@ void TimestampOrderingTransactionManager::PerformDelete(
PELOTON_ASSERT(tile_group_header->GetTransactionId(old_location.offset) ==
transaction_id);
// we must be deleting the latest version.
PELOTON_ASSERT(tile_group_header->GetPrevItemPointer(old_location.offset)
.IsNull() == true);
PELOTON_ASSERT(
tile_group_header->GetPrevItemPointer(old_location.offset).IsNull() ==
true);

// check whether the new version is empty.
PELOTON_ASSERT(new_tile_group_header->GetTransactionId(new_location.offset) ==
Expand Down Expand Up @@ -552,8 +554,7 @@ void TimestampOrderingTransactionManager::PerformDelete(
oid_t tuple_id = location.offset;

auto storage_manager = storage::StorageManager::GetInstance();
auto tile_group_header =
storage_manager->GetTileGroup(tile_group_id)->GetHeader();
auto tile_group_header = storage_manager->GetTileGroup(tile_group_id)->GetHeader();

PELOTON_ASSERT(tile_group_header->GetTransactionId(tuple_id) ==
current_txn->GetTransactionId());
Expand Down Expand Up @@ -595,8 +596,6 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
return ResultType::SUCCESS;
}

auto &rw_set = current_txn->GetReadWriteSet();

auto storage_manager = storage::StorageManager::GetInstance();
auto &log_manager = logging::LogManager::GetInstance();

Expand All @@ -605,6 +604,7 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
// generate transaction id.
cid_t end_commit_id = current_txn->GetCommitId();

auto &rw_set = current_txn->GetReadWriteSet();
auto &rw_object_set = current_txn->GetCreateDropSet();

auto gc_set = current_txn->GetGCSetPtr();
Expand Down
5 changes: 2 additions & 3 deletions src/concurrency/transaction_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ bool TransactionManager::IsOccupied(TransactionContext *const current_txn,
const void *position_ptr) {
ItemPointer &position = *((ItemPointer *)position_ptr);

auto tile_group_header = storage::StorageManager::GetInstance()
->GetTileGroup(position.block)
->GetHeader();
auto tile_group_header =
storage::StorageManager::GetInstance()->GetTileGroup(position.block)->GetHeader();
auto tuple_id = position.offset;

txn_id_t tuple_txn_id = tile_group_header->GetTransactionId(tuple_id);
Expand Down
Loading

0 comments on commit 2a965b2

Please sign in to comment.