├── kvs ├── YCSB │ ├── YCSB │ │ ├── core │ │ │ └── src │ │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ └── project.properties │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ ├── generator │ │ │ │ │ └── SequentialGenerator.java │ │ │ │ │ └── measurements │ │ │ │ │ └── OneMeasurement.java │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── yahoo │ │ │ │ └── ycsb │ │ │ │ ├── generator │ │ │ │ ├── TestZipfianGenerator.java │ │ │ │ └── AcknowledgedCounterGeneratorTest.java │ │ │ │ ├── TestByteIterator.java │ │ │ │ └── measurements │ │ │ │ └── exporter │ │ │ │ └── TestMeasurementsExporter.java │ │ ├── doc │ │ │ ├── images │ │ │ │ ├── ycsb.jpg │ │ │ │ └── ycsblogo-small.png │ │ │ ├── coreproperties.html │ │ │ └── parallelclients.html │ │ ├── .editorconfig │ │ ├── mapkeeper │ │ │ ├── README.md │ │ │ └── pom.xml │ │ ├── execution_command_mac.txt │ │ ├── solr │ │ │ ├── src │ │ │ │ ├── main │ │ │ │ │ ├── resources │ │ │ │ │ │ └── log4j.properties │ │ │ │ │ └── java │ │ │ │ │ │ └── com │ │ │ │ │ │ └── yahoo │ │ │ │ │ │ └── ycsb │ │ │ │ │ │ └── db │ │ │ │ │ │ └── package-info.java │ │ │ │ └── test │ │ │ │ │ ├── resources │ │ │ │ │ ├── log4j.properties │ │ │ │ │ └── solr_config │ │ │ │ │ │ └── solrconfig.xml │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ ├── SolrClientCloudTest.java │ │ │ │ │ └── SolrClientTest.java │ │ │ └── pom.xml │ │ ├── orientdb │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── resources │ │ │ │ │ └── log4j.properties │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ └── pom.xml │ │ ├── .gitignore │ │ ├── NOTICE.txt │ │ ├── jdbc │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── resources │ │ │ │ │ └── sql │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── create_table.mysql │ │ │ │ │ │ └── create_table.sql │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ └── pom.xml │ │ ├── s3 │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ └── pom.xml │ │ ├── memcached │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ └── pom.xml │ │ ├── rados │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ ├── README.md │ │ │ └── pom.xml │ │ ├── kudu │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ ├── pom.xml │ │ │ └── README.md │ │ ├── redis │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ ├── README.md │ │ │ └── pom.xml │ │ ├── asynchbase │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ │ └── test │ │ │ │ └── resources │ │ │ │ ├── log4j.properties │ │ │ │ └── hbase-site.xml │ │ ├── aerospike │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ ├── pom.xml │ │ │ └── README.md │ │ ├── hypertable │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── yahoo │ │ │ │ └── ycsb │ │ │ │ └── db │ │ │ │ └── package-info.java │ │ ├── tarantool │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ └── pom.xml │ │ ├── infinispan │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── RemoteCacheManagerHolder.java │ │ │ └── README.md │ │ ├── couchbase │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ └── pom.xml │ │ ├── dynamodb │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── yahoo │ │ │ │ │ │ └── ycsb │ │ │ │ │ │ └── db │ │ │ │ │ │ └── package-info.java │ │ │ │ │ └── resources │ │ │ │ │ └── log4j.properties │ │ │ └── pom.xml │ │ ├── geode │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ ├── README.md │ │ │ └── pom.xml │ │ ├── voldemort │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── yahoo │ │ │ │ │ │ └── ycsb │ │ │ │ │ │ └── db │ │ │ │ │ │ └── package-info.java │ │ │ │ │ └── resources │ │ │ │ │ └── config │ │ │ │ │ ├── cluster.xml │ │ │ │ │ ├── stores.xml │ │ │ │ │ └── server.properties │ │ │ └── pom.xml │ │ ├── accumulo │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── accumulo │ │ │ │ │ └── package-info.java │ │ │ │ └── test │ │ │ │ └── resources │ │ │ │ └── log4j.properties │ │ ├── cassandra2 │ │ │ ├── src │ │ │ │ ├── main │ │ │ │ │ └── java │ │ │ │ │ │ └── com │ │ │ │ │ │ └── yahoo │ │ │ │ │ │ └── ycsb │ │ │ │ │ │ └── db │ │ │ │ │ │ └── package-info.java │ │ │ │ └── test │ │ │ │ │ └── resources │ │ │ │ │ └── ycsb.cql │ │ │ └── pom.xml │ │ ├── googlebigtable │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ └── pom.xml │ │ ├── googledatastore │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── yahoo │ │ │ │ │ │ └── ycsb │ │ │ │ │ │ └── db │ │ │ │ │ │ └── package-info.java │ │ │ │ │ └── resources │ │ │ │ │ └── log4j.properties │ │ │ └── pom.xml │ │ ├── hbase10 │ │ │ ├── src │ │ │ │ ├── main │ │ │ │ │ └── java │ │ │ │ │ │ └── com │ │ │ │ │ │ └── yahoo │ │ │ │ │ │ └── ycsb │ │ │ │ │ │ └── db │ │ │ │ │ │ └── package-info.java │ │ │ │ └── test │ │ │ │ │ └── resources │ │ │ │ │ ├── log4j.properties │ │ │ │ │ └── hbase-site.xml │ │ │ └── pom.xml │ │ ├── elasticsearch │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ ├── pom.xml │ │ │ └── README.md │ │ ├── cassandra │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ └── pom.xml │ │ ├── couchbase2 │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── couchbase2 │ │ │ │ │ └── package-info.java │ │ │ └── pom.xml │ │ ├── nosqldb │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── package-info.java │ │ │ ├── README.md │ │ │ └── pom.xml │ │ ├── riak │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ └── riak │ │ │ │ │ └── package-info.java │ │ │ └── pom.xml │ │ ├── hbase094 │ │ │ ├── README.md │ │ │ └── pom.xml │ │ ├── mongodb │ │ │ └── src │ │ │ │ ├── test │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── yahoo │ │ │ │ │ └── ycsb │ │ │ │ │ └── db │ │ │ │ │ ├── AsyncMongoDbClientTest.java │ │ │ │ │ └── MongoDbClientTest.java │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── logback.xml │ │ │ │ └── log4j.properties │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── yahoo │ │ │ │ └── ycsb │ │ │ │ └── db │ │ │ │ └── package-info.java │ │ ├── .travis.yml │ │ ├── binding-parent │ │ │ └── datastore-specific-descriptor │ │ │ │ └── pom.xml │ │ ├── hbase098 │ │ │ └── pom.xml │ │ └── README.md │ ├── run_benchmark.cpp │ └── CMakeLists.txt ├── include │ ├── socket_cache.cc │ ├── base_kvs.h │ ├── zmq_util.h │ ├── versioned_kvs.h │ ├── server_utility.h │ ├── socket_cache.h │ ├── rc_kvs.h │ ├── lww_kvs.h │ ├── zmq_util.cc │ └── consistent_hash_map.hpp ├── message.proto ├── kvs_benchmark_trigger.cpp └── CMakeLists.txt ├── scripts ├── build_debug.sh └── build_release.sh ├── include ├── spdlog │ ├── fmt │ │ ├── ostr.h │ │ ├── fmt.h │ │ └── bundled │ │ │ ├── printf.cc │ │ │ ├── ostream.cc │ │ │ └── LICENSE.rst │ ├── sinks │ │ ├── windebug_sink.h │ │ ├── null_sink.h │ │ ├── msvc_sink.h │ │ ├── sink.h │ │ ├── ostream_sink.h │ │ ├── base_sink.h │ │ ├── dist_sink.h │ │ ├── stdout_sinks.h │ │ ├── syslog_sink.h │ │ └── android_sink.h │ ├── details │ │ ├── null_mutex.h │ │ └── log_msg.h │ └── formatter.h └── base_lattices.h ├── vendor ├── zeromqcpp │ └── CMakeLists.txt ├── tbb │ └── CMakeLists.txt ├── googlebenchmark │ └── CMakeLists.txt ├── googletest │ └── CMakeLists.txt ├── zeromq │ └── CMakeLists.txt └── boost │ └── CMakeLists.txt ├── CMakeLists.txt └── .gitignore /kvs/YCSB/YCSB/core/src/main/resources/project.properties: -------------------------------------------------------------------------------- 1 | version=${project.version} 2 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/doc/images/ycsb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucbrise/anna/HEAD/kvs/YCSB/YCSB/doc/images/ycsb.jpg -------------------------------------------------------------------------------- /scripts/build_debug.sh: -------------------------------------------------------------------------------- 1 | rm -rf build 2 | mkdir build 3 | cd build 4 | cmake -DCMAKE_BUILD_TYPE=Debug .. 5 | make 6 | -------------------------------------------------------------------------------- /scripts/build_release.sh: -------------------------------------------------------------------------------- 1 | rm -rf build 2 | mkdir build 3 | cd build 4 | cmake -DCMAKE_BUILD_TYPE=Release .. 5 | make 6 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/doc/images/ycsblogo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ucbrise/anna/HEAD/kvs/YCSB/YCSB/doc/images/ycsblogo-small.png -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/.editorconfig: -------------------------------------------------------------------------------- 1 | # For more info, see: http://EditorConfig.org 2 | root = true 3 | 4 | [*.java] 5 | indent_style = space 6 | indent_size = 2 7 | 8 | [*.md] 9 | indent_style = space 10 | indent_size = 2 11 | 12 | [*.xml] 13 | indent_style = space 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/mapkeeper/README.md: -------------------------------------------------------------------------------- 1 | # MapKeeper-Specific Properties 2 | 3 | ## mapkeeper.host 4 | 5 | Specifies the host MapKeeper server is running on (default: localhost). 6 | 7 | ## mapkeeper.port 8 | 9 | Specifies the port MapKeeper server is listening to (default: 9090). 10 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/execution_command_mac.txt: -------------------------------------------------------------------------------- 1 | java -cp core/target/core-0.11.0-SNAPSHOT.jar:latticedb/target/latticedb-binding-0.11.0-SNAPSHOT.jar:latticedb/target/dependency/jzmq-3.1.0.jar:latticedb/target/dependency/protobuf-java-3.0.0-beta-3.jar -Djava.library.path=/usr/local/lib com.yahoo.ycsb.Client -load -db com.yahoo.ycsb.db.LatticedbClient -P workloads/workloada -s 2 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/solr/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stderr 3 | 4 | # Direct log messages to stderr 5 | log4j.appender.stderr=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stderr.Target=System.err 7 | log4j.appender.stderr.layout=org.apache.log4j.PatternLayout 8 | log4j.appender.stderr.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 9 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/orientdb/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stderr 3 | 4 | # Direct log messages to stderr 5 | log4j.appender.stderr=org.apache.log4j.ConsoleAppender 6 | log4j.appender.stderr.Target=System.err 7 | log4j.appender.stderr.layout=org.apache.log4j.PatternLayout 8 | log4j.appender.stderr.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 9 | -------------------------------------------------------------------------------- /include/spdlog/fmt/ostr.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | // include external or bundled copy of fmtlib's ostream support 9 | // 10 | #if !defined(SPDLOG_FMT_EXTERNAL) 11 | #include "fmt.h" 12 | #include "bundled/ostream.h" 13 | #else 14 | #include 15 | #endif 16 | 17 | 18 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/.gitignore: -------------------------------------------------------------------------------- 1 | # ignore compiled byte code 2 | target 3 | 4 | # ignore output files from testing 5 | output* 6 | 7 | # ignore standard Eclipse files 8 | .project 9 | .classpath 10 | .settings 11 | .checkstyle 12 | 13 | # ignore standard IntelliJ files 14 | .idea/ 15 | *.iml 16 | *.iws 17 | 18 | # ignore standard Vim and Emacs temp files 19 | *.swp 20 | *~ 21 | 22 | # ignore standard Mac OS X files/dirs 23 | .DS_Store 24 | -------------------------------------------------------------------------------- /include/spdlog/sinks/windebug_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2017 Alexander Dalshov. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #if defined(_WIN32) 9 | 10 | #include "msvc_sink.h" 11 | 12 | namespace spdlog 13 | { 14 | namespace sinks 15 | { 16 | 17 | /* 18 | * Windows debug sink (logging using OutputDebugStringA, synonym for msvc_sink) 19 | */ 20 | template 21 | using windebug_sink = msvc_sink; 22 | 23 | typedef msvc_sink_mt windebug_sink_mt; 24 | typedef msvc_sink_st windebug_sink_st; 25 | 26 | } 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /kvs/include/socket_cache.cc: -------------------------------------------------------------------------------- 1 | #include "socket_cache.h" 2 | 3 | #include 4 | 5 | 6 | zmq::socket_t& SocketCache::At(const std::string& addr) { 7 | auto iter = cache_.find(addr); 8 | if (iter != cache_.end()) { 9 | return iter->second; 10 | } 11 | zmq::socket_t socket(*context_, type_); 12 | socket.connect(addr); 13 | auto p = cache_.insert(std::make_pair(addr, std::move(socket))); 14 | return p.first->second; 15 | } 16 | 17 | zmq::socket_t& SocketCache::operator[](const std::string& addr) { 18 | return At(addr); 19 | } 20 | 21 | void SocketCache::clear_cache() { 22 | cache_.clear(); 23 | } 24 | -------------------------------------------------------------------------------- /kvs/YCSB/run_benchmark.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "benchmark_KVS.h" 6 | 7 | BENCHMARK(BM_KVSGET)->Arg(pow(10, 6)); 8 | BENCHMARK(BM_CKVSGET)->Arg(pow(10, 6))->ThreadRange(1, 8)->UseRealTime(); 9 | BENCHMARK(BM_KVSGETComparison)->Arg(pow(10, 6))->UseRealTime(); 10 | BENCHMARK(BM_KVSPUT)->Arg(pow(10, 6)); 11 | BENCHMARK(BM_CKVSPUT_LOWCONTENTION)->Arg(pow(10, 6))->ThreadRange(1, 8)->UseRealTime(); 12 | BENCHMARK(BM_CKVSPUT_HIGHCONTENTION)->Arg(pow(10, 6))->ThreadRange(1, 8)->UseRealTime(); 13 | BENCHMARK(BM_KVSPUTComparison)->Arg(pow(10, 6))->UseRealTime(); 14 | 15 | BENCHMARK_MAIN(); -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | NOTICE file for use with, and corresponding to Section 4 of, 3 | the Apache License, Version 2.0, 4 | in this case for the YCSB project. 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | Yahoo! Inc. (www.yahoo.com) 9 | Copyright (c) 2010 Yahoo! Inc. All rights reserved. 10 | 11 | This product includes software developed by 12 | Google Inc. (www.google.com) 13 | Copyright (c) 2015 Google Inc. All rights reserved. 14 | -------------------------------------------------------------------------------- /vendor/zeromqcpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Resources: 2 | # - http://zeromq.org/intro:get-the-software 3 | # - http://bit.ly/2dK0UBT 4 | # 5 | # Remember to have libtool, pkg-config, build-essential, autoconf, and automake 6 | # installed. 7 | 8 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 9 | 10 | include(ExternalProject) 11 | 12 | ExternalProject_Add(zeromqcpp 13 | GIT_REPOSITORY "https://github.com/zeromq/cppzmq.git" 14 | GIT_TAG "master" 15 | BUILD_IN_SOURCE 1 16 | UPDATE_COMMAND "" 17 | CONFIGURE_COMMAND "" 18 | BUILD_COMMAND "" 19 | INSTALL_COMMAND "" 20 | ) 21 | 22 | set(ZEROMQCPP_INCLUDE_DIRS 23 | ${CMAKE_CURRENT_BINARY_DIR}/zeromqcpp-prefix/src/zeromqcpp PARENT_SCOPE) 24 | -------------------------------------------------------------------------------- /kvs/include/base_kvs.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "core_lattices.h" 6 | 7 | using namespace std; 8 | 9 | template 10 | class KV_Store{ 11 | protected: 12 | MapLattice db; 13 | public: 14 | KV_Store() {} 15 | KV_Store(MapLattice &other) { 16 | db = other; 17 | } 18 | V get(const K& k, unsigned& err_number) { 19 | if (!db.contain(k).reveal()) { 20 | err_number = 1; 21 | } 22 | return db.at(k); 23 | } 24 | bool put(const K& k, const V &v) { 25 | return db.at(k).Merge(v); 26 | } 27 | void remove(const K& k) { 28 | db.remove(k); 29 | } 30 | }; -------------------------------------------------------------------------------- /include/spdlog/sinks/null_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "base_sink.h" 9 | #include "../details/null_mutex.h" 10 | 11 | #include 12 | 13 | namespace spdlog 14 | { 15 | namespace sinks 16 | { 17 | 18 | template 19 | class null_sink : public base_sink < Mutex > 20 | { 21 | protected: 22 | void _sink_it(const details::log_msg&) override 23 | {} 24 | 25 | void _flush() override 26 | {} 27 | 28 | }; 29 | typedef null_sink null_sink_st; 30 | typedef null_sink null_sink_mt; 31 | 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /kvs/YCSB/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | add_executable(run_kvs_benchmark run_benchmark.cpp) 4 | add_executable(benchmark_gossip benchmark_gossip.cpp) 5 | add_executable(benchmark_shared benchmark_shared.cpp) 6 | 7 | IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 8 | # Mac OS X specific code 9 | target_link_libraries (run_kvs_benchmark ${PROJECT_SOURCE_DIR}/vendor/gbenchmark/build/src/libbenchmark.dylib) 10 | ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 11 | 12 | IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") 13 | # Linux specific code 14 | target_link_libraries (run_kvs_benchmark ${PROJECT_SOURCE_DIR}/vendor/gbenchmark/build/src/libbenchmark.so) 15 | ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") -------------------------------------------------------------------------------- /include/spdlog/fmt/fmt.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | // 9 | // Include a bundled header-only copy of fmtlib or an external one. 10 | // By default spdlog include its own copy. 11 | // 12 | 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #ifndef FMT_USE_WINDOWS_H 19 | #define FMT_USE_WINDOWS_H 0 20 | #endif 21 | #include "bundled/format.h" 22 | #if defined(SPDLOG_FMT_PRINTF) 23 | #include "bundled/printf.h" 24 | #endif 25 | 26 | #else //external fmtlib 27 | 28 | #include 29 | #if defined(SPDLOG_FMT_PRINTF) 30 | #include 31 | #endif 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/jdbc/src/main/resources/sql/README.md: -------------------------------------------------------------------------------- 1 | 18 | Contains all the SQL statements used by the JDBC client. 19 | -------------------------------------------------------------------------------- /vendor/tbb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 | 3 | include(ExternalProject) 4 | 5 | ExternalProject_Add(tbb 6 | URL "https://github.com/01org/tbb/archive/2018_U1.tar.gz" 7 | PREFIX ${CMAKE_CURRENT_BINARY_DIR} 8 | BUILD_IN_SOURCE 1 9 | UPDATE_COMMAND "" 10 | CONFIGURE_COMMAND "" 11 | BUILD_COMMAND make compiler=clang stdlib=libc++ std=c++11 12 | INSTALL_COMMAND "" 13 | ) 14 | 15 | set(TBB_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/src/tbb/include PARENT_SCOPE) 16 | set(TBB_LINK_DIRS 17 | ${CMAKE_CURRENT_BINARY_DIR}/src/tbb/build/linux_intel64_clang_cc4.8_libc2.19_kernel3.13.0_release 18 | PARENT_SCOPE) 19 | set(TBB_LIBRARIES 20 | ${CMAKE_CURRENT_BINARY_DIR}/src/tbb/build/linux_intel64_clang_cc4.8_libc2.19_kernel3.13.0_release/libtbb.so 21 | PARENT_SCOPE) 22 | -------------------------------------------------------------------------------- /vendor/googlebenchmark/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Resources: 2 | # - http://www.kaizou.org/2014/11/gtest-cmake/ 3 | # - http://bit.ly/2cx70Pk 4 | # - https://github.com/snikulov/google-test-examples 5 | 6 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 7 | 8 | include(ExternalProject) 9 | 10 | ExternalProject_Add(googlebenchmark 11 | GIT_REPOSITORY "https://github.com/google/benchmark" 12 | GIT_TAG "v1.0.0" 13 | PREFIX ${CMAKE_CURRENT_BINARY_DIR} 14 | CMAKE_ARGS "CMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-stdlib=libc++" 15 | INSTALL_COMMAND "" 16 | ) 17 | 18 | ExternalProject_Get_Property(googlebenchmark SOURCE_DIR) 19 | SET(GBENCH_INCLUDE_DIRS ${SOURCE_DIR}/include PARENT_SCOPE) 20 | 21 | ExternalProject_Get_Property(googlebenchmark BINARY_DIR) 22 | SET(GBENCH_LIBS_DIR ${BINARY_DIR}/src PARENT_SCOPE) 23 | -------------------------------------------------------------------------------- /vendor/googletest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Resources: 2 | # - http://www.kaizou.org/2014/11/gtest-cmake/ 3 | # - http://bit.ly/2cx70Pk 4 | # - https://github.com/snikulov/google-test-examples 5 | 6 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 7 | 8 | include(ExternalProject) 9 | 10 | ExternalProject_Add(googletest 11 | GIT_REPOSITORY "https://github.com/google/googletest" 12 | GIT_TAG "release-1.8.0" 13 | PREFIX ${CMAKE_CURRENT_BINARY_DIR} 14 | CMAKE_ARGS "CMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-stdlib=libc++" 15 | INSTALL_COMMAND "" 16 | ) 17 | 18 | ExternalProject_Get_Property(googletest SOURCE_DIR) 19 | set(GTEST_INCLUDE_DIRS ${SOURCE_DIR}/googletest/include PARENT_SCOPE) 20 | 21 | ExternalProject_Get_Property(googletest BINARY_DIR) 22 | set(GTEST_LIBS_DIR ${BINARY_DIR}/googlemock/gtest PARENT_SCOPE) 23 | -------------------------------------------------------------------------------- /vendor/zeromq/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Resources: 2 | # - http://zeromq.org/intro:get-the-software 3 | # - http://bit.ly/2dK0UBT 4 | # 5 | # Remember to have libtool, pkg-config, build-essential, autoconf, and automake 6 | # installed. 7 | 8 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 9 | 10 | include(ExternalProject) 11 | 12 | SET(CXX "clang++ -stdlib=c++") 13 | 14 | ExternalProject_Add(zeromq 15 | URL "https://github.com/zeromq/zeromq4-1/releases/download/v4.1.5/zeromq-4.1.5.tar.gz" 16 | PREFIX ${CMAKE_CURRENT_BINARY_DIR} 17 | BUILD_IN_SOURCE 1 18 | UPDATE_COMMAND "" 19 | CONFIGURE_COMMAND ./configure 20 | BUILD_COMMAND make 21 | INSTALL_COMMAND "" 22 | ) 23 | 24 | set(ZEROMQ_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/src/zeromq/include PARENT_SCOPE) 25 | set(ZEROMQ_LINK_DIRS ${CMAKE_CURRENT_BINARY_DIR}/src/zeromq/.libs PARENT_SCOPE) -------------------------------------------------------------------------------- /include/spdlog/details/null_mutex.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include 9 | // null, no cost dummy "mutex" and dummy "atomic" int 10 | 11 | namespace spdlog 12 | { 13 | namespace details 14 | { 15 | struct null_mutex 16 | { 17 | void lock() {} 18 | void unlock() {} 19 | bool try_lock() 20 | { 21 | return true; 22 | } 23 | }; 24 | 25 | struct null_atomic_int 26 | { 27 | int value; 28 | null_atomic_int() = default; 29 | 30 | null_atomic_int(int val):value(val) 31 | {} 32 | 33 | int load(std::memory_order) const 34 | { 35 | return value; 36 | } 37 | 38 | void store(int val) 39 | { 40 | value = val; 41 | } 42 | }; 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/s3/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | * 17 | * S3 storage client binding for YCSB. 18 | */ 19 | 20 | package com.yahoo.ycsb.db; 21 | 22 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/memcached/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * YCSB binding for memcached. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/rados/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * YCSB binding for RADOS of Ceph. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/kudu/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for Kudu. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/redis/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for Redis. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/asynchbase/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for HBase using the AsyncHBase client. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/jdbc/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 - 2016, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for stores that can be accessed via JDBC. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/aerospike/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * YCSB binding for Areospike. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/hypertable/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for Hypertable. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | 23 | -------------------------------------------------------------------------------- /include/spdlog/fmt/bundled/printf.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Formatting library for C++ 3 | 4 | Copyright (c) 2012 - 2016, Victor Zverovich 5 | All rights reserved. 6 | 7 | For the license information refer to format.h. 8 | */ 9 | 10 | #include "format.h" 11 | #include "printf.h" 12 | 13 | namespace fmt { 14 | 15 | template 16 | void printf(BasicWriter &w, BasicCStringRef format, ArgList args); 17 | 18 | FMT_FUNC int fprintf(std::FILE *f, CStringRef format, ArgList args) { 19 | MemoryWriter w; 20 | printf(w, format, args); 21 | std::size_t size = w.size(); 22 | return std::fwrite(w.data(), 1, size, f) < size ? -1 : static_cast(size); 23 | } 24 | 25 | #ifndef FMT_HEADER_ONLY 26 | 27 | template void PrintfFormatter::format(CStringRef format); 28 | template void PrintfFormatter::format(WCStringRef format); 29 | 30 | #endif // FMT_HEADER_ONLY 31 | 32 | } // namespace fmt 33 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/tarantool/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 - 2016 YCSB Contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * YCSB binding for Tarantool. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/infinispan/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2016 YCSB Contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for Infinispan. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/orientdb/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 - 2016, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for OrientDB. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/solr/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for 20 | * Solr. 21 | */ 22 | package com.yahoo.ycsb.db; 23 | 24 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/couchbase/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 - 2016 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for Couchbase. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/dynamodb/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 YCSB Contributors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for DynamoDB. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/geode/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014-2016, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * YCSB binding for Apache Geode (incubating). 20 | */ 21 | package com.yahoo.ycsb.db; -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/voldemort/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. See accompanying LICENSE file. 15 | */ 16 | 17 | /** 18 | * The YCSB binding for 19 | * Voldemort. 20 | */ 21 | package com.yahoo.ycsb.db; 22 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/accumulo/src/main/java/com/yahoo/ycsb/db/accumulo/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * YCSB binding for Apache Accumulo. 20 | */ 21 | package com.yahoo.ycsb.db.accumulo; 22 | 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/cassandra2/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for Cassandra 20 | * 2.1+ via CQL. 21 | */ 22 | package com.yahoo.ycsb.db; 23 | 24 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/googlebigtable/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for Google's 20 | * Bigtable. 21 | */ 22 | package com.yahoo.ycsb.db; 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/googledatastore/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * YCSB binding for 20 | Google Cloud Datastore. 21 | */ 22 | package com.yahoo.ycsb.db; 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/hbase10/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for HBase 20 | * using the HBase 1.0.0 API. 21 | */ 22 | package com.yahoo.ycsb.db; 23 | 24 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/elasticsearch/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for 20 | * Elasticsearch. 21 | */ 22 | package com.yahoo.ycsb.db; 23 | 24 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/cassandra/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for Cassandra 20 | * versions 0.7, 0.8, and 1.0.X. 21 | */ 22 | package com.yahoo.ycsb.db; 23 | 24 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 - 2016 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for Couchbase, new driver. 20 | */ 21 | package com.yahoo.ycsb.db.couchbase2; 22 | 23 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/nosqldb/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. See accompanying LICENSE file. 15 | */ 16 | 17 | /** 18 | * The YCSB binding for Oracle 20 | * 's NoSQL DB. 21 | */ 22 | package com.yahoo.ycsb.db; 23 | -------------------------------------------------------------------------------- /vendor/boost/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Resources: 2 | # - http://bit.ly/2dfK5L1 3 | 4 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 5 | 6 | include(ExternalProject) 7 | 8 | ExternalProject_Add(boost 9 | URL "http://kent.dl.sourceforge.net/project/boost/boost/1.62.0/boost_1_62_0.tar.gz" 10 | PREFIX ${CMAKE_CURRENT_BINARY_DIR} 11 | BUILD_IN_SOURCE 1 12 | UPDATE_COMMAND "" 13 | CONFIGURE_COMMAND ./bootstrap.sh --with-toolset=clang --with-libraries=context,coroutine2 14 | BUILD_COMMAND ./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" 15 | INSTALL_COMMAND "" 16 | ) 17 | 18 | set(BOOST_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/src/boost PARENT_SCOPE) 19 | set(BOOST_LINK_DIRS ${CMAKE_CURRENT_BINARY_DIR}/src/boost/stage/lib PARENT_SCOPE) 20 | set(BOOST_THREAD_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/src/boost/stage/lib/libboost_thread.so PARENT_SCOPE) 21 | set(BOOST_SYSTEM_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/src/boost/stage/lib/libboost_system.so PARENT_SCOPE) -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/nosqldb/README.md: -------------------------------------------------------------------------------- 1 | CONFIGURE 2 | 3 | $KVHOME is Oracle NoSQL Database package files. 4 | $KVROOT is a data directory. 5 | $YCSBHOME is a YCSB home directory. 6 | 7 | mkdir $KVROOT 8 | java -jar $KVHOME/lib/kvstore-1.2.123.jar makebootconfig \ 9 | -root $KVROOT -port 5000 -admin 5001 -host localhost \ 10 | -harange 5010,5020 11 | java -jar $KVHOME/lib/kvstore-1.2.123.jar start -root $KVROOT 12 | java -jar $KVHOME/lib/kvstore-1.2.123.jar runadmin \ 13 | -port 5000 -host localhost -script $YCSBHOME/conf/script.txt 14 | 15 | BENCHMARK 16 | 17 | $YCSBHOME/bin/ycsb load nosqldb -P workloads/workloada 18 | $YCSBHOME/bin/ycsb run nosqldb -P workloads/workloada 19 | 20 | PROPERTIES 21 | 22 | See $YCSBHOME/conf/nosqldb.properties. 23 | 24 | STOP 25 | 26 | $ java -jar $KVHOME/lib/kvstore-1.2.123.jar stop -root $KVROOT 27 | 28 | 29 | Please refer to Oracle NoSQL Database docs here: 30 | http://docs.oracle.com/cd/NOSQL/html/index.html 31 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/riak/src/main/java/com/yahoo/ycsb/db/riak/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016 YCSB contributors All rights reserved. 3 | * Copyright 2014 Basho Technologies, Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you 6 | * may not use this file except in compliance with the License. You 7 | * may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 14 | * implied. See the License for the specific language governing 15 | * permissions and limitations under the License. See accompanying 16 | * LICENSE file. 17 | */ 18 | 19 | /** 20 | * The YCSB binding for Riak KV 2.x.y. 21 | * 22 | */ 23 | package com.yahoo.ycsb.db.riak; -------------------------------------------------------------------------------- /include/spdlog/sinks/msvc_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Alexander Dalshov. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #if defined(_WIN32) 9 | 10 | #include "base_sink.h" 11 | #include "../details/null_mutex.h" 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | namespace spdlog 19 | { 20 | namespace sinks 21 | { 22 | /* 23 | * MSVC sink (logging using OutputDebugStringA) 24 | */ 25 | template 26 | class msvc_sink : public base_sink < Mutex > 27 | { 28 | public: 29 | explicit msvc_sink() 30 | { 31 | } 32 | 33 | 34 | 35 | protected: 36 | void _sink_it(const details::log_msg& msg) override 37 | { 38 | OutputDebugStringA(msg.formatted.c_str()); 39 | } 40 | 41 | void _flush() override 42 | {} 43 | }; 44 | 45 | typedef msvc_sink msvc_sink_mt; 46 | typedef msvc_sink msvc_sink_st; 47 | 48 | } 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/cassandra2/src/test/resources/ycsb.cql: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 YCSB Contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | CREATE TABLE usertable ( 19 | y_id varchar primary key, 20 | field0 varchar, 21 | field1 varchar, 22 | field2 varchar, 23 | field3 varchar, 24 | field4 varchar, 25 | field5 varchar, 26 | field6 varchar, 27 | field7 varchar, 28 | field8 varchar, 29 | field9 varchar); 30 | -------------------------------------------------------------------------------- /include/spdlog/fmt/bundled/ostream.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Formatting library for C++ - std::ostream support 3 | 4 | Copyright (c) 2012 - 2016, Victor Zverovich 5 | All rights reserved. 6 | 7 | For the license information refer to format.h. 8 | */ 9 | 10 | #include "ostream.h" 11 | 12 | namespace fmt { 13 | 14 | namespace internal { 15 | FMT_FUNC void write(std::ostream &os, Writer &w) { 16 | const char *data = w.data(); 17 | typedef internal::MakeUnsigned::Type UnsignedStreamSize; 18 | UnsignedStreamSize size = w.size(); 19 | UnsignedStreamSize max_size = 20 | internal::to_unsigned((std::numeric_limits::max)()); 21 | do { 22 | UnsignedStreamSize n = size <= max_size ? size : max_size; 23 | os.write(data, static_cast(n)); 24 | data += n; 25 | size -= n; 26 | } while (size != 0); 27 | } 28 | } 29 | 30 | FMT_FUNC void print(std::ostream &os, CStringRef format_str, ArgList args) { 31 | MemoryWriter w; 32 | w.write(format_str, args); 33 | internal::write(os, w); 34 | } 35 | } // namespace fmt 36 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/voldemort/src/main/resources/config/cluster.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | mycluster 20 | 21 | 0 22 | localhost 23 | 8081 24 | 6666 25 | 0, 1 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/hbase094/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # HBase (0.94.x) Driver for YCSB 19 | This driver is a binding for the YCSB facilities to operate against a HBase 0.94.x Server cluster. It may also work against 0.92.x 20 | To run against an HBase 0.98.x cluster, use the `hbase098` binding. 21 | To run against an HBase >= 1.0 cluster, use the `hbase10` binding. 22 | 23 | See `hbase098/README.md` for configuration details. 24 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/jdbc/src/main/resources/sql/create_table.mysql: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2015 YCSB contributors. All rights reserved. 2 | -- 3 | -- Licensed under the Apache License, Version 2.0 (the "License"); you 4 | -- may not use this file except in compliance with the License. You 5 | -- may obtain a copy of the License at 6 | -- 7 | -- http://www.apache.org/licenses/LICENSE-2.0 8 | -- 9 | -- Unless required by applicable law or agreed to in writing, software 10 | -- distributed under the License is distributed on an "AS IS" BASIS, 11 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | -- implied. See the License for the specific language governing 13 | -- permissions and limitations under the License. See accompanying 14 | -- LICENSE file. 15 | 16 | -- Creates a Table. 17 | 18 | -- Drop the table if it exists; 19 | DROP TABLE IF EXISTS usertable; 20 | 21 | -- Create the user table with 5 fields. 22 | CREATE TABLE usertable(YCSB_KEY VARCHAR (255) PRIMARY KEY, 23 | FIELD0 TEXT, FIELD1 TEXT, 24 | FIELD2 TEXT, FIELD3 TEXT, 25 | FIELD4 TEXT, FIELD5 TEXT, 26 | FIELD6 TEXT, FIELD7 TEXT, 27 | FIELD8 TEXT, FIELD9 TEXT); 28 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/mongodb/src/test/java/com/yahoo/ycsb/db/AsyncMongoDbClientTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | package com.yahoo.ycsb.db; 18 | 19 | import com.yahoo.ycsb.DB; 20 | 21 | /** 22 | * AsyncMongoDbClientTest provides runs the basic workload operations. 23 | */ 24 | public class AsyncMongoDbClientTest extends MongoDbClientTest { 25 | 26 | @Override 27 | protected DB instantiateClient() { 28 | return new AsyncMongoDbClient(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/jdbc/src/main/resources/sql/create_table.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2015 YCSB contributors. All rights reserved. 2 | -- 3 | -- Licensed under the Apache License, Version 2.0 (the "License"); you 4 | -- may not use this file except in compliance with the License. You 5 | -- may obtain a copy of the License at 6 | -- 7 | -- http://www.apache.org/licenses/LICENSE-2.0 8 | -- 9 | -- Unless required by applicable law or agreed to in writing, software 10 | -- distributed under the License is distributed on an "AS IS" BASIS, 11 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | -- implied. See the License for the specific language governing 13 | -- permissions and limitations under the License. See accompanying 14 | -- LICENSE file. 15 | 16 | -- Creates a Table. 17 | 18 | -- Drop the table if it exists; 19 | DROP TABLE IF EXISTS usertable; 20 | 21 | -- Create the user table with 5 fields. 22 | CREATE TABLE usertable(YCSB_KEY VARCHAR PRIMARY KEY, 23 | FIELD0 VARCHAR, FIELD1 VARCHAR, 24 | FIELD2 VARCHAR, FIELD3 VARCHAR, 25 | FIELD4 VARCHAR, FIELD5 VARCHAR, 26 | FIELD6 VARCHAR, FIELD7 VARCHAR, 27 | FIELD8 VARCHAR, FIELD9 VARCHAR); 28 | -------------------------------------------------------------------------------- /include/spdlog/details/log_msg.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "../common.h" 9 | #include "../details/os.h" 10 | 11 | 12 | #include 13 | #include 14 | 15 | namespace spdlog 16 | { 17 | namespace details 18 | { 19 | struct log_msg 20 | { 21 | log_msg() = default; 22 | log_msg(const std::string *loggers_name, level::level_enum lvl) : 23 | logger_name(loggers_name), 24 | level(lvl), 25 | msg_id(0) 26 | { 27 | #ifndef SPDLOG_NO_DATETIME 28 | time = os::now(); 29 | #endif 30 | 31 | #ifndef SPDLOG_NO_THREAD_ID 32 | thread_id = os::thread_id(); 33 | #endif 34 | } 35 | 36 | log_msg(const log_msg& other) = delete; 37 | log_msg& operator=(log_msg&& other) = delete; 38 | log_msg(log_msg&& other) = delete; 39 | 40 | 41 | const std::string *logger_name; 42 | level::level_enum level; 43 | log_clock::time_point time; 44 | size_t thread_id; 45 | fmt::MemoryWriter raw; 46 | fmt::MemoryWriter formatted; 47 | size_t msg_id; 48 | }; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/.travis.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010 Yahoo! Inc., 2012 - 2015 YCSB contributors. 2 | # All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you 5 | # may not use this file except in compliance with the License. You 6 | # may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. See the License for the specific language governing 14 | # permissions and limitations under the License. See accompanying 15 | # LICENSE file. 16 | 17 | # more info here about TravisCI and Java projects 18 | # http://docs.travis-ci.com/user/languages/java/ 19 | 20 | language: java 21 | 22 | jdk: 23 | - oraclejdk8 24 | - oraclejdk7 25 | - openjdk7 26 | 27 | install: mvn install -q -DskipTests=true 28 | 29 | script: mvn test -q 30 | 31 | # Services to start for tests. 32 | services: 33 | - mongodb 34 | - riak 35 | 36 | 37 | # Use the Container based infrastructure. 38 | sudo: false -------------------------------------------------------------------------------- /include/spdlog/sinks/sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | 7 | #pragma once 8 | 9 | #include "../details/log_msg.h" 10 | 11 | namespace spdlog 12 | { 13 | namespace sinks 14 | { 15 | class sink 16 | { 17 | public: 18 | sink() 19 | { 20 | _level = level::trace; 21 | } 22 | 23 | virtual ~sink() {} 24 | virtual void log(const details::log_msg& msg) = 0; 25 | virtual void flush() = 0; 26 | 27 | bool should_log(level::level_enum msg_level) const; 28 | void set_level(level::level_enum log_level); 29 | level::level_enum level() const; 30 | 31 | private: 32 | level_t _level; 33 | 34 | }; 35 | 36 | inline bool sink::should_log(level::level_enum msg_level) const 37 | { 38 | return msg_level >= _level.load(std::memory_order_relaxed); 39 | } 40 | 41 | inline void sink::set_level(level::level_enum log_level) 42 | { 43 | _level.store(log_level); 44 | } 45 | 46 | inline level::level_enum sink::level() const 47 | { 48 | return static_cast(_level.load(std::memory_order_relaxed)); 49 | } 50 | 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/mongodb/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/dynamodb/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 YCSB contributors. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you 4 | # may not use this file except in compliance with the License. You 5 | # may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | # implied. See the License for the specific language governing 13 | # permissions and limitations under the License. See accompanying 14 | # LICENSE file. 15 | 16 | #define the console appender 17 | log4j.appender.consoleAppender = org.apache.log4j.ConsoleAppender 18 | 19 | # now define the layout for the appender 20 | log4j.appender.consoleAppender.layout = org.apache.log4j.PatternLayout 21 | log4j.appender.consoleAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x -%m%n 22 | 23 | # now map our console appender as a root logger, means all log messages will go 24 | # to this appender 25 | log4j.rootLogger = INFO, consoleAppender 26 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/mongodb/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 YCSB contributors. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you 4 | # may not use this file except in compliance with the License. You 5 | # may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | # implied. See the License for the specific language governing 13 | # permissions and limitations under the License. See accompanying 14 | # LICENSE file. 15 | 16 | #define the console appender 17 | log4j.appender.consoleAppender = org.apache.log4j.ConsoleAppender 18 | 19 | # now define the layout for the appender 20 | log4j.appender.consoleAppender.layout = org.apache.log4j.PatternLayout 21 | log4j.appender.consoleAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x -%m%n 22 | 23 | # now map our console appender as a root logger, means all log messages will go 24 | # to this appender 25 | log4j.rootLogger = INFO, consoleAppender 26 | -------------------------------------------------------------------------------- /kvs/message.proto: -------------------------------------------------------------------------------- 1 | package communication; 2 | 3 | message Request { 4 | message Tuple { 5 | required string key = 1; 6 | optional string value = 2; 7 | optional uint64 timestamp = 3; 8 | optional uint32 num_address = 4; 9 | } 10 | required string type = 1; 11 | optional string respond_address = 2; 12 | repeated Tuple tuple = 3; 13 | optional string request_id = 4; 14 | } 15 | 16 | message Response { 17 | message Tuple { 18 | required uint32 err_number = 1; 19 | required string key = 2; 20 | optional string value = 3; 21 | optional uint64 timestamp = 4; 22 | } 23 | repeated Tuple tuple = 1; 24 | optional string response_id = 2; 25 | } 26 | 27 | message Key_Request { 28 | required string respond_address = 1; 29 | repeated string keys = 2; 30 | optional string request_id = 3; 31 | } 32 | 33 | message Key_Response { 34 | message Tuple { 35 | required string key = 1; 36 | repeated string addresses = 2; 37 | } 38 | repeated Tuple tuple = 1; 39 | optional string response_id = 2; 40 | } 41 | 42 | message Address { 43 | message Tuple { 44 | required string ip = 1; 45 | } 46 | required uint64 start_time = 1; 47 | repeated Tuple tuple = 2; 48 | } 49 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/googledatastore/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 YCSB contributors. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you 4 | # may not use this file except in compliance with the License. You 5 | # may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | # implied. See the License for the specific language governing 13 | # permissions and limitations under the License. See accompanying 14 | # LICENSE file. 15 | 16 | #define the console appender 17 | log4j.appender.consoleAppender = org.apache.log4j.ConsoleAppender 18 | 19 | # now define the layout for the appender 20 | log4j.appender.consoleAppender.layout = org.apache.log4j.PatternLayout 21 | log4j.appender.consoleAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x -%m%n 22 | 23 | # now map our console appender as a root logger, means all log messages will go 24 | # to this appender 25 | log4j.rootLogger = INFO, consoleAppender 26 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/voldemort/src/main/resources/config/stores.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | usertable 21 | bdb 22 | client 23 | 1 24 | 1 25 | 1 26 | 27 | string 28 | 29 | 30 | java-serialization 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/accumulo/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015 YCSB contributors. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you 5 | # may not use this file except in compliance with the License. You 6 | # may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. See the License for the specific language governing 14 | # permissions and limitations under the License. See accompanying 15 | # LICENSE file. 16 | # 17 | 18 | # Root logger option 19 | log4j.rootLogger=INFO, stderr 20 | 21 | log4j.appender.stderr=org.apache.log4j.ConsoleAppender 22 | log4j.appender.stderr.target=System.err 23 | log4j.appender.stderr.layout=org.apache.log4j.PatternLayout 24 | log4j.appender.stderr.layout.conversionPattern=%d{yyyy/MM/dd HH:mm:ss} %-5p %c %x - %m%n 25 | 26 | # Suppress messages from ZooKeeper 27 | log4j.logger.com.yahoo.ycsb.db.accumulo=INFO 28 | log4j.logger.org.apache.zookeeper=ERROR 29 | log4j.logger.org.apache.accumulo=WARN 30 | -------------------------------------------------------------------------------- /include/spdlog/sinks/ostream_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "../details/null_mutex.h" 9 | #include "base_sink.h" 10 | 11 | #include 12 | #include 13 | 14 | namespace spdlog 15 | { 16 | namespace sinks 17 | { 18 | template 19 | class ostream_sink: public base_sink 20 | { 21 | public: 22 | explicit ostream_sink(std::ostream& os, bool force_flush=false) :_ostream(os), _force_flush(force_flush) {} 23 | ostream_sink(const ostream_sink&) = delete; 24 | ostream_sink& operator=(const ostream_sink&) = delete; 25 | virtual ~ostream_sink() = default; 26 | 27 | protected: 28 | void _sink_it(const details::log_msg& msg) override 29 | { 30 | _ostream.write(msg.formatted.data(), msg.formatted.size()); 31 | if (_force_flush) 32 | _ostream.flush(); 33 | } 34 | 35 | void _flush() override 36 | { 37 | _ostream.flush(); 38 | } 39 | 40 | std::ostream& _ostream; 41 | bool _force_flush; 42 | }; 43 | 44 | typedef ostream_sink ostream_sink_mt; 45 | typedef ostream_sink ostream_sink_st; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/hbase10/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015 YCSB contributors. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you 5 | # may not use this file except in compliance with the License. You 6 | # may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. See the License for the specific language governing 14 | # permissions and limitations under the License. See accompanying 15 | # LICENSE file. 16 | # 17 | 18 | # Root logger option 19 | log4j.rootLogger=WARN, stderr 20 | 21 | log4j.appender.stderr=org.apache.log4j.ConsoleAppender 22 | log4j.appender.stderr.target=System.err 23 | log4j.appender.stderr.layout=org.apache.log4j.PatternLayout 24 | log4j.appender.stderr.layout.conversionPattern=%d{yyyy/MM/dd HH:mm:ss} %-5p %c %x - %m%n 25 | 26 | # Suppress messages from ZKTableStateManager: Creates a large number of table 27 | # state change messages. 28 | log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKTableStateManager=ERROR 29 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/asynchbase/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015 YCSB contributors. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you 5 | # may not use this file except in compliance with the License. You 6 | # may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. See the License for the specific language governing 14 | # permissions and limitations under the License. See accompanying 15 | # LICENSE file. 16 | # 17 | 18 | # Root logger option 19 | log4j.rootLogger=WARN, stderr 20 | 21 | log4j.appender.stderr=org.apache.log4j.ConsoleAppender 22 | log4j.appender.stderr.target=System.err 23 | log4j.appender.stderr.layout=org.apache.log4j.PatternLayout 24 | log4j.appender.stderr.layout.conversionPattern=%d{yyyy/MM/dd HH:mm:ss} %-5p %c %x - %m%n 25 | 26 | # Suppress messages from ZKTableStateManager: Creates a large number of table 27 | # state change messages. 28 | log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKTableStateManager=ERROR 29 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/solr/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015-2016 YCSB contributors. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you 4 | # may not use this file except in compliance with the License. You 5 | # may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | # implied. See the License for the specific language governing 13 | # permissions and limitations under the License. See accompanying 14 | # LICENSE file. 15 | # 16 | 17 | # Root logger option 18 | log4j.rootLogger=INFO, stderr 19 | 20 | log4j.appender.stderr=org.apache.log4j.ConsoleAppender 21 | log4j.appender.stderr.target=System.err 22 | log4j.appender.stderr.layout=org.apache.log4j.PatternLayout 23 | log4j.appender.stderr.layout.conversionPattern=%d{yyyy/MM/dd HH:mm:ss} %-5p %c %x - %m%n 24 | 25 | # Suppress messages from ZooKeeper 26 | log4j.logger.org.apache.zookeeper=ERROR 27 | # Solr classes are too chatty in test at INFO 28 | log4j.logger.org.apache.solr=ERROR 29 | log4j.logger.org.eclipse.jetty=ERROR 30 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | PROJECT(Tiered-Storage) 3 | 4 | SET (CMAKE_CXX_COMPILER /usr/bin/clang++) 5 | 6 | SET(CMAKE_CXX_FLAGS_COMMON 7 | "-std=c++11 \ 8 | -stdlib=libc++") 9 | SET(CMAKE_CXX_FLAGS_DEBUG 10 | "${CMAKE_CXX_FLAGS_DEBUG} \ 11 | ${CMAKE_CXX_FLAGS_COMMON}") 12 | SET(CMAKE_CXX_FLAGS_RELEASE 13 | "${CMAKE_CXX_FLAGS_RELEASE} \ 14 | ${CMAKE_CXX_FLAGS_COMMON} \ 15 | -O3") 16 | 17 | list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/) 18 | 19 | ADD_SUBDIRECTORY(vendor/tbb) 20 | ADD_SUBDIRECTORY(vendor/boost) 21 | ADD_SUBDIRECTORY(vendor/googlebenchmark) 22 | ADD_SUBDIRECTORY(vendor/googletest) 23 | ADD_SUBDIRECTORY(vendor/zeromq) 24 | ADD_SUBDIRECTORY(vendor/zeromqcpp) 25 | 26 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 27 | INCLUDE_DIRECTORIES(.) 28 | INCLUDE_DIRECTORIES(include) 29 | INCLUDE_DIRECTORIES(${BOOST_INCLUDE_DIRS}) 30 | INCLUDE_DIRECTORIES(${GBENCH_INCLUDE_DIRS}) 31 | INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS}) 32 | INCLUDE_DIRECTORIES(${ZEROMQCPP_INCLUDE_DIRS}) 33 | INCLUDE_DIRECTORIES(${ZEROMQ_INCLUDE_DIRS}) 34 | INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIRS}) 35 | 36 | LINK_DIRECTORIES(${BOOST_LINK_DIRS}) 37 | LINK_DIRECTORIES(${ZEROMQ_LINK_DIRS}) 38 | LINK_DIRECTORIES(${TBB_LINK_DIRS}) 39 | 40 | ADD_SUBDIRECTORY(kvs) -------------------------------------------------------------------------------- /include/spdlog/formatter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "details/log_msg.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace spdlog 15 | { 16 | namespace details 17 | { 18 | class flag_formatter; 19 | } 20 | 21 | class formatter 22 | { 23 | public: 24 | virtual ~formatter() {} 25 | virtual void format(details::log_msg& msg) = 0; 26 | }; 27 | 28 | class pattern_formatter SPDLOG_FINAL : public formatter 29 | { 30 | 31 | public: 32 | explicit pattern_formatter(const std::string& pattern, pattern_time_type pattern_time = pattern_time_type::local); 33 | pattern_formatter(const pattern_formatter&) = delete; 34 | pattern_formatter& operator=(const pattern_formatter&) = delete; 35 | void format(details::log_msg& msg) override; 36 | private: 37 | const std::string _pattern; 38 | const pattern_time_type _pattern_time; 39 | std::vector> _formatters; 40 | std::tm get_time(details::log_msg& msg); 41 | void handle_flag(char flag); 42 | void compile_pattern(const std::string& pattern); 43 | }; 44 | } 45 | 46 | #include "details/pattern_formatter_impl.h" 47 | 48 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/asynchbase/src/test/resources/hbase-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | hbase.master.info.port 22 | -1 23 | The port for the hbase master web UI 24 | Set to -1 if you do not want the info server to run. 25 | 26 | 27 | 28 | hbase.regionserver.info.port 29 | -1 30 | The port for the hbase regionserver web UI 31 | Set to -1 if you do not want the info server to run. 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/hbase10/src/test/resources/hbase-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | hbase.master.info.port 22 | -1 23 | The port for the hbase master web UI 24 | Set to -1 if you do not want the info server to run. 25 | 26 | 27 | 28 | hbase.regionserver.info.port 29 | -1 30 | The port for the hbase regionserver web UI 31 | Set to -1 if you do not want the info server to run. 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /include/spdlog/sinks/base_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // base sink templated over a mutex (either dummy or real) 9 | // concrete implementation should only override the _sink_it method. 10 | // all locking is taken care of here so no locking needed by the implementers.. 11 | // 12 | 13 | #include "sink.h" 14 | #include "../formatter.h" 15 | #include "../common.h" 16 | #include "../details/log_msg.h" 17 | 18 | #include 19 | 20 | namespace spdlog 21 | { 22 | namespace sinks 23 | { 24 | template 25 | class base_sink:public sink 26 | { 27 | public: 28 | base_sink():_mutex() {} 29 | virtual ~base_sink() = default; 30 | 31 | base_sink(const base_sink&) = delete; 32 | base_sink& operator=(const base_sink&) = delete; 33 | 34 | void log(const details::log_msg& msg) SPDLOG_FINAL override 35 | { 36 | std::lock_guard lock(_mutex); 37 | _sink_it(msg); 38 | } 39 | void flush() SPDLOG_FINAL override 40 | { 41 | std::lock_guard lock(_mutex); 42 | _flush(); 43 | } 44 | 45 | protected: 46 | virtual void _sink_it(const details::log_msg& msg) = 0; 47 | virtual void _flush() = 0; 48 | Mutex _mutex; 49 | }; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/voldemort/src/main/resources/config/server.properties: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 YCSB contributors. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you 4 | # may not use this file except in compliance with the License. You 5 | # may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | # implied. See the License for the specific language governing 13 | # permissions and limitations under the License. See accompanying 14 | # LICENSE file. 15 | 16 | # The ID of *this* particular cluster node 17 | node.id=0 18 | 19 | max.threads=100 20 | 21 | ############### DB options ###################### 22 | 23 | http.enable=true 24 | socket.enable=true 25 | 26 | # BDB 27 | bdb.write.transactions=false 28 | bdb.flush.transactions=false 29 | bdb.cache.size=1G 30 | 31 | # Mysql 32 | mysql.host=localhost 33 | mysql.port=1521 34 | mysql.user=root 35 | mysql.password=3306 36 | mysql.database=test 37 | 38 | #NIO connector settings. 39 | enable.nio.connector=true 40 | 41 | storage.configs=voldemort.store.bdb.BdbStorageConfiguration, voldemort.store.readonly.ReadOnlyStorageConfiguration 42 | -------------------------------------------------------------------------------- /kvs/include/zmq_util.h: -------------------------------------------------------------------------------- 1 | #ifndef ZMQ_UTIL_H_ 2 | #define ZMQ_UTIL_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "zmq.hpp" 11 | 12 | namespace zmq_util { 13 | 14 | // Converts the data within a `zmq::message_t` into a string. 15 | std::string message_to_string(const zmq::message_t& message); 16 | 17 | // Converts a string into a `zmq::message_t`. 18 | zmq::message_t string_to_message(const std::string& s); 19 | 20 | // `send` a string over the socket. 21 | void send_string(const std::string& s, zmq::socket_t* socket); 22 | 23 | // `recv` a string over the socket. 24 | std::string recv_string(zmq::socket_t* socket); 25 | 26 | // `send` a single message. 27 | void send_msg(void* payload, zmq::socket_t* socket); 28 | 29 | // `recv` a single message. 30 | void recv_msg(zmq::socket_t* socket, zmq::message_t& msg); 31 | 32 | // `send` a multipart message. 33 | void send_msgs(std::vector msgs, zmq::socket_t* socket); 34 | 35 | // `recv` a multipart message. 36 | bool recv_msgs(zmq::socket_t* socket, std::vector& msgs); 37 | 38 | // `poll` is a wrapper around `zmq::poll` that takes a vector instead of a 39 | // pointer and a size. 40 | int poll(long timeout, std::vector* items); 41 | 42 | } // namespace zmq_util 43 | 44 | #endif // ZMQ_UTIL_H_ 45 | -------------------------------------------------------------------------------- /kvs/include/versioned_kvs.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "base_kvs.h" 4 | 5 | // Lattice for implementing causally ordered eventual consistency 6 | 7 | template 8 | struct version_value_pair { 9 | MapLattice> v_map; 10 | T value; 11 | 12 | version_value_pair() { 13 | v_map = MapLattice>(); 14 | value = T(); 15 | } 16 | // need this because of static cast 17 | version_value_pair(int a) { 18 | v_map = MapLattice>(); 19 | value = T(); 20 | } 21 | version_value_pair(MapLattice> m, T v) { 22 | v_map = m; 23 | value = v; 24 | } 25 | }; 26 | 27 | template 28 | class KVS_PairLattice : public Lattice> { 29 | protected: 30 | void do_merge(const version_value_pair &p) { 31 | MapLattice> prev = this->element.v_map; 32 | this->element.v_map.merge(p.v_map); 33 | 34 | if (this->element.v_map == prev); 35 | else if (this->element.v_map == p.v_map) { 36 | this->element.value.assign(p.value); 37 | } 38 | else { 39 | this->element.value.merge(p.value); 40 | } 41 | } 42 | public: 43 | KVS_PairLattice() : Lattice>() {} 44 | KVS_PairLattice(const version_value_pair &p) : Lattice>(p) {} 45 | }; -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/mongodb/src/main/java/com/yahoo/ycsb/db/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | /** 19 | * The YCSB binding for MongoDB. 20 | * For additional details on using and configuring the binding see the 21 | * accompanying README.md. 24 | *

