Skip to content

Commit 2df99f1

Browse files
authored
Merge pull request #120 from thawk105/ss2pl-ycsb-workload
Add the missing YCSB entrypoint for SS2PL
2 parents d85fa96 + b629dc1 commit 2df99f1

6 files changed

Lines changed: 49 additions & 128 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ The repository now also bundles the **TPC-C** and **BoMB** workloads, and severa
99
| Protocol | YCSB | TPC-C | BoMB |
1010
|---|:-:|:-:|:-:|
1111
| Silo, MOCC, Cicada, ERMIA, TicToc, Oze, SI ||||
12-
| SS2PL, MVTO ||||
12+
| SS2PL ||||
13+
| MVTO ||||
1314
| D2PL ||||
1415

1516
See [docs/workloads_en.md](docs/workloads_en.md) for the workload specs (tables, transactions, parameters) and [docs/protocols_en.md](docs/protocols_en.md) for the full protocol matrix.

cc/ss2pl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ccbench_add_protocol(ss2pl
22
SOURCES transaction.cc util.cc
3-
WORKLOADS bomb tpcc
3+
WORKLOADS ycsb bomb tpcc
44
OPTIONS
55
DLR1
66
KEY_SORT=${CCBENCH_KEY_SORT}

cc/ss2pl/ss2pl.cc

Lines changed: 0 additions & 122 deletions
This file was deleted.

cc/ss2pl/ycsb_ss2pl.cc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#define GLOBAL_VALUE_DEFINE
2+
3+
#include "include/common.hh"
4+
#include "include/result.hh"
5+
#include "include/transaction.hh"
6+
#include "include/util.hh"
7+
8+
#include "../../include/cpu.hh"
9+
#include "../../include/debug.hh"
10+
#include "../../include/masstree_wrapper.hh"
11+
#include "../../include/result.hh"
12+
#include "../../include/tsc.hh"
13+
#include "../../include/util.hh"
14+
#include "../../include/ycsb.hh"
15+
16+
#include "../../common/runner.hh"
17+
18+
int main(int argc, char* argv[]) try {
19+
gflags::SetUsageMessage("YCSB SS2PL benchmark.");
20+
gflags::ParseCommandLineFlags(&argc, &argv, true);
21+
chkArg();
22+
YcsbWorkload::displayWorkloadParameter();
23+
YcsbWorkload::makeDB<Tuple, void>(nullptr);
24+
25+
initResult(TotalThreadNum);
26+
27+
ccbench::run<TxExecutor, TransactionStatus, YcsbWorkload>(
28+
TotalThreadNum, ccbench::RunnerOptions{},
29+
[](std::size_t thid, const bool& quit, Backoff& /*unused*/) {
30+
return TxExecutor(thid, &CCBenchResults[thid], quit);
31+
},
32+
[](TxExecutor& /*trans*/, std::size_t thid) {
33+
#ifdef Linux
34+
setThreadAffinity(thid);
35+
#endif
36+
#if MASSTREE_USE
37+
MasstreeWrapper<Tuple>::thread_init(static_cast<int>(thid));
38+
#endif
39+
});
40+
41+
return 0;
42+
} catch (const std::bad_alloc&) { ERR; }

docs/protocols_en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ for the declarative helper). All are driven from the top-level
1515
| [cc/ermia](../cc/ermia/) | ERMIA (with SSN / latch-free SSN) |||| Kim et al., SIGMOD 2016; Wang et al., VLDB 2017 |
1616
| [cc/oze](../cc/oze/) | Oze |||| Multi-version OCC variant |
1717
| [cc/si](../cc/si/) | Snapshot Isolation |||| ERMIA without the SSN layer (no anti-dependency check) |
18-
| [cc/ss2pl](../cc/ss2pl/) | Strong Strict 2-Phase Locking | ||| Baseline locking |
18+
| [cc/ss2pl](../cc/ss2pl/) | Strong Strict 2-Phase Locking | ||| Baseline locking |
1919
| [cc/d2pl](../cc/d2pl/) | Deterministic 2PL |||| sBoMB and dBoMB only; pre-declared lock entries make TPC-C templates inapplicable |
2020
| [cc/mvto](../cc/mvto/) | Multi-Version Timestamp Ordering |||| Reed, 1978 |
2121

@@ -41,7 +41,7 @@ argument of every `ccbench_add_protocol(...)` call. The current snapshot:
4141
| `cc/tictoc/` ||||||
4242
| `cc/oze/` ||||||
4343
| `cc/si/` ||||||
44-
| `cc/ss2pl/` | |||||
44+
| `cc/ss2pl/` | |||||
4545
| `cc/mvto/` ||||||
4646
| `cc/d2pl/` ||||||
4747

docs/protocols_ja.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| [cc/ermia](../cc/ermia/) | ERMIA (with SSN / latch-free SSN) |||| Kim et al., SIGMOD 2016; Wang et al., VLDB 2017 |
1212
| [cc/oze](../cc/oze/) | Oze |||| Multi-version OCC の派生 |
1313
| [cc/si](../cc/si/) | Snapshot Isolation |||| ERMIA から SSN レイヤを剥がしたもの (anti-dependency チェック無し) |
14-
| [cc/ss2pl](../cc/ss2pl/) | Strong Strict 2-Phase Locking | ||| ベースラインのロック方式 |
14+
| [cc/ss2pl](../cc/ss2pl/) | Strong Strict 2-Phase Locking | ||| ベースラインのロック方式 |
1515
| [cc/d2pl](../cc/d2pl/) | Deterministic 2PL |||| sBoMB と dBoMB のみサポート。pre-declared lock entries が必要なため TPC-C テンプレートには適用不能 |
1616
| [cc/mvto](../cc/mvto/) | Multi-Version Timestamp Ordering |||| Reed, 1978 |
1717

@@ -30,7 +30,7 @@
3030
| `cc/tictoc/` ||||||
3131
| `cc/oze/` ||||||
3232
| `cc/si/` ||||||
33-
| `cc/ss2pl/` | |||||
33+
| `cc/ss2pl/` | |||||
3434
| `cc/mvto/` ||||||
3535
| `cc/d2pl/` ||||||
3636

0 commit comments

Comments
 (0)