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

Commit 344c914

Browse files
committed
Formatting.
1 parent 58aa8c0 commit 344c914

File tree

4 files changed

+23
-29
lines changed

4 files changed

+23
-29
lines changed

src/common/container/lock_free_array.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ template <typename ValueType>
3636
LOCK_FREE_ARRAY_TYPE::~LockFreeArray() { lock_free_array.clear(); }
3737

3838
template <typename ValueType>
39-
void LOCK_FREE_ARRAY_TYPE::Update(const std::size_t &offset, const ValueType &value) {
39+
void LOCK_FREE_ARRAY_TYPE::Update(const std::size_t &offset,
40+
const ValueType &value) {
4041
LOG_TRACE("Update at %lu", offset);
4142
PELOTON_ASSERT(lock_free_array.size() > offset);
4243
lock_free_array.at(offset) = value;

src/concurrency/timestamp_ordering_transaction_manager.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,8 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
665665
oid_t tuple_slot = item_ptr.offset;
666666

667667
if (tile_group_id != last_tile_group_id) {
668-
tile_group_header = storage_manager->GetTileGroup(tile_group_id)->GetHeader();
668+
tile_group_header =
669+
storage_manager->GetTileGroup(tile_group_id)->GetHeader();
669670
}
670671

671672
if (tuple_entry.second == RWType::READ_OWN) {
@@ -823,7 +824,8 @@ ResultType TimestampOrderingTransactionManager::AbortTransaction(
823824
oid_t tuple_slot = item_ptr.offset;
824825

825826
if (tile_group_id != last_tile_group_id) {
826-
tile_group_header = storage_manager->GetTileGroup(tile_group_id)->GetHeader();
827+
tile_group_header =
828+
storage_manager->GetTileGroup(tile_group_id)->GetHeader();
827829
}
828830

829831
if (tuple_entry.second == RWType::READ_OWN) {

src/concurrency/transaction_context.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ RWType TransactionContext::GetRWType(const ItemPointer &location) {
9494

9595
void TransactionContext::RecordRead(const ItemPointer &location) {
9696
PELOTON_ASSERT(rw_set_.count(location) == 0 ||
97-
(rw_set_[location] != RWType::DELETE && rw_set_[location] != RWType::INS_DEL));
97+
(rw_set_[location] != RWType::DELETE &&
98+
rw_set_[location] != RWType::INS_DEL));
9899
auto rw_set_it = rw_set_.find(location);
99100
if (rw_set_it != rw_set_.end()) {
100101
return;
@@ -104,13 +105,15 @@ void TransactionContext::RecordRead(const ItemPointer &location) {
104105

105106
void TransactionContext::RecordReadOwn(const ItemPointer &location) {
106107
PELOTON_ASSERT(rw_set_.count(location) == 0 ||
107-
(rw_set_[location] != RWType::DELETE && rw_set_[location] != RWType::INS_DEL));
108+
(rw_set_[location] != RWType::DELETE &&
109+
rw_set_[location] != RWType::INS_DEL));
108110
rw_set_[location] = RWType::READ_OWN;
109111
}
110112

111113
void TransactionContext::RecordUpdate(const ItemPointer &location) {
112114
PELOTON_ASSERT(rw_set_.count(location) == 0 ||
113-
(rw_set_[location] != RWType::DELETE && rw_set_[location] != RWType::INS_DEL));
115+
(rw_set_[location] != RWType::DELETE &&
116+
rw_set_[location] != RWType::INS_DEL));
114117
rw_set_[location] = RWType::UPDATE;
115118
}
116119

@@ -121,12 +124,12 @@ void TransactionContext::RecordInsert(const ItemPointer &location) {
121124

122125
void TransactionContext::RecordDelete(const ItemPointer &location) {
123126
PELOTON_ASSERT(rw_set_.count(location) == 0 ||
124-
(rw_set_[location] != RWType::DELETE && rw_set_[location] != RWType::INS_DEL));
127+
(rw_set_[location] != RWType::DELETE &&
128+
rw_set_[location] != RWType::INS_DEL));
125129
auto rw_set_it = rw_set_.find(location);
126130
if (rw_set_it != rw_set_.end() && rw_set_it->second == RWType::INSERT) {
127131
rw_set_it->second = RWType::INS_DEL;
128-
}
129-
else {
132+
} else {
130133
rw_set_[location] = RWType::DELETE;
131134
}
132135
}

test/common/lock_free_array_test.cpp

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,15 @@ TEST_F(LockFreeArrayTests, SharedPointerTest2) {
9696
}
9797

9898
TEST_F(LockFreeArrayTests, FindValidAndEraseTest) {
99-
100-
typedef uint32_t value_type;
99+
typedef uint32_t value_type;
101100

102101
{
103102
LockFreeArray<value_type> array;
104103

105104
value_type invalid_value = 6288;
106105

107106
size_t const element_count = 3;
108-
for (size_t element = 0; element < element_count; ++element ) {
107+
for (size_t element = 0; element < element_count; ++element) {
109108
array.Append(element);
110109
}
111110

@@ -120,20 +119,18 @@ TEST_F(LockFreeArrayTests, FindValidAndEraseTest) {
120119
// in range, erased
121120
EXPECT_EQ(invalid_value, array.FindValid(2, invalid_value));
122121
}
123-
124122
}
125123

126124
TEST_F(LockFreeArrayTests, ClearAndIsEmptyTest) {
127-
128-
typedef uint32_t value_type;
125+
typedef uint32_t value_type;
129126

130127
{
131128
LockFreeArray<value_type> array;
132129

133130
EXPECT_TRUE(array.IsEmpty());
134131

135132
size_t const element_count = 3;
136-
for (size_t element = 0; element < element_count; ++element ) {
133+
for (size_t element = 0; element < element_count; ++element) {
137134
array.Append(element);
138135
}
139136

@@ -145,24 +142,20 @@ TEST_F(LockFreeArrayTests, ClearAndIsEmptyTest) {
145142

146143
EXPECT_TRUE(array.IsEmpty());
147144

148-
149145
EXPECT_FALSE(array.Contains(2));
150-
151146
}
152-
153147
}
154148

155149
TEST_F(LockFreeArrayTests, ContainsTest) {
156-
157-
typedef uint32_t value_type;
150+
typedef uint32_t value_type;
158151

159152
{
160153
LockFreeArray<value_type> array;
161154

162155
EXPECT_FALSE(array.Contains(2));
163156

164157
size_t const element_count = 3;
165-
for (size_t element = 0; element < element_count; ++element ) {
158+
for (size_t element = 0; element < element_count; ++element) {
166159
array.Append(element);
167160
}
168161

@@ -171,20 +164,17 @@ TEST_F(LockFreeArrayTests, ContainsTest) {
171164
array.Clear();
172165

173166
EXPECT_FALSE(array.Contains(2));
174-
175167
}
176-
177168
}
178169

179170
TEST_F(LockFreeArrayTests, UpdateTest) {
180-
181-
typedef uint32_t value_type;
171+
typedef uint32_t value_type;
182172

183173
{
184174
LockFreeArray<value_type> array;
185175

186176
size_t const element_count = 3;
187-
for (size_t element = 0; element < element_count; ++element ) {
177+
for (size_t element = 0; element < element_count; ++element) {
188178
array.Append(element);
189179
}
190180

@@ -193,9 +183,7 @@ TEST_F(LockFreeArrayTests, UpdateTest) {
193183
array.Update(2, 6288);
194184

195185
EXPECT_EQ(6288, array.Find(2));
196-
197186
}
198-
199187
}
200188

201189
} // namespace test

0 commit comments

Comments
 (0)