25 | * A YCSB binding is provided for both the the 26 | * Asynchronous 27 | * Java Driver and the MongoDB Inc. 28 | * driver. 29 | *

30 | */ 31 | package com.yahoo.ycsb.db; 32 | 33 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/core/src/test/java/com/yahoo/ycsb/generator/TestZipfianGenerator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | package com.yahoo.ycsb.generator; 19 | 20 | import org.testng.annotations.Test; 21 | 22 | import static org.testng.AssertJUnit.assertFalse; 23 | 24 | 25 | public class TestZipfianGenerator { 26 | @Test 27 | public void testMinAndMaxParameter() { 28 | long min = 5; 29 | long max = 10; 30 | ZipfianGenerator zipfian = new ZipfianGenerator(min, max); 31 | 32 | for (int i = 0; i < 10000; i++) { 33 | long rnd = zipfian.nextValue(); 34 | assertFalse(rnd < min); 35 | assertFalse(rnd > max); 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /kvs/include/server_utility.h: -------------------------------------------------------------------------------- 1 | #ifndef __SERVER_UTILITY_H__ 2 | #define __SERVER_UTILITY_H__ 3 | 4 | #include 5 | #include "message.pb.h" 6 | #include "socket_cache.h" 7 | #include "zmq_util.h" 8 | 9 | using namespace std; 10 | 11 | // Define the gossip period (frequency) 12 | #define PERIOD 10000000 13 | 14 | typedef KV_Store> Database; 15 | 16 | // a map that represents which keys should be sent to which IP-port combinations 17 | typedef unordered_map> address_keyset_map; 18 | 19 | class Serializer { 20 | Database* kvs_; 21 | public: 22 | Serializer(Database* kvs): kvs_(kvs) {} 23 | LWW_KVS_PairLattice get(const string& key, unsigned& err_number) { 24 | return kvs_->get(key, err_number); 25 | } 26 | bool put(const string& key, const string& value, const unsigned& timestamp) { 27 | timestamp_value_pair p = timestamp_value_pair(timestamp, value); 28 | return kvs_->put(key, LWW_KVS_PairLattice(p)); 29 | } 30 | void remove(const string& key) { 31 | kvs_->remove(key); 32 | } 33 | }; 34 | 35 | // form the timestamp given a time and a thread id 36 | unsigned long long generate_timestamp(unsigned long long time, unsigned tid) { 37 | unsigned pow = 10; 38 | while(tid >= pow) 39 | pow *= 10; 40 | return time * pow + tid; 41 | } 42 | 43 | #endif -------------------------------------------------------------------------------- /include/spdlog/fmt/bundled/LICENSE.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2016, Victor Zverovich 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/core/src/test/java/com/yahoo/ycsb/TestByteIterator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2012 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | package com.yahoo.ycsb; 19 | 20 | import org.testng.annotations.Test; 21 | import static org.testng.AssertJUnit.*; 22 | 23 | public class TestByteIterator { 24 | @Test 25 | public void testRandomByteIterator() { 26 | int size = 100; 27 | ByteIterator itor = new RandomByteIterator(size); 28 | assertTrue(itor.hasNext()); 29 | assertEquals(size, itor.bytesLeft()); 30 | assertEquals(size, itor.toString().getBytes().length); 31 | assertFalse(itor.hasNext()); 32 | assertEquals(0, itor.bytesLeft()); 33 | 34 | itor = new RandomByteIterator(size); 35 | assertEquals(size, itor.toArray().length); 36 | assertFalse(itor.hasNext()); 37 | assertEquals(0, itor.bytesLeft()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | vendor/gtest/build 3 | vendor/gbenchmark/build 4 | conf 5 | 6 | # ignore compiled byte code 7 | target 8 | 9 | # ignore output files from testing 10 | output* 11 | 12 | # ignore standard Eclipse files 13 | .project 14 | .classpath 15 | .settings 16 | .checkstyle 17 | 18 | # ignore standard IntelliJ files 19 | .idea/ 20 | *.iml 21 | *.iws 22 | 23 | # ignore standard Vim and Emacs temp files 24 | *.swp 25 | *~ 26 | 27 | # ignore standard Mac OS X files/dirs 28 | .DS_Store 29 | 30 | ################################################################################ 31 | # vim 32 | ################################################################################ 33 | # swap 34 | [._]*.s[a-w][a-z] 35 | [._]s[a-w][a-z] 36 | # session 37 | Session.vim 38 | # temporary 39 | .netrwhist 40 | *~ 41 | # auto-generated tag files 42 | tags 43 | # syntastic 44 | .syntastic_clang_tidy_config 45 | .syntastic_cpp_config 46 | 47 | ################################################################################ 48 | # C++ 49 | ################################################################################ 50 | # Prerequisites 51 | *.d 52 | 53 | # Compiled Object files 54 | *.slo 55 | *.lo 56 | *.o 57 | *.obj 58 | 59 | # Precompiled Headers 60 | *.gch 61 | *.pch 62 | 63 | # Compiled Dynamic libraries 64 | *.so 65 | *.dylib 66 | *.dll 67 | 68 | # Fortran module files 69 | *.mod 70 | *.smod 71 | 72 | # Compiled Static libraries 73 | *.lai 74 | *.la 75 | *.a 76 | *.lib 77 | 78 | # Executables 79 | *.exe 80 | *.out 81 | *.app 82 | -------------------------------------------------------------------------------- /kvs/kvs_benchmark_trigger.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "socket_cache.h" 12 | #include "zmq_util.h" 13 | #include "common.h" 14 | 15 | using namespace std; 16 | 17 | int main(int argc, char* argv[]) { 18 | if (argc != 2) { 19 | cerr << "usage:" << argv[0] << " " << endl; 20 | return 1; 21 | } 22 | 23 | unsigned thread_num = atoi(argv[1]); 24 | 25 | // read in the benchmark addresses 26 | vector benchmark_address; 27 | 28 | // read benchmark address from the file 29 | string ip_line; 30 | ifstream address; 31 | address.open("conf/user/benchmark_address.txt"); 32 | getline(address, ip_line); 33 | address.close(); 34 | vector ips; 35 | split(ip_line, ' ', ips); 36 | for (auto it = ips.begin(); it != ips.end(); it++) { 37 | benchmark_address.push_back(*it); 38 | } 39 | 40 | zmq::context_t context(1); 41 | SocketCache pushers(&context, ZMQ_PUSH); 42 | 43 | string command; 44 | while (true) { 45 | cout << "command> "; 46 | getline(cin, command); 47 | 48 | for (auto it = benchmark_address.begin(); it != benchmark_address.end(); it++) { 49 | for (unsigned tid = 0; tid < thread_num; tid++) { 50 | zmq_util::send_string(command, &pushers["tcp://" + *it + ":" + to_string(tid + COMMAND_BASE_PORT)]); 51 | } 52 | } 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /kvs/include/socket_cache.h: -------------------------------------------------------------------------------- 1 | #ifndef SOCKET_CACHE_H_ 2 | #define SOCKET_CACHE_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "zmq.hpp" 8 | 9 | 10 | // A SocketCache is a map from ZeroMQ addresses to PUSH ZeroMQ sockets. The 11 | // socket corresponding to address `address` can be retrieved from a 12 | // SocketCache `cache` with `cache[address]` or `cache.At(address)`. If a 13 | // socket with a given address is not in the cache when it is requested, one is 14 | // created and connected to the address. An example: 15 | // 16 | // zmq::context_t context(1); 17 | // SocketCache cache(&context); 18 | // // This will create a socket and connect it to "inproc://a". 19 | // zmq::socket_t& a = cache["inproc://a"]; 20 | // // This will not createa new socket. It will return the socket created in 21 | // // the previous line. In other words, a and the_same_a_as_before are 22 | // // references to the same socket. 23 | // zmq::socket_t& the_same_a_as_before = cache["inproc://a"]; 24 | // // cache.At("inproc://a") is 100% equivalent to cache["inproc://a"]. 25 | // zmq::socket_t& another_a = cache.At("inproc://a"); 26 | class SocketCache { 27 | public: 28 | explicit SocketCache(zmq::context_t* context, int type) : context_(context), type_(type) {} 29 | zmq::socket_t& At(const std::string& addr); 30 | zmq::socket_t& operator[](const std::string& addr); 31 | void clear_cache(); 32 | 33 | private: 34 | zmq::context_t* context_; 35 | std::map cache_; 36 | int type_; 37 | }; 38 | 39 | 40 | #endif // SOCKET_CACHE_H_ 41 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/infinispan/src/main/java/com/yahoo/ycsb/db/RemoteCacheManagerHolder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-2016 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | package com.yahoo.ycsb.db; 19 | 20 | import java.util.Properties; 21 | 22 | import org.infinispan.client.hotrod.RemoteCacheManager; 23 | 24 | /** 25 | * Utility class to ensure only a single RemoteCacheManager is created. 26 | */ 27 | final class RemoteCacheManagerHolder { 28 | 29 | private static volatile RemoteCacheManager cacheManager = null; 30 | 31 | private RemoteCacheManagerHolder() { 32 | } 33 | 34 | static RemoteCacheManager getInstance(Properties props) { 35 | RemoteCacheManager result = cacheManager; 36 | if (result == null) { 37 | synchronized (RemoteCacheManagerHolder.class) { 38 | result = cacheManager; 39 | if (result == null) { 40 | result = new RemoteCacheManager(props); 41 | cacheManager = new RemoteCacheManager(props); 42 | } 43 | } 44 | } 45 | return result; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /kvs/include/rc_kvs.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "base_kvs.h" 4 | 5 | // Lattice for implementing read (un)committed and item-cut isolation 6 | 7 | template 8 | struct timestamp_value_pair { 9 | // MapLattice> v_map; 10 | int timestamp {-1}; 11 | T value; 12 | 13 | timestamp_value_pair() { 14 | timestamp = -1; 15 | value = T(); 16 | } 17 | // need this because of static cast 18 | timestamp_value_pair(int a) { 19 | timestamp = -1; 20 | value = T(); 21 | } 22 | timestamp_value_pair(int ts, T v) { 23 | timestamp = ts; 24 | value = v; 25 | } 26 | }; 27 | 28 | template 29 | class RC_KVS_PairLattice : public Lattice> { 30 | protected: 31 | void do_merge(const timestamp_value_pair &p) { 32 | if (p.timestamp >= this -> element.timestamp) { 33 | this -> element.timestamp = p.timestamp; 34 | this -> element.value = p.value; 35 | } 36 | } 37 | public: 38 | RC_KVS_PairLattice() : Lattice>() {} 39 | RC_KVS_PairLattice(const timestamp_value_pair &p) : Lattice>(p) {} 40 | 41 | // this Merge is specific to lww lattice 42 | // return true if the new value replaced the old value 43 | // return false otherwise 44 | bool Merge(const timestamp_value_pair& p) { 45 | if (p.timestamp >= this -> element.timestamp) { 46 | this -> element.timestamp = p.timestamp; 47 | this -> element.value = p.value; 48 | return true; 49 | } else { 50 | return false; 51 | } 52 | } 53 | 54 | bool Merge(const RC_KVS_PairLattice& pl) { 55 | return Merge(pl.reveal()); 56 | } 57 | }; -------------------------------------------------------------------------------- /kvs/include/lww_kvs.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "base_kvs.h" 4 | 5 | // Lattice for implementing last-writer-win consistency level 6 | 7 | template 8 | struct timestamp_value_pair { 9 | // MapLattice> v_map; 10 | int timestamp {-1}; 11 | T value; 12 | 13 | timestamp_value_pair() { 14 | timestamp = -1; 15 | value = T(); 16 | } 17 | // need this because of static cast 18 | timestamp_value_pair(int a) { 19 | timestamp = -1; 20 | value = T(); 21 | } 22 | timestamp_value_pair(int ts, T v) { 23 | timestamp = ts; 24 | value = v; 25 | } 26 | }; 27 | 28 | template 29 | class LWW_KVS_PairLattice : public Lattice> { 30 | protected: 31 | void do_merge(const timestamp_value_pair &p) { 32 | if (p.timestamp >= this -> element.timestamp) { 33 | this -> element.timestamp = p.timestamp; 34 | this -> element.value = p.value; 35 | } 36 | } 37 | public: 38 | LWW_KVS_PairLattice() : Lattice>() {} 39 | LWW_KVS_PairLattice(const timestamp_value_pair &p) : Lattice>(p) {} 40 | 41 | // this Merge is specific to lww lattice 42 | // return true if the new value replaced the old value 43 | // return false otherwise 44 | bool Merge(const timestamp_value_pair& p) { 45 | if (p.timestamp >= this -> element.timestamp) { 46 | this -> element.timestamp = p.timestamp; 47 | this -> element.value = p.value; 48 | return true; 49 | } else { 50 | return false; 51 | } 52 | } 53 | 54 | bool Merge(const LWW_KVS_PairLattice& pl) { 55 | return Merge(pl.reveal()); 56 | } 57 | }; -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/redis/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | ## Quick Start 19 | 20 | This section describes how to run YCSB on Redis. 21 | 22 | ### 1. Start Redis 23 | 24 | ### 2. Install Java and Maven 25 | 26 | ### 3. Set Up YCSB 27 | 28 | Git clone YCSB and compile: 29 | 30 | git clone http://github.com/brianfrankcooper/YCSB.git 31 | cd YCSB 32 | mvn -pl com.yahoo.ycsb:redis-binding -am clean package 33 | 34 | ### 4. Provide Redis Connection Parameters 35 | 36 | Set the host, port, and password (do not redis auth is not turned on) in the 37 | workload you plan to run. 38 | 39 | - `redis.host` 40 | - `redis.port` 41 | - `redis.password` 42 | 43 | Or, you can set configs with the shell command, EG: 44 | 45 | ./bin/ycsb load redis -s -P workloads/workloada -p "redis.host=127.0.0.1" -p "redis.port=6379" > outputLoad.txt 46 | 47 | ### 5. Load data and run tests 48 | 49 | Load the data: 50 | 51 | ./bin/ycsb load redis -s -P workloads/workloada > outputLoad.txt 52 | 53 | Run the workload test: 54 | 55 | ./bin/ycsb run redis -s -P workloads/workloada > outputRun.txt 56 | 57 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/binding-parent/datastore-specific-descriptor/pom.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 4.0.0 20 | 21 | 22 | com.yahoo.ycsb 23 | root 24 | 0.11.0-SNAPSHOT 25 | ../../ 26 | 27 | 28 | datastore-specific-descriptor 29 | Per Datastore Binding descriptor 30 | jar 31 | 32 | 33 | This module contains the assembly descriptor used by the individual components 34 | to build binding-specific distributions. 35 | 36 | 37 | 38 | com.yahoo.ycsb 39 | core 40 | ${project.version} 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/redis/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | redis-binding 29 | Redis DB Binding 30 | jar 31 | 32 | 33 | 34 | redis.clients 35 | jedis 36 | ${redis.version} 37 | 38 | 39 | com.yahoo.ycsb 40 | core 41 | ${project.version} 42 | provided 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/solr/src/test/java/com/yahoo/ycsb/db/SolrClientCloudTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016 YCSB contributors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | package com.yahoo.ycsb.db; 18 | 19 | import com.yahoo.ycsb.DB; 20 | import org.junit.After; 21 | 22 | import java.util.Properties; 23 | 24 | import static org.junit.Assume.assumeNoException; 25 | 26 | public class SolrClientCloudTest extends SolrClientBaseTest { 27 | 28 | private SolrClient instance; 29 | 30 | @After 31 | public void tearDown() throws Exception { 32 | try { 33 | if(instance != null) { 34 | instance.cleanup(); 35 | } 36 | } finally { 37 | super.tearDown(); 38 | } 39 | } 40 | 41 | @Override 42 | protected DB getDB(Properties props) { 43 | instance = new SolrClient(); 44 | 45 | props.setProperty("solr.cloud", "true"); 46 | props.setProperty("solr.zookeeper.hosts", miniSolrCloudCluster.getSolrClient().getZkHost()); 47 | 48 | instance.setProperties(props); 49 | try { 50 | instance.init(); 51 | } catch (Exception error) { 52 | assumeNoException(error); 53 | } 54 | return instance; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/aerospike/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | aerospike-binding 29 | Aerospike DB Binding 30 | jar 31 | 32 | 33 | 34 | com.aerospike 35 | aerospike-client 36 | ${aerospike.version} 37 | 38 | 39 | com.yahoo.ycsb 40 | core 41 | ${project.version} 42 | provided 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/nosqldb/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | nosqldb-binding 29 | Oracle NoSQL Database Binding 30 | jar 31 | 32 | 33 | 34 | com.oracle.kv 35 | oracle-nosql-client 36 | 3.0.5 37 | 38 | 39 | com.yahoo.ycsb 40 | core 41 | ${project.version} 42 | provided 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/s3/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 4.0.0 19 | 20 | com.yahoo.ycsb 21 | binding-parent 22 | 0.11.0-SNAPSHOT 23 | ../binding-parent 24 | 25 | 26 | s3-binding 27 | S3 Storage Binding 28 | jar 29 | 30 | 31 | 32 | com.amazonaws 33 | aws-java-sdk-s3 34 | ${s3.version} 35 | 36 | 37 | 38 | com.yahoo.ycsb 39 | core 40 | ${project.version} 41 | provided 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /kvs/include/zmq_util.cc: -------------------------------------------------------------------------------- 1 | #include "zmq_util.h" 2 | 3 | #include 4 | #include 5 | 6 | namespace zmq_util { 7 | 8 | std::string message_to_string(const zmq::message_t& message) { 9 | return std::string(static_cast(message.data()), message.size()); 10 | } 11 | 12 | zmq::message_t string_to_message(const std::string& s) { 13 | zmq::message_t msg(s.size()); 14 | memcpy(msg.data(), s.c_str(), s.size()); 15 | return msg; 16 | } 17 | 18 | void send_string(const std::string& s, zmq::socket_t* socket) { 19 | socket->send(string_to_message(s)); 20 | } 21 | 22 | std::string recv_string(zmq::socket_t* socket) { 23 | zmq::message_t message; 24 | socket->recv(&message); 25 | return message_to_string(message); 26 | } 27 | 28 | void send_msg(void* payload, zmq::socket_t* socket) { 29 | zmq::message_t msg(sizeof(void*)); 30 | memcpy(msg.data(), &payload, sizeof(void*)); 31 | socket->send(msg); 32 | } 33 | 34 | void recv_msg(zmq::socket_t* socket, zmq::message_t& msg) { 35 | socket->recv(&msg); 36 | } 37 | 38 | void send_msgs(std::vector msgs, zmq::socket_t* socket) { 39 | for (std::size_t i = 0; i < msgs.size(); ++i) { 40 | socket->send(msgs[i], i == msgs.size() - 1 ? 0 : ZMQ_SNDMORE); 41 | } 42 | } 43 | 44 | bool recv_msgs(zmq::socket_t* socket, std::vector& msgs) { 45 | bool res; 46 | int more = true; 47 | std::size_t more_size = sizeof(more); 48 | while (more) { 49 | msgs.emplace_back(); 50 | if ((res = socket->recv(&msgs.back(), ZMQ_DONTWAIT)) == false) return false; 51 | socket->getsockopt(ZMQ_RCVMORE, static_cast(&more), &more_size); 52 | } 53 | return true; 54 | } 55 | 56 | int poll(long timeout, std::vector* items) { 57 | return zmq::poll(items->data(), items->size(), timeout); 58 | } 59 | 60 | } // namespace zmq_util 61 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/googlebigtable/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent/ 26 | 27 | 28 | googlebigtable-binding 29 | Google Cloud Bigtable Binding 30 | jar 31 | 32 | 33 | 34 | com.google.cloud.bigtable 35 | bigtable-hbase-1.0 36 | ${googlebigtable.version} 37 | 38 | 39 | 40 | com.yahoo.ycsb 41 | core 42 | ${project.version} 43 | provided 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /include/spdlog/sinks/dist_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 David Schury, Gabi Melman 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "../details/log_msg.h" 9 | #include "../details/null_mutex.h" 10 | #include "base_sink.h" 11 | #include "sink.h" 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | // Distribution sink (mux). Stores a vector of sinks which get called when log is called 19 | 20 | namespace spdlog 21 | { 22 | namespace sinks 23 | { 24 | template 25 | class dist_sink: public base_sink 26 | { 27 | public: 28 | explicit dist_sink() :_sinks() {} 29 | dist_sink(const dist_sink&) = delete; 30 | dist_sink& operator=(const dist_sink&) = delete; 31 | virtual ~dist_sink() = default; 32 | 33 | protected: 34 | std::vector> _sinks; 35 | 36 | void _sink_it(const details::log_msg& msg) override 37 | { 38 | for (auto &sink : _sinks) 39 | { 40 | if( sink->should_log( msg.level)) 41 | { 42 | sink->log(msg); 43 | } 44 | } 45 | } 46 | 47 | void _flush() override 48 | { 49 | for (auto &sink : _sinks) 50 | sink->flush(); 51 | } 52 | 53 | public: 54 | 55 | 56 | void add_sink(std::shared_ptr sink) 57 | { 58 | std::lock_guard lock(base_sink::_mutex); 59 | _sinks.push_back(sink); 60 | } 61 | 62 | void remove_sink(std::shared_ptr sink) 63 | { 64 | std::lock_guard lock(base_sink::_mutex); 65 | _sinks.erase(std::remove(_sinks.begin(), _sinks.end(), sink), _sinks.end()); 66 | } 67 | }; 68 | 69 | typedef dist_sink dist_sink_mt; 70 | typedef dist_sink dist_sink_st; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/hbase098/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent/ 26 | 27 | 28 | hbase098-binding 29 | HBase 0.98.x DB Binding 30 | 31 | 32 | false 33 | 34 | 35 | 36 | 37 | org.apache.hbase 38 | hbase-client 39 | ${hbase098.version} 40 | 41 | 42 | com.yahoo.ycsb 43 | core 44 | ${project.version} 45 | provided 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /kvs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.6) 2 | 3 | INCLUDE_DIRECTORIES(include) 4 | 5 | # Generate protocol buffers. 6 | INCLUDE(FindProtobuf) 7 | FIND_PACKAGE(Protobuf REQUIRED) 8 | INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) 9 | PROTOBUF_GENERATE_CPP(PROTO_SRC PROTO_HEADER message.proto) 10 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | # The library dependencies of the key value store clients and servers. 13 | SET(KV_LIBRARY_DEPENDENCIES 14 | protobuf 15 | pthread 16 | zmq 17 | ) 18 | 19 | # The source dependencies of the key value store clients and servers. 20 | SET(KV_SRC_DEPENDENCIES 21 | ${PROTO_SRC} 22 | ${PROTO_HEADER} 23 | ) 24 | 25 | ADD_EXECUTABLE(kvs_user kvs_user.cpp ${KV_SRC_DEPENDENCIES} include/zmq_util.cc include/zmq_util.h include/socket_cache.cc include/socket_cache.h) 26 | TARGET_LINK_LIBRARIES(kvs_user ${KV_LIBRARY_DEPENDENCIES}) 27 | 28 | ADD_EXECUTABLE(kvs_benchmark kvs_benchmark.cpp ${KV_SRC_DEPENDENCIES} include/zmq_util.cc include/zmq_util.h include/socket_cache.cc include/socket_cache.h) 29 | TARGET_LINK_LIBRARIES(kvs_benchmark ${KV_LIBRARY_DEPENDENCIES}) 30 | 31 | ADD_EXECUTABLE(kvs_benchmark_trigger kvs_benchmark_trigger.cpp ${KV_SRC_DEPENDENCIES} include/zmq_util.cc include/zmq_util.h include/socket_cache.cc include/socket_cache.h) 32 | TARGET_LINK_LIBRARIES(kvs_benchmark_trigger ${KV_LIBRARY_DEPENDENCIES}) 33 | 34 | ADD_EXECUTABLE(kvs_proxy kvs_proxy.cpp ${KV_SRC_DEPENDENCIES} include/zmq_util.cc include/zmq_util.h include/socket_cache.cc include/socket_cache.h) 35 | TARGET_LINK_LIBRARIES(kvs_proxy ${KV_LIBRARY_DEPENDENCIES} ${TBB_LIBRARIES} ${BOOST_SYSTEM_LIBRARIES} ${BOOST_THREAD_LIBRARIES}) 36 | 37 | ADD_EXECUTABLE(kvs_server kvs_server.cpp ${KV_SRC_DEPENDENCIES} include/zmq_util.cc include/zmq_util.h include/socket_cache.cc include/socket_cache.h) 38 | TARGET_LINK_LIBRARIES(kvs_server ${KV_LIBRARY_DEPENDENCIES} ${TBB_LIBRARIES}) -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/couchbase2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 22 | 4.0.0 23 | 24 | com.yahoo.ycsb 25 | binding-parent 26 | 0.11.0-SNAPSHOT 27 | ../binding-parent 28 | 29 | 30 | couchbase2-binding 31 | Couchbase Java SDK 2.x Binding 32 | jar 33 | 34 | 35 | 36 | com.couchbase.client 37 | java-client 38 | ${couchbase2.version} 39 | 40 | 41 | com.yahoo.ycsb 42 | core 43 | ${project.version} 44 | provided 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /include/spdlog/sinks/stdout_sinks.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "../details/null_mutex.h" 9 | #include "base_sink.h" 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace spdlog 16 | { 17 | namespace sinks 18 | { 19 | 20 | template 21 | class stdout_sink SPDLOG_FINAL : public base_sink 22 | { 23 | using MyType = stdout_sink; 24 | public: 25 | stdout_sink() 26 | {} 27 | static std::shared_ptr instance() 28 | { 29 | static std::shared_ptr instance = std::make_shared(); 30 | return instance; 31 | } 32 | protected: 33 | void _sink_it(const details::log_msg& msg) override 34 | { 35 | fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), stdout); 36 | _flush(); 37 | } 38 | 39 | void _flush() override 40 | { 41 | fflush(stdout); 42 | } 43 | }; 44 | 45 | typedef stdout_sink stdout_sink_st; 46 | typedef stdout_sink stdout_sink_mt; 47 | 48 | 49 | template 50 | class stderr_sink SPDLOG_FINAL : public base_sink 51 | { 52 | using MyType = stderr_sink; 53 | public: 54 | stderr_sink() 55 | {} 56 | static std::shared_ptr instance() 57 | { 58 | static std::shared_ptr instance = std::make_shared(); 59 | return instance; 60 | } 61 | protected: 62 | void _sink_it(const details::log_msg& msg) override 63 | { 64 | fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), stderr); 65 | _flush(); 66 | } 67 | 68 | void _flush() override 69 | { 70 | fflush(stderr); 71 | } 72 | }; 73 | 74 | typedef stderr_sink stderr_sink_mt; 75 | typedef stderr_sink stderr_sink_st; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/voldemort/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 4.0.0 22 | 23 | com.yahoo.ycsb 24 | binding-parent 25 | 0.11.0-SNAPSHOT 26 | ../binding-parent 27 | 28 | 29 | voldemort-binding 30 | Voldemort DB Binding 31 | jar 32 | 33 | 34 | 35 | voldemort 36 | voldemort 37 | ${voldemort.version} 38 | 39 | 40 | log4j 41 | log4j 42 | 1.2.16 43 | 44 | 45 | com.yahoo.ycsb 46 | core 47 | ${project.version} 48 | provided 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/mapkeeper/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | mapkeeper-binding 29 | Mapkeeper DB Binding 30 | jar 31 | 32 | 33 | 34 | com.yahoo.mapkeeper 35 | mapkeeper 36 | ${mapkeeper.version} 37 | 38 | 39 | com.yahoo.ycsb 40 | core 41 | ${project.version} 42 | provided 43 | 44 | 45 | 46 | 47 | mapkeeper-releases 48 | https://raw.github.com/m1ch1/m1ch1-mvn-repo/master/releases 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/googledatastore/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | googledatastore-binding 29 | Google Cloud Datastore Binding 30 | https://github.com/GoogleCloudPlatform/google-cloud-datastore 31 | 32 | 33 | 34 | com.google.cloud.datastore 35 | datastore-v1beta3-proto-client 36 | 1.0.0-beta.1 37 | 38 | 39 | log4j 40 | log4j 41 | 1.2.17 42 | 43 | 44 | com.yahoo.ycsb 45 | core 46 | ${project.version} 47 | provided 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/cassandra/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | cassandra-binding 29 | Cassandra DB Binding 30 | jar 31 | 32 | 33 | 34 | org.apache.cassandra 35 | cassandra-all 36 | ${cassandra.version} 37 | 38 | 39 | 40 | com.datastax.cassandra 41 | cassandra-driver-core 42 | ${cassandra.cql.version} 43 | 44 | 45 | com.yahoo.ycsb 46 | core 47 | ${project.version} 48 | provided 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/mongodb/src/test/java/com/yahoo/ycsb/db/MongoDbClientTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | package com.yahoo.ycsb.db; 18 | 19 | import static org.junit.Assume.assumeNoException; 20 | 21 | import java.util.Properties; 22 | 23 | import org.junit.After; 24 | 25 | import com.yahoo.ycsb.DB; 26 | 27 | /** 28 | * MongoDbClientTest provides runs the basic workload operations. 29 | */ 30 | public class MongoDbClientTest extends AbstractDBTestCases { 31 | 32 | /** The client to use. */ 33 | private DB myClient = null; 34 | 35 | protected DB instantiateClient() { 36 | return new MongoDbClient(); 37 | } 38 | 39 | /** 40 | * Stops the test client. 41 | */ 42 | @After 43 | public void tearDown() { 44 | try { 45 | myClient.cleanup(); 46 | } catch (Exception error) { 47 | // Ignore. 48 | } finally { 49 | myClient = null; 50 | } 51 | } 52 | 53 | /** 54 | * {@inheritDoc} 55 | *

56 | * Overridden to return the {@link MongoDbClient}. 57 | *

58 | */ 59 | @Override 60 | protected DB getDB(Properties props) { 61 | if( myClient == null ) { 62 | myClient = instantiateClient(); 63 | myClient.setProperties(props); 64 | try { 65 | myClient.init(); 66 | } catch (Exception error) { 67 | assumeNoException(error); 68 | } 69 | } 70 | return myClient; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/aerospike/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | ## Quick Start 19 | 20 | This section describes how to run YCSB on Aerospike. 21 | 22 | ### 1. Start Aerospike 23 | 24 | ### 2. Install Java and Maven 25 | 26 | ### 3. Set Up YCSB 27 | 28 | Git clone YCSB and compile: 29 | 30 | git clone http://github.com/brianfrankcooper/YCSB.git 31 | cd YCSB 32 | mvn -pl com.yahoo.ycsb:aerospike-binding -am clean package 33 | 34 | ### 4. Provide Aerospike Connection Parameters 35 | 36 | The following connection parameters are available. 37 | 38 | * `as.host` - The Aerospike cluster to connect to (default: `localhost`) 39 | * `as.port` - The port to connect to (default: `3000`) 40 | * `as.user` - The user to connect as (no default) 41 | * `as.password` - The password for the user (no default) 42 | * `as.timeout` - The transaction and connection timeout (in ms, default: `10000`) 43 | * `as.namespace` - The namespace to be used for the benchmark (default: `ycsb`) 44 | 45 | Add them to the workload or set them with the shell command, as in: 46 | 47 | ./bin/ycsb load aerospike -s -P workloads/workloada -p as.timeout=5000 >outputLoad.txt 48 | 49 | ### 5. Load Data and Run Tests 50 | 51 | Load the data: 52 | 53 | ./bin/ycsb load aerospike -s -P workloads/workloada >outputLoad.txt 54 | 55 | Run the workload test: 56 | 57 | ./bin/ycsb run aerospike -s -P workloads/workloada >outputRun.txt 58 | 59 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/solr/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 4.0.0 23 | 24 | com.yahoo.ycsb 25 | binding-parent 26 | 0.11.0-SNAPSHOT 27 | ../binding-parent 28 | 29 | 30 | solr-binding 31 | Solr Binding 32 | jar 33 | 34 | 35 | 36 | com.yahoo.ycsb 37 | core 38 | ${project.version} 39 | provided 40 | 41 | 42 | org.apache.solr 43 | solr-solrj 44 | ${solr.version} 45 | 46 | 47 | org.slf4j 48 | slf4j-log4j12 49 | 1.7.10 50 | 51 | 52 | 53 | org.apache.solr 54 | solr-test-framework 55 | ${solr.version} 56 | test 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/infinispan/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | ## Quick Start 19 | 20 | This section describes how to run YCSB on infinispan. 21 | 22 | ### 1. Install Java and Maven 23 | 24 | ### 2. Set Up YCSB 25 | 1. Git clone YCSB and compile: 26 | ``` 27 | git clone http://github.com/brianfrankcooper/YCSB.git 28 | cd YCSB 29 | mvn clean package 30 | ``` 31 | 32 | 2. Copy and untar YCSB distribution in distribution/target/ycsb-x.x.x.tar.gz to target machine 33 | 34 | ### 4. Load data and run tests 35 | ####4.1 embedded mode with cluster or not 36 | Load the data: 37 | ``` 38 | ./bin/ycsb load infinispan -P workloads/workloada -p infinispan.clustered= 39 | ``` 40 | Run the workload test: 41 | ``` 42 | ./bin/ycsb run infinispan -s -P workloads/workloada -p infinispan.clustered= 43 | ``` 44 | ####4.2 client-server mode 45 | 46 | 1. start infinispan server 47 | 48 | 2. read [RemoteCacheManager](http://docs.jboss.org/infinispan/7.2/apidocs/org/infinispan/client/hotrod/RemoteCacheManager.html) doc and customize hotrod client properties in infinispan-binding/conf/remote-cache.properties 49 | 50 | 3. Load the data with specified cache: 51 | ``` 52 | ./bin/ycsb load infinispan-cs -s -P workloads/workloada -P infinispan-binding/conf/remote-cache.properties -p cache= 53 | ``` 54 | 55 | 4. Run the workload test with specified cache: 56 | ``` 57 | ./bin/ycsb run infinispan-cs -s -P workloads/workloada -P infinispan-binding/conf/remote-cache.properties -p cache= 58 | ``` -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/core/src/test/java/com/yahoo/ycsb/generator/AcknowledgedCounterGeneratorTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 YCSB contributors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | package com.yahoo.ycsb.generator; 18 | 19 | import java.util.Random; 20 | import java.util.concurrent.ArrayBlockingQueue; 21 | import java.util.concurrent.BlockingQueue; 22 | 23 | import org.testng.annotations.Test; 24 | 25 | /** 26 | * Tests for the AcknowledgedCounterGenerator class. 27 | */ 28 | public class AcknowledgedCounterGeneratorTest { 29 | 30 | /** 31 | * Test that advancing past {@link Integer#MAX_VALUE} works. 32 | */ 33 | @Test 34 | public void testIncrementPastIntegerMaxValue() { 35 | final long toTry = AcknowledgedCounterGenerator.WINDOW_SIZE * 3; 36 | 37 | AcknowledgedCounterGenerator generator = 38 | new AcknowledgedCounterGenerator(Integer.MAX_VALUE - 1000); 39 | 40 | Random rand = new Random(System.currentTimeMillis()); 41 | BlockingQueue pending = new ArrayBlockingQueue(1000); 42 | for (long i = 0; i < toTry; ++i) { 43 | int value = generator.nextValue(); 44 | 45 | while (!pending.offer(value)) { 46 | 47 | Integer first = pending.poll(); 48 | 49 | // Don't always advance by one. 50 | if (rand.nextBoolean()) { 51 | generator.acknowledge(first); 52 | } else { 53 | Integer second = pending.poll(); 54 | pending.add(first); 55 | generator.acknowledge(second); 56 | } 57 | } 58 | } 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/hbase10/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent/ 26 | 27 | 28 | hbase10-binding 29 | HBase 1.0 DB Binding 30 | 31 | 32 | 33 | org.apache.hbase 34 | hbase-client 35 | ${hbase10.version} 36 | 37 | 38 | com.yahoo.ycsb 39 | core 40 | ${project.version} 41 | provided 42 | 43 | 44 | junit 45 | junit 46 | 4.12 47 | test 48 | 49 | 50 | org.apache.hbase 51 | hbase-testing-util 52 | ${hbase10.version} 53 | test 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/jdbc/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | jdbc-binding 29 | JDBC DB Binding 30 | jar 31 | 32 | 33 | 34 | org.apache.openjpa 35 | openjpa-jdbc 36 | ${openjpa.jdbc.version} 37 | 38 | 39 | com.yahoo.ycsb 40 | core 41 | ${project.version} 42 | provided 43 | 44 | 45 | junit 46 | junit 47 | 4.12 48 | test 49 | 50 | 51 | org.hsqldb 52 | hsqldb 53 | 2.3.3 54 | test 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/kudu/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | kudu-binding 29 | Kudu DB Binding 30 | jar 31 | 32 | 33 | 34 | org.kududb 35 | kudu-client 36 | ${kudu.version} 37 | 38 | 39 | com.yahoo.ycsb 40 | core 41 | ${project.version} 42 | provided 43 | 44 | 45 | 46 | 47 | 48 | true 49 | 50 | 51 | false 52 | 53 | cloudera-repo 54 | Cloudera Releases 55 | https://repository.cloudera.com/artifactory/cloudera-repos 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/solr/src/test/java/com/yahoo/ycsb/db/SolrClientTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016 YCSB contributors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | package com.yahoo.ycsb.db; 18 | 19 | import com.yahoo.ycsb.DB; 20 | import org.apache.solr.client.solrj.embedded.JettySolrRunner; 21 | import org.junit.After; 22 | 23 | import java.net.URL; 24 | import java.util.Properties; 25 | import java.util.Set; 26 | 27 | import static org.junit.Assume.assumeNoException; 28 | 29 | public class SolrClientTest extends SolrClientBaseTest { 30 | 31 | private SolrClient instance; 32 | 33 | @After 34 | public void tearDown() throws Exception { 35 | try { 36 | if(instance != null) { 37 | instance.cleanup(); 38 | } 39 | } finally { 40 | super.tearDown(); 41 | } 42 | } 43 | 44 | @Override 45 | protected DB getDB(Properties props) { 46 | instance = new SolrClient(); 47 | 48 | // Use the first Solr server in the cluster. 49 | // Doesn't matter if there are more since requests will be forwarded properly by Solr. 50 | JettySolrRunner jettySolrRunner = miniSolrCloudCluster.getJettySolrRunners().get(0); 51 | String solrBaseUrl = String.format("http://localhost:%s%s", jettySolrRunner.getLocalPort(), 52 | jettySolrRunner.getBaseUrl()); 53 | 54 | props.setProperty("solr.base.url", solrBaseUrl); 55 | instance.setProperties(props); 56 | 57 | try { 58 | instance.init(); 59 | } catch (Exception error) { 60 | assumeNoException(error); 61 | } 62 | return instance; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/riak/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 4.0.0 22 | 23 | 24 | com.yahoo.ycsb 25 | binding-parent 26 | 0.11.0-SNAPSHOT 27 | ../binding-parent 28 | 29 | 30 | riak-binding 31 | Riak KV Binding 32 | jar 33 | 34 | 35 | 36 | com.basho.riak 37 | riak-client 38 | 2.0.5 39 | 40 | 41 | com.yahoo.ycsb 42 | core 43 | ${project.version} 44 | provided 45 | 46 | 47 | com.google.collections 48 | google-collections 49 | 1.0 50 | 51 | 52 | junit 53 | junit 54 | 4.12 55 | test 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/geode/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | ## Quick Start 19 | 20 | This section describes how to run YCSB on Apache Geode (incubating). 21 | 22 | ### Get Apache Geode 23 | 24 | You can download Geode from http://geode.incubator.apache.org/releases/ 25 | 26 | #### Start Geode Cluster 27 | 28 | Use the Geode shell (gfsh) to start the cluster. You will need to start 29 | at-least one locator which is a member discovery service and one or more 30 | Geode servers. 31 | 32 | Launch gfsh: 33 | 34 | ``` 35 | $ cd $GEODE_HOME 36 | $ ./bin/gfsh 37 | ``` 38 | 39 | Start a locator and two servers: 40 | 41 | ``` 42 | gfsh> start locator --name=locator1 43 | gfsh> start server --name=server1 --server-port=40404 44 | gfsh> start server --name=server2 --server-port=40405 45 | ``` 46 | 47 | Create the "usertable" region required by YCSB driver: 48 | ``` 49 | gfsh>create region --name=usertable --type=PARTITION 50 | ``` 51 | gfsh has tab autocompletion, so you can play around with various options. 52 | 53 | ### Start YCSB workload 54 | 55 | From your YCSB directory, you can run the ycsb workload as follows 56 | ``` 57 | ./bin/ycsb load geode -P workloads/workloada -p geode.locator=host[port] 58 | ``` 59 | (default port of locator is 10334). 60 | 61 | In the default mode, ycsb geode driver will connect as a client to the geode 62 | cluster. To make the ycsb driver a peer member of the distributed system 63 | use the property 64 | `-p geode.topology=p2p -p geode.locator=host[port]` 65 | 66 | Note: 67 | For update workloads, please use the property `-p writeallfields=true` 68 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/core/src/main/java/com/yahoo/ycsb/generator/SequentialGenerator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016 YCSB Contributors All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | package com.yahoo.ycsb.generator; 19 | 20 | import java.util.concurrent.atomic.AtomicInteger; 21 | 22 | /** 23 | * Generates a sequence of integers 0, 1, ... 24 | */ 25 | public class SequentialGenerator extends NumberGenerator { 26 | final AtomicInteger counter; 27 | int _interval, _countstart; 28 | 29 | /** 30 | * Create a counter that starts at countstart. 31 | */ 32 | public SequentialGenerator(int countstart, int countend) { 33 | counter = new AtomicInteger(); 34 | setLastValue(counter.get()); 35 | _countstart = countstart; 36 | _interval = countend - countstart + 1; 37 | } 38 | 39 | /** 40 | * If the generator returns numeric (integer) values, return the next value as an int. 41 | * Default is to return -1, which is appropriate for generators that do not return numeric values. 42 | */ 43 | public int nextInt() { 44 | int ret = _countstart + counter.getAndIncrement() % _interval; 45 | setLastValue(ret); 46 | return ret; 47 | } 48 | 49 | @Override 50 | public Number nextValue() { 51 | int ret = _countstart + counter.getAndIncrement() % _interval; 52 | setLastValue(ret); 53 | return ret; 54 | } 55 | 56 | @Override 57 | public Number lastValue() { 58 | return counter.get() + 1; 59 | } 60 | 61 | @Override 62 | public double mean() { 63 | throw new UnsupportedOperationException("Can't compute mean of non-stationary distribution!"); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/couchbase/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 21 | 4.0.0 22 | 23 | com.yahoo.ycsb 24 | binding-parent 25 | 0.11.0-SNAPSHOT 26 | ../binding-parent 27 | 28 | 29 | couchbase-binding 30 | Couchbase Binding 31 | jar 32 | 33 | 34 | 35 | com.couchbase.client 36 | couchbase-client 37 | ${couchbase.version} 38 | 39 | 40 | com.yahoo.ycsb 41 | core 42 | ${project.version} 43 | provided 44 | 45 | 46 | com.fasterxml.jackson.core 47 | jackson-databind 48 | 2.2.2 49 | 50 | 51 | org.slf4j 52 | slf4j-api 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/rados/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | ## Quick Start 19 | 20 | This section describes how to run YCSB on RADOS of Ceph. 21 | 22 | ### 1. Start RADOS 23 | 24 | After you start your Ceph cluster, check your cluster’s health first. You can check on the health of your cluster with the following: 25 | 26 | ceph health 27 | 28 | ### 2. Install Java and Maven 29 | 30 | ### 3. Set Up YCSB 31 | 32 | Git clone YCSB and compile: 33 | 34 | git clone http://github.com/brianfrankcooper/YCSB.git 35 | cd YCSB 36 | mvn clean package 37 | 38 | You can compile only RADOS-binding, EG: 39 | 40 | mvn -pl com.yahoo.ycsb:rados-binding -am clean package 41 | 42 | You can skip the test, EG: 43 | 44 | mvn -pl com.yahoo.ycsb:rados-binding -am clean package -DskipTests 45 | 46 | ### 4. Configuration Parameters 47 | 48 | - `rados.configfile` 49 | - The path of the Ceph configuration file 50 | - Default value is '/etc/ceph/ceph.conf' 51 | 52 | - `rados.id` 53 | - The user id to access the RADOS service 54 | - Default value is 'admin' 55 | 56 | - `rados.pool` 57 | - The pool name to be used for benchmark 58 | - Default value is 'data' 59 | 60 | You can set configurations with the shell command, EG: 61 | 62 | ./bin/ycsb load rados -s -P workloads/workloada -p "rados.configfile=/etc/ceph/ceph.conf" -p "rados.id=admin" -p "rados.pool=data" > outputLoad.txt 63 | 64 | ### 5. Load data and run tests 65 | 66 | Load the data: 67 | 68 | ./bin/ycsb load rados -s -P workloads/workloada > outputLoad.txt 69 | 70 | Run the workload test: 71 | 72 | ./bin/ycsb run rados -s -P workloads/workloada > outputRun.txt 73 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/kudu/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | # Kudu bindings for YCSB 19 | 20 | [Kudu](http://getkudu.io) is a storage engine that enables fast analytics on fast data. 21 | 22 | ## Benchmarking Kudu 23 | 24 | Use the following command line to load the initial data into an existing Kudu cluster with default 25 | configurations. 26 | 27 | ``` 28 | bin/ycsb load kudu -P workloads/workloada 29 | ``` 30 | 31 | Additional configurations: 32 | * `kudu_master_addresses`: The master's address. The default configuration expects a master on localhost. 33 | * `kudu_pre_split_num_tablets`: The number of tablets (or partitions) to create for the table. The default 34 | uses 4 tablets. A good rule of thumb is to use 5 per tablet server. 35 | * `kudu_table_num_replicas`: The number of replicas that each tablet will have. The default is 3. Should 36 | only be configured to use 1 instead, for single node tests. 37 | * `kudu_sync_ops`: If the client should wait after every write operation. The default is true. 38 | * `kudu_block_size`: The data block size used to configure columns. The default is 4096 bytes. 39 | 40 | Then, you can run the workload: 41 | 42 | ``` 43 | bin/ycsb run kudu -P workloads/workloada 44 | ``` 45 | 46 | ## Using a previous client version 47 | 48 | If you wish to use a different Kudu client version than the one shipped with YCSB, you can specify on the 49 | command line with `-Dkudu.version=x`. For example: 50 | 51 | ``` 52 | mvn -pl com.yahoo.ycsb:kudu-binding -am package -DskipTests -Dkudu.version=0.7.1 53 | ``` 54 | 55 | Note that prior to 1.0, Kudu doesn't guarantee wire or API compability between versions and only the latest 56 | one is officially supported. 57 | -------------------------------------------------------------------------------- /include/spdlog/sinks/syslog_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "../common.h" 9 | 10 | #ifdef SPDLOG_ENABLE_SYSLOG 11 | 12 | #include "sink.h" 13 | #include "../details/log_msg.h" 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | 20 | namespace spdlog 21 | { 22 | namespace sinks 23 | { 24 | /** 25 | * Sink that write to syslog using the `syscall()` library call. 26 | * 27 | * Locking is not needed, as `syslog()` itself is thread-safe. 28 | */ 29 | class syslog_sink : public sink 30 | { 31 | public: 32 | // 33 | syslog_sink(const std::string& ident = "", int syslog_option=0, int syslog_facility=LOG_USER): 34 | _ident(ident) 35 | { 36 | _priorities[static_cast(level::trace)] = LOG_DEBUG; 37 | _priorities[static_cast(level::debug)] = LOG_DEBUG; 38 | _priorities[static_cast(level::info)] = LOG_INFO; 39 | _priorities[static_cast(level::warn)] = LOG_WARNING; 40 | _priorities[static_cast(level::err)] = LOG_ERR; 41 | _priorities[static_cast(level::critical)] = LOG_CRIT; 42 | _priorities[static_cast(level::off)] = LOG_INFO; 43 | 44 | //set ident to be program name if empty 45 | ::openlog(_ident.empty()? nullptr:_ident.c_str(), syslog_option, syslog_facility); 46 | } 47 | ~syslog_sink() 48 | { 49 | ::closelog(); 50 | } 51 | 52 | syslog_sink(const syslog_sink&) = delete; 53 | syslog_sink& operator=(const syslog_sink&) = delete; 54 | 55 | void log(const details::log_msg &msg) override 56 | { 57 | ::syslog(syslog_prio_from_level(msg), "%s", msg.raw.str().c_str()); 58 | } 59 | 60 | void flush() override 61 | { 62 | } 63 | 64 | 65 | private: 66 | std::array _priorities; 67 | //must store the ident because the man says openlog might use the pointer as is and not a string copy 68 | const std::string _ident; 69 | 70 | // 71 | // Simply maps spdlog's log level to syslog priority level. 72 | // 73 | int syslog_prio_from_level(const details::log_msg &msg) const 74 | { 75 | return _priorities[static_cast(msg.level)]; 76 | } 77 | }; 78 | } 79 | } 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /kvs/include/consistent_hash_map.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace::std; 8 | 9 | #ifndef __CONSISTENT_HASH_H__ 10 | #define __CONSISTENT_HASH_H__ 11 | 12 | 13 | 14 | template > > 17 | class consistent_hash_map 18 | { 19 | public: 20 | 21 | typedef typename Hash::result_type size_type; 22 | typedef std::map,Alloc> map_type; 23 | typedef typename map_type::value_type value_type; 24 | typedef value_type& reference; 25 | typedef const value_type& const_reference; 26 | typedef typename map_type::iterator iterator; 27 | typedef typename map_type::reverse_iterator reverse_iterator; 28 | typedef Alloc allocator_type; 29 | 30 | public: 31 | 32 | consistent_hash_map() { 33 | 34 | } 35 | 36 | ~consistent_hash_map() { 37 | 38 | } 39 | 40 | public: 41 | std::size_t size() const { 42 | return nodes_.size(); 43 | } 44 | 45 | bool empty() const { 46 | return nodes_.empty(); 47 | } 48 | 49 | std::pair insert(const T& node) { 50 | size_type hash = hasher_(node); 51 | return nodes_.insert(value_type(hash,node)); 52 | } 53 | 54 | 55 | void erase(iterator it) { 56 | nodes_.erase(it); 57 | } 58 | 59 | 60 | std::size_t erase(const T& node) { 61 | size_type hash = hasher_(node); 62 | return nodes_.erase(hash); 63 | } 64 | 65 | iterator find(size_type hash) { 66 | if(nodes_.empty()) { 67 | return nodes_.end(); 68 | } 69 | 70 | iterator it = nodes_.lower_bound(hash); 71 | 72 | if (it == nodes_.end()) { 73 | it = nodes_.begin(); 74 | } 75 | 76 | return it; 77 | } 78 | 79 | iterator find(string key) { 80 | return find(hasher_(key)); 81 | } 82 | 83 | iterator begin() { return nodes_.begin(); } 84 | iterator end() { return nodes_.end(); } 85 | reverse_iterator rbegin() { return nodes_.rbegin(); } 86 | reverse_iterator rend() { return nodes_.rend(); } 87 | 88 | 89 | private: 90 | 91 | Hash hasher_; 92 | map_type nodes_; 93 | }; 94 | 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/orientdb/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | orientdb-binding 29 | OrientDB Binding 30 | jar 31 | 32 | 33 | sonatype-nexus-snapshots 34 | Sonatype Nexus Snapshots 35 | https://oss.sonatype.org/content/repositories/snapshots 36 | 37 | 38 | 39 | 40 | com.yahoo.ycsb 41 | core 42 | ${project.version} 43 | provided 44 | 45 | 46 | com.orientechnologies 47 | orientdb-client 48 | ${orientdb.version} 49 | 50 | 51 | junit 52 | junit 53 | 4.12 54 | test 55 | 56 | 57 | org.slf4j 58 | slf4j-log4j12 59 | 1.7.10 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/rados/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | rados-binding 29 | rados of Ceph FS binding 30 | jar 31 | 32 | 33 | 34 | com.ceph 35 | rados 36 | ${rados.version} 37 | 38 | 39 | com.yahoo.ycsb 40 | core 41 | ${project.version} 42 | provided 43 | 44 | 45 | org.json 46 | json 47 | ${json.version} 48 | 49 | 50 | net.java.dev.jna 51 | jna 52 | 4.2.2 53 | 54 | 55 | 56 | junit 57 | junit 58 | 4.12 59 | test 60 | 61 | 62 | 63 | 64 | 0.2.0 65 | 20160212 66 | 67 | 68 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/solr/src/test/resources/solr_config/solrconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 22 | 23 | 27 | 28 | ${tests.luceneMatchVersion:LATEST} 29 | 30 | ${useCompoundFile:false} 31 | 32 | ${solr.data.dir:} 33 | 34 | 35 | 36 | 37 | ${solr.data.dir:} 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | *:* 50 | 51 | 52 | all 53 | 54 | server-enabled.txt 55 | 56 | 57 | 58 | 59 | solr 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/elasticsearch/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | elasticsearch-binding 29 | Elasticsearch Binding 30 | jar 31 | 32 | 2.3.2 33 | 34 | 35 | 36 | 38 | net.java.dev.jna 39 | jna 40 | 4.1.0 41 | 42 | 43 | com.yahoo.ycsb 44 | core 45 | ${project.version} 46 | provided 47 | 48 | 49 | org.elasticsearch 50 | elasticsearch 51 | ${elasticsearch-version} 52 | 53 | 54 | org.testng 55 | testng 56 | 6.1.1 57 | test 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/core/src/test/java/com/yahoo/ycsb/measurements/exporter/TestMeasurementsExporter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 Yahoo! Inc. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | package com.yahoo.ycsb.measurements.exporter; 18 | 19 | import com.yahoo.ycsb.generator.ZipfianGenerator; 20 | import com.yahoo.ycsb.measurements.Measurements; 21 | import org.codehaus.jackson.JsonNode; 22 | import org.codehaus.jackson.map.ObjectMapper; 23 | import org.testng.annotations.Test; 24 | 25 | import java.io.ByteArrayOutputStream; 26 | import java.io.IOException; 27 | import java.util.Properties; 28 | 29 | import static org.testng.AssertJUnit.assertEquals; 30 | import static org.testng.AssertJUnit.assertTrue; 31 | 32 | public class TestMeasurementsExporter { 33 | @Test 34 | public void testJSONArrayMeasurementsExporter() throws IOException { 35 | Properties props = new Properties(); 36 | props.put(Measurements.MEASUREMENT_TYPE_PROPERTY, "histogram"); 37 | Measurements mm = new Measurements(props); 38 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 39 | JSONArrayMeasurementsExporter export = new JSONArrayMeasurementsExporter(out); 40 | 41 | long min = 5000; 42 | long max = 100000; 43 | ZipfianGenerator zipfian = new ZipfianGenerator(min, max); 44 | for (int i = 0; i < 1000; i++) { 45 | int rnd = zipfian.nextValue().intValue(); 46 | mm.measure("UPDATE", rnd); 47 | } 48 | mm.exportMeasurements(export); 49 | export.close(); 50 | 51 | ObjectMapper mapper = new ObjectMapper(); 52 | JsonNode json = mapper.readTree(out.toString("UTF-8")); 53 | assertTrue(json.isArray()); 54 | assertEquals(json.get(0).get("measurement").asText(), "Operations"); 55 | assertEquals(json.get(4).get("measurement").asText(), "MaxLatency(us)"); 56 | assertEquals(json.get(11).get("measurement").asText(), "4"); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /include/spdlog/sinks/android_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #if defined(__ANDROID__) 9 | 10 | #include "sink.h" 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #if !defined(SPDLOG_ANDROID_RETRIES) 19 | #define SPDLOG_ANDROID_RETRIES 2 20 | #endif 21 | 22 | namespace spdlog 23 | { 24 | namespace sinks 25 | { 26 | 27 | /* 28 | * Android sink (logging using __android_log_write) 29 | * __android_log_write is thread-safe. No lock is needed. 30 | */ 31 | class android_sink : public sink 32 | { 33 | public: 34 | explicit android_sink(const std::string& tag = "spdlog", bool use_raw_msg = false): _tag(tag), _use_raw_msg(use_raw_msg) {} 35 | 36 | void log(const details::log_msg& msg) override 37 | { 38 | const android_LogPriority priority = convert_to_android(msg.level); 39 | const char *msg_output = (_use_raw_msg ? msg.raw.c_str() : msg.formatted.c_str()); 40 | 41 | // See system/core/liblog/logger_write.c for explanation of return value 42 | int ret = __android_log_write(priority, _tag.c_str(), msg_output); 43 | int retry_count = 0; 44 | while ((ret == -11/*EAGAIN*/) && (retry_count < SPDLOG_ANDROID_RETRIES)) 45 | { 46 | std::this_thread::sleep_for(std::chrono::milliseconds(5)); 47 | ret = __android_log_write(priority, _tag.c_str(), msg_output); 48 | retry_count++; 49 | } 50 | 51 | if (ret < 0) 52 | { 53 | throw spdlog_ex("__android_log_write() failed", ret); 54 | } 55 | } 56 | 57 | void flush() override 58 | { 59 | } 60 | 61 | private: 62 | static android_LogPriority convert_to_android(spdlog::level::level_enum level) 63 | { 64 | switch(level) 65 | { 66 | case spdlog::level::trace: 67 | return ANDROID_LOG_VERBOSE; 68 | case spdlog::level::debug: 69 | return ANDROID_LOG_DEBUG; 70 | case spdlog::level::info: 71 | return ANDROID_LOG_INFO; 72 | case spdlog::level::warn: 73 | return ANDROID_LOG_WARN; 74 | case spdlog::level::err: 75 | return ANDROID_LOG_ERROR; 76 | case spdlog::level::critical: 77 | return ANDROID_LOG_FATAL; 78 | default: 79 | return ANDROID_LOG_DEFAULT; 80 | } 81 | } 82 | 83 | std::string _tag; 84 | bool _use_raw_msg; 85 | }; 86 | 87 | } 88 | } 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/hbase094/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent/ 26 | 27 | 28 | hbase094-binding 29 | HBase 0.94.x DB Binding 30 | 31 | 32 | 33 | 34 | org.apache.hbase 35 | hbase 36 | ${hbase094.version} 37 | 38 | 39 | org.apache.hadoop 40 | hadoop-core 41 | 1.0.4 42 | 43 | 44 | com.yahoo.ycsb 45 | hbase098-binding 46 | ${project.version} 47 | 48 | 50 | 51 | * 52 | * 53 | 54 | 55 | 56 | 57 | org.slf4j 58 | slf4j-simple 59 | 1.7.12 60 | 61 | 62 | com.yahoo.ycsb 63 | core 64 | ${project.version} 65 | provided 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/doc/coreproperties.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | YCSB - Core workload package properties 21 | 22 | 23 |

Yahoo! Cloud Serving Benchmark

24 |

Version 0.1.2

25 |
26 | Home - Core workloads - Tips and FAQ 27 |
28 |

Core workload package properties

29 | The property files used with the core workload generator can specify values for the following properties:

30 |

    31 |
  • fieldcount: the number of fields in a record (default: 10) 32 |
  • fieldlength: the size of each field (default: 100) 33 |
  • readallfields: should reads read all fields (true) or just one (false) (default: true) 34 |
  • readproportion: what proportion of operations should be reads (default: 0.95) 35 |
  • updateproportion: what proportion of operations should be updates (default: 0.05) 36 |
  • insertproportion: what proportion of operations should be inserts (default: 0) 37 |
  • scanproportion: what proportion of operations should be scans (default: 0) 38 |
  • readmodifywriteproportion: what proportion of operations should be read a record, modify it, write it back (default: 0) 39 |
  • requestdistribution: what distribution should be used to select the records to operate on - uniform, zipfian or latest (default: uniform) 40 |
  • maxscanlength: for scans, what is the maximum number of records to scan (default: 1000) 41 |
  • scanlengthdistribution: for scans, what distribution should be used to choose the number of records to scan, for each scan, between 1 and maxscanlength (default: uniform) 42 |
  • insertorder: should records be inserted in order by key ("ordered"), or in hashed order ("hashed") (default: hashed) 43 |
44 |
45 | YCSB - Yahoo! Research - Contact cooperb@yahoo-inc.com. 46 | 47 | 48 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/README.md: -------------------------------------------------------------------------------- 1 | 18 | 19 | Yahoo! Cloud System Benchmark (YCSB) 20 | ==================================== 21 | [![Build Status](https://travis-ci.org/brianfrankcooper/YCSB.png?branch=master)](https://travis-ci.org/brianfrankcooper/YCSB) 22 | 23 | Links 24 | ----- 25 | http://wiki.github.com/brianfrankcooper/YCSB/ 26 | https://labs.yahoo.com/news/yahoo-cloud-serving-benchmark/ 27 | ycsb-users@yahoogroups.com 28 | 29 | Getting Started 30 | --------------- 31 | 32 | 1. Download the [latest release of YCSB](https://github.com/brianfrankcooper/YCSB/releases/latest): 33 | 34 | ```sh 35 | curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.10.0/ycsb-0.10.0.tar.gz 36 | tar xfvz ycsb-0.10.0.tar.gz 37 | cd ycsb-0.10.0 38 | ``` 39 | 40 | 2. Set up a database to benchmark. There is a README file under each binding 41 | directory. 42 | 43 | 3. Run YCSB command. 44 | 45 | On Linux: 46 | ```sh 47 | bin/ycsb.sh load basic -P workloads/workloada 48 | bin/ycsb.sh run basic -P workloads/workloada 49 | ``` 50 | 51 | On Windows: 52 | ```bat 53 | bin/ycsb.bat load basic -P workloads\workloada 54 | bin/ycsb.bat run basic -P workloads\workloada 55 | ``` 56 | 57 | Running the `ycsb` command without any argument will print the usage. 58 | 59 | See https://github.com/brianfrankcooper/YCSB/wiki/Running-a-Workload 60 | for a detailed documentation on how to run a workload. 61 | 62 | See https://github.com/brianfrankcooper/YCSB/wiki/Core-Properties for 63 | the list of available workload properties. 64 | 65 | Building from source 66 | -------------------- 67 | 68 | YCSB requires the use of Maven 3; if you use Maven 2, you may see [errors 69 | such as these](https://github.com/brianfrankcooper/YCSB/issues/406). 70 | 71 | To build the full distribution, with all database bindings: 72 | 73 | mvn clean package 74 | 75 | To build a single database binding: 76 | 77 | mvn -pl com.yahoo.ycsb:mongodb-binding -am clean package 78 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/doc/parallelclients.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | YCSB - Parallel clients 21 | 22 | 23 |

Yahoo! Cloud Serving Benchmark

24 |

Version 0.1.2

25 |
26 | Home - Core workloads - Tips and FAQ 27 |
28 |

Running multiple clients in parallel

29 | It is straightforward to run the transaction phase of the workload from multiple servers - just start up clients on different servers, each running the same workload. Each client will 30 | produce performance statistics when it is done, and you'll have to aggregate these individual files into a single set of results. 31 |

32 | In some cases it makes sense to load the database using multiple servers. In this case, you will want to partition the records to be loaded among the clients. Normally, YCSB just loads 33 | all of the records (as defined by the recordcount property). However, if you want to partition the load you need to additionally specify two other properties for each client: 34 |

    35 |
  • insertstart: The index of the record to start at. 36 |
  • insertcount: The number of records to insert. 37 |
38 | These properties can be specified in a property file or on the command line using the -p option. 39 |

40 | For example, imagine you want to load 100 million records (so recordcount=100000000). Imagine you want to load with four clients. For the first client: 41 |

42 | insertstart=0
43 | insertcount=25000000
44 | 
45 | For the second client: 46 |
47 | insertstart=25000000
48 | insertcount=25000000
49 | 
50 | For the third client: 51 |
52 | insertstart=50000000
53 | insertcount=25000000
54 | 
55 | And for the fourth client: 56 |
57 | insertstart=75000000
58 | insertcount=25000000
59 | 
60 |
61 | YCSB - Yahoo! Research - Contact cooperb@yahoo-inc.com. 62 | 63 | 64 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/geode/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | geode-binding 29 | Geode DB Binding 30 | jar 31 | 32 | 33 | false 34 | 35 | 36 | 37 | 38 | org.apache.geode 39 | geode-core 40 | ${geode.version} 41 | 42 | 43 | com.yahoo.ycsb 44 | core 45 | ${project.version} 46 | provided 47 | 48 | 49 | 50 | 51 | 52 | org.apache.maven.plugins 53 | maven-checkstyle-plugin 54 | 2.15 55 | 56 | true 57 | ../checkstyle.xml 58 | true 59 | true 60 | 61 | 62 | 63 | validate 64 | validate 65 | 66 | checkstyle 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/tarantool/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 4.0.0 22 | 23 | com.yahoo.ycsb 24 | binding-parent 25 | 0.11.0-SNAPSHOT 26 | ../binding-parent/ 27 | 28 | 29 | tarantool-binding 30 | Tarantool DB Binding 31 | jar 32 | 33 | 34 | false 35 | 36 | 37 | 38 | 39 | org.tarantool 40 | connector 41 | ${tarantool.version} 42 | 43 | 44 | com.yahoo.ycsb 45 | core 46 | ${project.version} 47 | provided 48 | 49 | 50 | 51 | 52 | 53 | 54 | org.apache.maven.plugins 55 | maven-checkstyle-plugin 56 | 2.15 57 | 58 | true 59 | ../checkstyle.xml 60 | true 61 | true 62 | 63 | 64 | 65 | validate 66 | validate 67 | 68 | checkstyle 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /include/base_lattices.h: -------------------------------------------------------------------------------- 1 | #ifndef BASE_LATTICES_H 2 | #define BASE_LATTICES_H 3 | 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | template 9 | class AtomicLattice{ 10 | protected: 11 | atomic element; 12 | const atomic zero {static_cast (0)}; 13 | virtual void do_merge(const T &e) = 0; 14 | public: 15 | AtomicLattice() { 16 | assign(bot()); 17 | } 18 | AtomicLattice(const T &e) { 19 | assign(e); 20 | } 21 | AtomicLattice(const AtomicLattice &other) { 22 | assign(other.reveal()); 23 | } 24 | virtual ~AtomicLattice () = default; 25 | AtomicLattice& operator=(const AtomicLattice &rhs) { 26 | assign(rhs.reveal()); 27 | return *this; 28 | } 29 | bool operator==(const AtomicLattice& rhs) const { 30 | return this->reveal() == rhs.reveal(); 31 | } 32 | const T reveal() const { 33 | return element.load(); 34 | } 35 | const T bot() const { 36 | return zero.load(); 37 | } 38 | void merge(const T &e) { 39 | return do_merge(e); 40 | } 41 | void merge(const AtomicLattice &e) { 42 | return do_merge(e.reveal()); 43 | } 44 | void assign(const T e) { 45 | element.store(e); 46 | } 47 | void assign(const AtomicLattice &e) { 48 | element.store(e.reveal()); 49 | } 50 | }; 51 | 52 | template 53 | class Lattice{ 54 | protected: 55 | T element; 56 | const T zero {static_cast (0)}; 57 | virtual void do_merge(const T &e) = 0; 58 | public: 59 | Lattice() { 60 | assign(bot()); 61 | } 62 | Lattice(const T &e) { 63 | assign(e); 64 | } 65 | Lattice(const Lattice &other) { 66 | assign(other.reveal()); 67 | } 68 | virtual ~Lattice () = default; 69 | Lattice& operator=(const Lattice &rhs) { 70 | assign(rhs.reveal()); 71 | return *this; 72 | } 73 | bool operator==(const Lattice& rhs) const { 74 | return this->reveal() == rhs.reveal(); 75 | } 76 | const T &reveal() const { 77 | return element; 78 | } 79 | const T &bot() const { 80 | return zero; 81 | } 82 | void merge(const T &e) { 83 | return do_merge(e); 84 | } 85 | void merge(const Lattice &e) { 86 | return do_merge(e.reveal()); 87 | } 88 | void assign(const T e) { 89 | element = e; 90 | } 91 | void assign(const Lattice &e) { 92 | element = e.reveal(); 93 | } 94 | }; 95 | 96 | // currently destructive to l1, should probably make a copy before calling merge 97 | // move it to class definition 98 | // callers to this method shouldn't make a copy 99 | template 100 | bool dominated(T l1, T l2) { 101 | l1.merge(l2); 102 | if (l1 == l2) return true; 103 | else return false; 104 | } 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/elasticsearch/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | ## Quick Start 19 | 20 | This section describes how to run YCSB on Elasticsearch running locally. 21 | 22 | ### 1. Set Up YCSB 23 | 24 | Clone the YCSB git repository and compile: 25 | 26 | git clone git://github.com/brianfrankcooper/YCSB.git 27 | cd YCSB 28 | mvn clean package 29 | 30 | ### 2. Run YCSB 31 | 32 | Now you are ready to run! First, load the data: 33 | 34 | ./bin/ycsb load elasticsearch -s -P workloads/workloada 35 | 36 | Then, run the workload: 37 | 38 | ./bin/ycsb run elasticsearch -s -P workloads/workloada 39 | 40 | For further configuration see below: 41 | 42 | ### Defaults Configuration 43 | The default setting for the Elasticsearch node that is created is as follows: 44 | 45 | cluster.name=es.ycsb.cluster 46 | es.index.key=es.ycsb 47 | es.number_of_shards=1 48 | es.number_of_replicas=0 49 | es.remote=false 50 | es.newdb=false 51 | es.hosts.list=localhost:9200 (only applies if es.remote=true) 52 | 53 | ### Custom Configuration 54 | If you wish to customize the settings used to create the Elasticsearch node 55 | you can created a new property file that contains your desired Elasticsearch 56 | node settings and pass it in via the parameter to 'bin/ycsb' script. Note that 57 | the default properties will be kept if you don't explicitly overwrite them. 58 | 59 | Assuming that we have a properties file named "myproperties.data" that contains 60 | custom Elasticsearch node configuration you can execute the following to 61 | pass it into the Elasticsearch client: 62 | 63 | 64 | ./bin/ycsb run elasticsearch -P workloads/workloada -P myproperties.data -s 65 | 66 | If you wish to change the default index name you can set the following property: 67 | 68 | es.index.key=my_index_key 69 | 70 | If you wish to run against a remote cluster you can set the following property: 71 | 72 | es.remote=true 73 | 74 | By default this will use localhost:9300 as a seed node to discover the cluster. 75 | You can also specify 76 | 77 | es.hosts.list=(\w+:\d+)+ 78 | 79 | (a comma-separated list of host/port pairs) to change this. 80 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Yahoo! Inc. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you 5 | * may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. See the License for the specific language governing 14 | * permissions and limitations under the License. See accompanying 15 | * LICENSE file. 16 | */ 17 | 18 | package com.yahoo.ycsb.measurements; 19 | 20 | import com.yahoo.ycsb.Status; 21 | import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; 22 | 23 | import java.io.IOException; 24 | import java.util.Map; 25 | import java.util.concurrent.ConcurrentHashMap; 26 | import java.util.concurrent.atomic.AtomicInteger; 27 | 28 | /** 29 | * A single measured metric (such as READ LATENCY) 30 | */ 31 | public abstract class OneMeasurement { 32 | 33 | private final String _name; 34 | private final ConcurrentHashMap _returncodes; 35 | 36 | public String getName() { 37 | return _name; 38 | } 39 | 40 | /** 41 | * @param _name 42 | */ 43 | public OneMeasurement(String _name) { 44 | this._name = _name; 45 | this._returncodes = new ConcurrentHashMap(); 46 | } 47 | 48 | public abstract void measure(int latency); 49 | 50 | public abstract String getSummary(); 51 | 52 | /** 53 | * No need for synchronization, using CHM to deal with that 54 | */ 55 | public void reportStatus(Status status) { 56 | AtomicInteger counter = _returncodes.get(status); 57 | 58 | if (counter == null) { 59 | AtomicInteger other = _returncodes.putIfAbsent(status, counter = new AtomicInteger()); 60 | if (other != null) { 61 | counter = other; 62 | } 63 | } 64 | 65 | counter.incrementAndGet(); 66 | } 67 | 68 | /** 69 | * Export the current measurements to a suitable format. 70 | * 71 | * @param exporter Exporter representing the type of format to write to. 72 | * @throws IOException Thrown if the export failed. 73 | */ 74 | public abstract void exportMeasurements(MeasurementsExporter exporter) throws IOException; 75 | 76 | protected final void exportStatusCounts(MeasurementsExporter exporter) throws IOException { 77 | for (Map.Entry entry : _returncodes.entrySet()) { 78 | exporter.write(getName(), "Return=" + entry.getKey().getName(), entry.getValue().get()); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/dynamodb/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | dynamodb-binding 29 | DynamoDB DB Binding 30 | 31 | 32 | false 33 | 34 | 35 | 36 | 37 | com.amazonaws 38 | aws-java-sdk 39 | 1.10.48 40 | 41 | 42 | log4j 43 | log4j 44 | 1.2.17 45 | 46 | 47 | com.yahoo.ycsb 48 | core 49 | ${project.version} 50 | provided 51 | 52 | 53 | 54 | 55 | 56 | org.apache.maven.plugins 57 | maven-checkstyle-plugin 58 | 2.15 59 | 60 | true 61 | ../checkstyle.xml 62 | true 63 | true 64 | 65 | 66 | 67 | validate 68 | validate 69 | 70 | checkstyle 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/memcached/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 4.0.0 21 | 22 | com.yahoo.ycsb 23 | binding-parent 24 | 0.11.0-SNAPSHOT 25 | ../binding-parent 26 | 27 | 28 | memcached-binding 29 | memcached binding 30 | jar 31 | 32 | 33 | 34 | log4j 35 | log4j 36 | 1.2.17 37 | 38 | 39 | com.yahoo.ycsb 40 | core 41 | ${project.version} 42 | 43 | 44 | org.codehaus.jackson 45 | jackson-mapper-asl 46 | 1.9.13 47 | 48 | 49 | net.spy 50 | spymemcached 51 | 2.11.4 52 | 53 | 54 | 55 | 56 | 57 | 58 | org.apache.maven.plugins 59 | maven-assembly-plugin 60 | ${maven.assembly.version} 61 | 62 | 63 | jar-with-dependencies 64 | 65 | false 66 | 67 | 68 | 69 | package 70 | 71 | single 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /kvs/YCSB/YCSB/cassandra2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 22 | 4.0.0 23 | 24 | com.yahoo.ycsb 25 | binding-parent 26 | 0.11.0-SNAPSHOT 27 | ../binding-parent 28 | 29 | 30 | cassandra2-binding 31 | Cassandra 2.1+ DB Binding 32 | jar 33 | 34 | 35 | 36 | true 37 | 38 | 39 | 40 | 41 | 42 | com.datastax.cassandra 43 | cassandra-driver-core 44 | ${cassandra2.cql.version} 45 | 46 | 47 | com.yahoo.ycsb 48 | core 49 | ${project.version} 50 | provided 51 | 52 | 53 | org.cassandraunit 54 | cassandra-unit 55 | 3.0.0.1 56 | shaded 57 | test 58 | 59 | 60 | junit 61 | junit 62 | 4.12 63 | test 64 | 65 | 66 | 67 | 68 | 71 | 72 | jdk8-tests 73 | 74 | 1.8 75 | 76 | 77 | false 78 | 79 | 80 | 81 | 82 | --------------------------------------------------------------------------------