Generate YCSB datasets according to different worloads, and output to file.
The origin YCSB repository is [https://github.com/brianfrankcooper/YCSB]
-
Download Redis and install [https://github.com/redis/redis]
git clone https://github.com/redis/redis cd redis make
-
Write wordload cnofiguration file in ./workloads . We can set some parameters in this file, including key distribution, key length, and etc. The guidelines can be found in [https://github.com/brianfrankcooper/YCSB/wiki/Implementing-New-Workloads]
-
Generate dataset
First, start redis server
cd redis src/redis-server --bind 127.0.0.1 --port 6379
Then start ycsb.sh, which needs installing java and maven
cd YCSB-generator ./ycsb.sh <selected_workload> <loadnum> <runnum> <loadfile> <runfile>
The dataset is stored in loadfile and runfile. The format is
insert <key> update <key> read <key>
The default skewness of YCSB is 0.99. If you want to generate datasets with different skewness, please modify these files below. You should replace 0.99 in these file with you wanted skewness.
core/src/main/java/site/ycsb/generator/ZipfianGenerator.java
core/src/main/java/site/ycsb/generator/ScrambledZipfianGenerator.java
core/src/main/java/site/ycsb/workloads/RestWorkload.java
Enjoy!