diff --git a/store/common/backend/kvstore.cc b/store/common/backend/kvstore.cc index 5f388bf7fb660d1fa774833ae1665a4829eaf82b..1e876ea027c9870c21e2ee84cbe7b9c4c42dbe97 100644 --- a/store/common/backend/kvstore.cc +++ b/store/common/backend/kvstore.cc @@ -28,7 +28,7 @@ * **********************************************************************/ -#include "kvstore.h" +#include "store/common/backend/kvstore.h" using namespace std; diff --git a/store/common/backend/kvstore.h b/store/common/backend/kvstore.h index 5a747078075b953613220b604e3de2742e1f7076..9bdae9e1f605d68f2e0dbb9f2370a8cfa1c7fe09 100644 --- a/store/common/backend/kvstore.h +++ b/store/common/backend/kvstore.h @@ -35,9 +35,6 @@ #include "lib/message.h" #include <unordered_map> -#include <vector> -#include <fstream> -#include <iostream> #include <list> class KVStore diff --git a/store/common/backend/lockserver.cc b/store/common/backend/lockserver.cc index 5c9edfcdb55cddc11c2c1eeefb01a2d9429aef1e..4c80f808a3db6a8fce3083a48a1d106b53fbd5f8 100644 --- a/store/common/backend/lockserver.cc +++ b/store/common/backend/lockserver.cc @@ -6,7 +6,7 @@ * **********************************************************************/ -#include "lockserver.h" +#include "store/common/backend/lockserver.h" using namespace std; diff --git a/store/common/backend/lockserver.h b/store/common/backend/lockserver.h index 16112e289255bbb23c4615b0d2eb30c9538a00c6..6609c740fc7df3448c5fb040b064692b2e289628 100644 --- a/store/common/backend/lockserver.h +++ b/store/common/backend/lockserver.h @@ -33,11 +33,11 @@ #include "lib/assert.h" #include "lib/message.h" + #include <sys/time.h> #include <map> #include <queue> #include <string> -#include <vector> #include <unordered_map> #include <unordered_set> diff --git a/store/common/backend/txnstore.h b/store/common/backend/txnstore.h index c399590b49affbfe97aeec719b107702e1698bf8..7650ab560cdb80e75a796b37d8ff749a1508f780 100644 --- a/store/common/backend/txnstore.h +++ b/store/common/backend/txnstore.h @@ -36,17 +36,8 @@ #include "lib/assert.h" #include "lib/message.h" -#include "store/common/transaction.h" #include "store/common/timestamp.h" - -// Reply types -#define REPLY_OK 0 -#define REPLY_FAIL 1 -#define REPLY_RETRY 2 -#define REPLY_ABSTAIN 3 -#define REPLY_TIMEOUT 4 -#define REPLY_NETWORK_FAILURE 5 -#define REPLY_MAX 6 +#include "store/common/transaction.h" class TxnStore { diff --git a/store/common/backend/versionstore.cc b/store/common/backend/versionstore.cc index ba2db9eec5fd7e59d5f0979278b96151db15d216..8a3484c384546c92cc1df695e18e67f5355bab78 100644 --- a/store/common/backend/versionstore.cc +++ b/store/common/backend/versionstore.cc @@ -28,7 +28,7 @@ * **********************************************************************/ -#include "versionstore.h" +#include "store/common/backend/versionstore.h" using namespace std; diff --git a/store/common/backend/versionstore.h b/store/common/backend/versionstore.h index 34436874d79722df5427e960d524823ab5f75d31..d5e41545c67095ba6fd2f5f89745a56ec748d5a1 100644 --- a/store/common/backend/versionstore.h +++ b/store/common/backend/versionstore.h @@ -38,12 +38,9 @@ #include <set> #include <map> #include <unordered_map> -#include <fstream> -#include <iostream> class VersionedKVStore { - public: VersionedKVStore(); ~VersionedKVStore(); diff --git a/store/common/frontend/bufferclient.cc b/store/common/frontend/bufferclient.cc index e8783ef34673cfba7deaa717fe1dbff2adc0a1b1..c1c82dad4c953d4718dc26ef4a6c66d697f98b98 100644 --- a/store/common/frontend/bufferclient.cc +++ b/store/common/frontend/bufferclient.cc @@ -28,7 +28,7 @@ * **********************************************************************/ -#include "bufferclient.h" +#include "store/common/frontend/bufferclient.h" using namespace std; diff --git a/store/common/frontend/bufferclient.h b/store/common/frontend/bufferclient.h index bf24f574d84f1d5a58e0b71966e108b0b45fd224..b40895c1c08ca4b4e13e7f8230fdb9dacdbae9a9 100644 --- a/store/common/frontend/bufferclient.h +++ b/store/common/frontend/bufferclient.h @@ -33,12 +33,10 @@ #include "lib/assert.h" #include "lib/message.h" -#include "store/common/transaction.h" #include "store/common/promise.h" +#include "store/common/transaction.h" #include "store/common/frontend/txnclient.h" -#include <string> - class BufferClient { public: diff --git a/store/common/frontend/client.h b/store/common/frontend/client.h index 224ed5eba2dfda2e6304a58abbe5794da733e21d..555da3438098d3b5e3705af5fb9e46b5858eaf27 100644 --- a/store/common/frontend/client.h +++ b/store/common/frontend/client.h @@ -11,6 +11,7 @@ #include "lib/assert.h" #include "lib/message.h" + #include <string> #include <vector> diff --git a/store/common/promise.cc b/store/common/promise.cc index c2068edd488b756161752bdfbd2be05be038a288..49402d14cbec9a905c7cd2cb0d6f3fa4d44a7370 100644 --- a/store/common/promise.cc +++ b/store/common/promise.cc @@ -28,7 +28,7 @@ * **********************************************************************/ -#include "promise.h" +#include "store/common/promise.h" using namespace std; diff --git a/store/common/promise.h b/store/common/promise.h index 5ba3d6045ee4415eb5a5956973e1e98eb2cfc12e..b97df483144307964e9e67cbdf7902bd46fc5ed4 100644 --- a/store/common/promise.h +++ b/store/common/promise.h @@ -35,7 +35,8 @@ #include "lib/assert.h" #include "lib/message.h" #include "lib/transport.h" -#include "transaction.h" +#include "store/common/transaction.h" + #include <condition_variable> #include <mutex> diff --git a/store/common/timestamp.cc b/store/common/timestamp.cc index c263a6185b72cdf0e160d4af57166281198b1e7a..6810aa58f518cbf9f844323dc0ac4d4389278101 100644 --- a/store/common/timestamp.cc +++ b/store/common/timestamp.cc @@ -6,7 +6,7 @@ * **********************************************************************/ -#include "timestamp.h" +#include "store/common/timestamp.h" void Timestamp::operator=(const Timestamp &t) diff --git a/store/common/tracer.cc b/store/common/tracer.cc index e82b29ebc314b92c39c15fef75158885fac89ab5..0dbd854854a00ba6af207dc4f78f717779107538 100644 --- a/store/common/tracer.cc +++ b/store/common/tracer.cc @@ -6,7 +6,7 @@ * **********************************************************************/ -#include "tracer.h" +#include "store/common/tracer.h" using namespace std; diff --git a/store/common/tracer.h b/store/common/tracer.h index d543b286813b5232629cedd74be3982774c281b4..3da22de21d013054157e0bf5a0fbd6d63c7d4b01 100644 --- a/store/common/tracer.h +++ b/store/common/tracer.h @@ -9,9 +9,9 @@ #ifndef _LIB_TRACER_H_ #define _LIB_TRACER_H_ +#include <sys/time.h> #include <map> #include <string> -#include <sys/time.h> /* Trace details of an individual type of request. */ typedef struct Request_Trace diff --git a/store/common/transaction.cc b/store/common/transaction.cc index 6bd27b4de3898cc580eb1c44217c1be0bc15602b..ed566a1683d21356a47767a132075b007a634f53 100644 --- a/store/common/transaction.cc +++ b/store/common/transaction.cc @@ -6,7 +6,7 @@ * **********************************************************************/ -#include "transaction.h" +#include "store/common/transaction.h" using namespace std; diff --git a/store/common/transaction.h b/store/common/transaction.h index 1b1ca5ecd933ff9dca368f7077cc0a7943a11fd6..be3dac8abebdc983ad82e4dbebe55a858145f8c2 100644 --- a/store/common/transaction.h +++ b/store/common/transaction.h @@ -11,7 +11,7 @@ #include "lib/assert.h" #include "lib/message.h" -#include "timestamp.h" +#include "store/common/timestamp.h" #include "store/common/common-proto.pb.h" #include <unordered_map> diff --git a/store/common/truetime.cc b/store/common/truetime.cc index 1f7047c86ce744b6686e0e9445341e3bae1b52b7..2293fe2828b07dcaacb652387b902121c1047ecc 100644 --- a/store/common/truetime.cc +++ b/store/common/truetime.cc @@ -6,7 +6,7 @@ * **********************************************************************/ -#include "truetime.h" +#include "store/common/truetime.h" TrueTime::TrueTime() { simError = 0; diff --git a/store/common/truetime.h b/store/common/truetime.h index 1b1115c127bab9e3988d6c3f707aab1168fac1d9..771622a92eb5cf98be21c5d96f642a7d39c47fa8 100644 --- a/store/common/truetime.h +++ b/store/common/truetime.h @@ -12,7 +12,7 @@ #include "lib/message.h" #include <sys/time.h> -#include <stdlib.h> +#include <cstdlib> class TrueTime { diff --git a/store/strongstore/client.cc b/store/strongstore/client.cc index 125db34c341d6a1426ce084b58adcea3ed126c35..3827bf21ce52d5107e60a7b0e32d1c4c27d47f97 100644 --- a/store/strongstore/client.cc +++ b/store/strongstore/client.cc @@ -29,7 +29,7 @@ * **********************************************************************/ -#include "client.h" +#include "store/strongstore/client.h" using namespace std; diff --git a/store/strongstore/client.h b/store/strongstore/client.h index 8a6a6ab4647b11152590c9f026048e5868187c3f..07788c362ecc21d34d62a80c581b0e5d8e21ac6c 100644 --- a/store/strongstore/client.h +++ b/store/strongstore/client.h @@ -35,16 +35,13 @@ #include "lib/message.h" #include "lib/configuration.h" #include "lib/udptransport.h" -#include "store/common/frontend/client.h" #include "replication/vr/client.h" #include "store/common/frontend/bufferclient.h" +#include "store/common/frontend/client.h" #include "store/common/truetime.h" #include "store/strongstore/strong-proto.pb.h" #include "store/strongstore/shardclient.h" -#include <condition_variable> -#include <mutex> -#include <string> #include <set> #include <thread> diff --git a/store/strongstore/lockstore.cc b/store/strongstore/lockstore.cc index 433641af169ce9481279e7ee5b7e84227a52558a..c5438d251b1cb9d26f59d4067950c34423b149f4 100644 --- a/store/strongstore/lockstore.cc +++ b/store/strongstore/lockstore.cc @@ -30,7 +30,7 @@ * **********************************************************************/ -#include "lockstore.h" +#include "store/strongstore/lockstore.h" using namespace std; diff --git a/store/strongstore/lockstore.h b/store/strongstore/lockstore.h index 0b2808a71adf15b6a40aed0e60d3f23e8506a1ab..5b39abd2cc0b30fed3d8aa2998bd06b68ec1d1b7 100644 --- a/store/strongstore/lockstore.h +++ b/store/strongstore/lockstore.h @@ -41,11 +41,7 @@ #include "store/common/backend/txnstore.h" #include "store/common/backend/lockserver.h" -#include <set> #include <map> -#include <list> -#include <vector> -#include <unordered_map> namespace strongstore { diff --git a/store/strongstore/occstore.cc b/store/strongstore/occstore.cc index 9b22a90bbba965b2494b8f5cbaff57908c692f5d..161dac375e7db00f097c0c92f1ea541902edd6b5 100644 --- a/store/strongstore/occstore.cc +++ b/store/strongstore/occstore.cc @@ -30,12 +30,12 @@ * **********************************************************************/ -#include "occstore.h" - -using namespace std; +#include "store/strongstore/occstore.h" namespace strongstore { +using namespace std; + OCCStore::OCCStore() : store() { } OCCStore::~OCCStore() { } diff --git a/store/strongstore/occstore.h b/store/strongstore/occstore.h index c73aa98ca4805dddea5b308377ddcb6df5f3b524..61e8dd3a2103bb53b3cc2abc7fc18a431ff811dc 100644 --- a/store/strongstore/occstore.h +++ b/store/strongstore/occstore.h @@ -39,11 +39,7 @@ #include "store/common/backend/txnstore.h" #include "store/common/transaction.h" -#include <vector> -#include <unordered_map> -#include <set> #include <map> -#include <list> namespace strongstore { diff --git a/store/strongstore/server.cc b/store/strongstore/server.cc index 9a7213916e4f1279aaca109a9634e2e2d03f7b1c..ae2ad4676a68a8a1056cbb7d8f03795cb029b69d 100644 --- a/store/strongstore/server.cc +++ b/store/strongstore/server.cc @@ -29,12 +29,11 @@ * **********************************************************************/ -#include "server.h" - -using namespace std; +#include "store/strongstore/server.h" namespace strongstore { +using namespace std; using namespace proto; Server::Server(Mode mode, uint64_t skew, uint64_t error) : mode(mode) @@ -350,7 +349,7 @@ main(int argc, char **argv) if (keyPath) { string key; - ifstream in; + std::ifstream in; in.open(keyPath); if (!in) { fprintf(stderr, "Could not read keys from: %s\n", keyPath); diff --git a/store/strongstore/shardclient.cc b/store/strongstore/shardclient.cc index 241a84bff167be28b755fc494b390e0e1ec2c743..ba1f1cc9036f9297221ba08fc46bc3f360267a6f 100644 --- a/store/strongstore/shardclient.cc +++ b/store/strongstore/shardclient.cc @@ -29,7 +29,7 @@ * **********************************************************************/ -#include "shardclient.h" +#include "store/strongstore/shardclient.h" namespace strongstore { @@ -326,5 +326,4 @@ ShardClient::AbortCallback(const string &request_str, const string &reply_str) Debug("[shard %i] Received ABORT callback [%d]", shard, reply.status()); } - } // namespace strongstore diff --git a/store/strongstore/shardclient.h b/store/strongstore/shardclient.h index 9cc2014dd128998c2f77015d3485b312838fd770..8dea5f9c83159635680b358744c7166008d8c71e 100644 --- a/store/strongstore/shardclient.h +++ b/store/strongstore/shardclient.h @@ -35,17 +35,13 @@ #include "lib/assert.h" #include "lib/message.h" #include "lib/transport.h" -#include "store/common/frontend/client.h" #include "replication/vr/client.h" +#include "store/common/frontend/client.h" #include "store/common/frontend/txnclient.h" #include "store/common/timestamp.h" #include "store/common/transaction.h" #include "store/strongstore/strong-proto.pb.h" -#include <string> -#include <mutex> -#include <condition_variable> - namespace strongstore { enum Mode { diff --git a/store/tapirstore/client.h b/store/tapirstore/client.h index 39e6da2361f8ece3c8fd1d8d1a649803f5664eeb..42c44b1957c4f8336af15fcd85c5803bcc5a3b67 100644 --- a/store/tapirstore/client.h +++ b/store/tapirstore/client.h @@ -39,17 +39,11 @@ #include "replication/ir/client.h" #include "store/common/timestamp.h" #include "store/common/truetime.h" -#include "store/common/backend/txnstore.h" #include "store/common/frontend/client.h" #include "store/common/frontend/bufferclient.h" -#include "store/common/frontend/txnclient.h" #include "store/tapirstore/shardclient.h" #include "store/tapirstore/tapir-proto.pb.h" -#include <condition_variable> -#include <mutex> -#include <set> -#include <string> #include <thread> namespace tapirstore { diff --git a/store/tapirstore/server.h b/store/tapirstore/server.h index f4843448c3f2cc013d5298f305515ba8f8737f84..217d38fde60e6a5e575d7a5eba099ee30d1b0f88 100644 --- a/store/tapirstore/server.h +++ b/store/tapirstore/server.h @@ -32,7 +32,6 @@ #ifndef _TAPIR_SERVER_H_ #define _TAPIR_SERVER_H_ -#include "lib/udptransport.h" #include "replication/ir/replica.h" #include "store/common/timestamp.h" #include "store/common/truetime.h" diff --git a/store/tapirstore/shardclient.cc b/store/tapirstore/shardclient.cc index bfd71e5a596b8e7689fced0306e01273db5440b8..de9e2f9245d34ebd3d98e5233d74acdf2fae31be 100644 --- a/store/tapirstore/shardclient.cc +++ b/store/tapirstore/shardclient.cc @@ -29,8 +29,7 @@ * **********************************************************************/ -#include "shardclient.h" -#include "lib/configuration.h" +#include "store/tapirstore/shardclient.h" namespace tapirstore { diff --git a/store/tapirstore/shardclient.h b/store/tapirstore/shardclient.h index ec85d1ce0f85debe18d3518da6f9d53a7ad1edbd..0d3cd29917529353bab48aec5c32681d71380da3 100644 --- a/store/tapirstore/shardclient.h +++ b/store/tapirstore/shardclient.h @@ -33,6 +33,7 @@ #define _TAPIR_SHARDCLIENT_H_ #include "lib/assert.h" +#include "lib/configuration.h" #include "lib/message.h" #include "lib/transport.h" #include "replication/ir/client.h" diff --git a/store/tapirstore/store.h b/store/tapirstore/store.h index b722b0afa16292adbc7e6339d557b78b6efcd215..27dce810464ba0abbfd482e22fb60e247bf67e97 100644 --- a/store/tapirstore/store.h +++ b/store/tapirstore/store.h @@ -41,7 +41,6 @@ #include <set> #include <unordered_map> -#include <vector> namespace tapirstore { diff --git a/store/weakstore/client.h b/store/weakstore/client.h index b4970cbc00878aa116f2471915ef2416407020cd..5c220d0c32f18c059fe8f7975d41e56e2e7157e8 100644 --- a/store/weakstore/client.h +++ b/store/weakstore/client.h @@ -34,10 +34,8 @@ #include "lib/assert.h" #include "lib/message.h" -#include "lib/configuration.h" #include "lib/udptransport.h" #include "replication/common/client.h" -#include "replication/vr/client.h" #include "store/common/frontend/client.h" #include "store/common/frontend/bufferclient.h" #include "store/common/truetime.h" diff --git a/store/weakstore/server.cc b/store/weakstore/server.cc index 6a9d5f70ec9616501badf31eb20fdefbdb1bbe14..cec1351dfd03f453222195bb1dc575ab2e2250fe 100644 --- a/store/weakstore/server.cc +++ b/store/weakstore/server.cc @@ -28,7 +28,7 @@ * **********************************************************************/ -#include "server.h" +#include "store/weakstore/server.h" namespace weakstore { diff --git a/store/weakstore/server.h b/store/weakstore/server.h index 78b8e83165a336926a0f1dcaaeace5c29ba5ad9a..97e61ee8842bb0b9cef75059ec67981ebd74f783 100644 --- a/store/weakstore/server.h +++ b/store/weakstore/server.h @@ -35,9 +35,7 @@ #include "lib/message.h" #include "lib/udptransport.h" #include "lib/configuration.h" -#include "store/common/timestamp.h" -#include "store/common/transaction.h" -#include "store.h" +#include "store/weakstore/store.h" #include "store/weakstore/weak-proto.pb.h" namespace weakstore { diff --git a/store/weakstore/shardclient.cc b/store/weakstore/shardclient.cc index 45fc1ec94a97cd63e0c7c4e94cef5a80e487b2a3..7fe97fd9f43969b688b4e960eb6ed48350e4971c 100644 --- a/store/weakstore/shardclient.cc +++ b/store/weakstore/shardclient.cc @@ -31,10 +31,9 @@ #include "store/weakstore/shardclient.h" -using namespace std; - namespace weakstore { +using namespace std; using namespace proto; ShardClient::ShardClient(string configPath, Transport *transport, @@ -133,7 +132,6 @@ ShardClient::Put(uint64_t id, } - // Callbacks that happen in the transport thread void ShardClient::RequestTimedOut() @@ -181,4 +179,5 @@ ShardClient::ReceiveMessage(const TransportAddress &remote, NOT_REACHABLE(); } } + } // namespace weakstore diff --git a/store/weakstore/shardclient.h b/store/weakstore/shardclient.h index 9478dced1fffb473779eb7813270dc31e1816cb7..71764cf9ed195690343c5e057d200faab42166c7 100644 --- a/store/weakstore/shardclient.h +++ b/store/weakstore/shardclient.h @@ -13,14 +13,9 @@ #include "lib/message.h" #include "lib/configuration.h" #include "lib/udptransport.h" -#include "store/common/timestamp.h" -#include "store/common/transaction.h" #include "store/common/frontend/txnclient.h" #include "store/weakstore/weak-proto.pb.h" -#include <set> -#include <thread> - #define COMMIT_RETRIES 5 namespace weakstore { diff --git a/store/weakstore/store.cc b/store/weakstore/store.cc index 540ff4b8a34f63539fa01bfa8076926caa3ae688..bc38fb4cb671824ba42a14454f62fcf5e511374c 100644 --- a/store/weakstore/store.cc +++ b/store/weakstore/store.cc @@ -28,12 +28,12 @@ * **********************************************************************/ -#include "store.h" - -using namespace std; +#include "store/weakstore/store.h" namespace weakstore { +using namespace std; + Store::Store() { } Store::~Store() { } diff --git a/store/weakstore/store.h b/store/weakstore/store.h index 6ca4efc3347405558a17b16c4c261ad2871460f6..b75eda21852bafc049e07de53476a26d297a9314 100644 --- a/store/weakstore/store.h +++ b/store/weakstore/store.h @@ -12,7 +12,6 @@ #include "lib/assert.h" #include "lib/message.h" #include "store/common/backend/kvstore.h" -#include "store/common/timestamp.h" #include "store/common/transaction.h" namespace weakstore {