From 022b44fd949c09fc83b4aeb9c8227a4b886a3e48 Mon Sep 17 00:00:00 2001 From: "Naveen Kr. Sharma" <naveenks@cs.washington.edu> Date: Wed, 4 Jan 2017 10:52:12 -0800 Subject: [PATCH] fixing header files and includes --- store/common/backend/kvstore.cc | 2 +- store/common/backend/kvstore.h | 3 --- store/common/backend/lockserver.cc | 2 +- store/common/backend/lockserver.h | 2 +- store/common/backend/txnstore.h | 11 +---------- store/common/backend/versionstore.cc | 2 +- store/common/backend/versionstore.h | 3 --- store/common/frontend/bufferclient.cc | 2 +- store/common/frontend/bufferclient.h | 4 +--- store/common/frontend/client.h | 1 + store/common/promise.cc | 2 +- store/common/promise.h | 3 ++- store/common/timestamp.cc | 2 +- store/common/tracer.cc | 2 +- store/common/tracer.h | 2 +- store/common/transaction.cc | 2 +- store/common/transaction.h | 2 +- store/common/truetime.cc | 2 +- store/common/truetime.h | 2 +- store/strongstore/client.cc | 2 +- store/strongstore/client.h | 5 +---- store/strongstore/lockstore.cc | 2 +- store/strongstore/lockstore.h | 4 ---- store/strongstore/occstore.cc | 6 +++--- store/strongstore/occstore.h | 4 ---- store/strongstore/server.cc | 7 +++---- store/strongstore/shardclient.cc | 3 +-- store/strongstore/shardclient.h | 6 +----- store/tapirstore/client.h | 6 ------ store/tapirstore/server.h | 1 - store/tapirstore/shardclient.cc | 3 +-- store/tapirstore/shardclient.h | 1 + store/tapirstore/store.h | 1 - store/weakstore/client.h | 2 -- store/weakstore/server.cc | 2 +- store/weakstore/server.h | 4 +--- store/weakstore/shardclient.cc | 5 ++--- store/weakstore/shardclient.h | 5 ----- store/weakstore/store.cc | 6 +++--- store/weakstore/store.h | 1 - 40 files changed, 38 insertions(+), 89 deletions(-) diff --git a/store/common/backend/kvstore.cc b/store/common/backend/kvstore.cc index 5f388bf..1e876ea 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 5a74707..9bdae9e 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 5c9edfc..4c80f80 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 16112e2..6609c74 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 c399590..7650ab5 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 ba2db9e..8a3484c 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 3443687..d5e4154 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 e8783ef..c1c82da 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 bf24f57..b40895c 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 224ed5e..555da34 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 c2068ed..49402d1 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 5ba3d60..b97df48 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 c263a61..6810aa5 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 e82b29e..0dbd854 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 d543b28..3da22de 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 6bd27b4..ed566a1 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 1b1ca5e..be3dac8 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 1f7047c..2293fe2 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 1b1115c..771622a 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 125db34..3827bf2 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 8a6a6ab..07788c3 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 433641a..c5438d2 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 0b2808a..5b39abd 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 9b22a90..161dac3 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 c73aa98..61e8dd3 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 9a72139..ae2ad46 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 241a84b..ba1f1cc 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 9cc2014..8dea5f9 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 39e6da2..42c44b1 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 f484344..217d38f 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 bfd71e5..de9e2f9 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 ec85d1c..0d3cd29 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 b722b0a..27dce81 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 b4970cb..5c220d0 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 6a9d5f7..cec1351 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 78b8e83..97e61ee 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 45fc1ec..7fe97fd 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 9478dce..71764cf 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 540ff4b..bc38fb4 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 6ca4efc..b75eda2 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 { -- GitLab