diff --git a/src/basic.c b/src/basic.c index 57f4abc..64715db 100644 --- a/src/basic.c +++ b/src/basic.c @@ -1,8 +1,10 @@ #if defined(MAIN_SIMULATION) || defined(MAIN_TEST) #define QUAKEY_ENABLE_MOCKS #endif + #include #include + #include "basic.h" bool streq(string s1, string s2) diff --git a/src/chunk_server.c b/src/chunk_server.c index 7bef118..cae6d81 100644 --- a/src/chunk_server.c +++ b/src/chunk_server.c @@ -6,13 +6,13 @@ #include #include -#include "sha256.h" -#include "file_system.h" -#include "hash_set.h" -#include "config.h" #include "tcp.h" +#include "sha256.h" +#include "config.h" #include "message.h" +#include "hash_set.h" #include "byte_queue.h" +#include "file_system.h" #include "chunk_server.h" static string hash2path(ChunkServer *state, SHA256 hash, char *out) diff --git a/src/chunk_server.h b/src/chunk_server.h index b35f59d..8d374b4 100644 --- a/src/chunk_server.h +++ b/src/chunk_server.h @@ -1,6 +1,10 @@ #ifndef CHUNK_SERVER_INCLUDED #define CHUNK_SERVER_INCLUDED +#include "tcp.h" +#include "basic.h" +#include "hash_set.h" + #define TAG_METADATA_SERVER 1 #define TAG_CHUNK_SERVER 2 diff --git a/src/config.h b/src/config.h index 47c83fa..b170d3a 100644 --- a/src/config.h +++ b/src/config.h @@ -5,13 +5,9 @@ #define MAX_CHUNK_SERVERS 128 #define MAX_OPERATIONS 128 #define MAX_REQUESTS_PER_QUEUE 128 - #define REPLICATION_FACTOR 3 - - #define SYNC_INTERVAL 10 #define RESPONSE_TIME_LIMIT 90 - #define DELETION_TIMEOUT 30 #endif // CONFIG_INCLUDED diff --git a/src/file_system.c b/src/file_system.c index 4b2ff47..469566d 100644 --- a/src/file_system.c +++ b/src/file_system.c @@ -1,6 +1,7 @@ #if defined(MAIN_SIMULATION) || defined(MAIN_TEST) #define QUAKEY_ENABLE_MOCKS #endif + #include #include diff --git a/src/file_system.h b/src/file_system.h index 298a32a..f987b42 100644 --- a/src/file_system.h +++ b/src/file_system.h @@ -4,8 +4,10 @@ #if defined(MAIN_SIMULATION) || defined(MAIN_TEST) #define QUAKEY_ENABLE_MOCKS #endif + #include #include + #include "basic.h" typedef struct { diff --git a/src/hash_set.c b/src/hash_set.c index f0ade33..c10f085 100644 --- a/src/hash_set.c +++ b/src/hash_set.c @@ -1,8 +1,10 @@ #if defined(MAIN_SIMULATION) || defined(MAIN_TEST) #define QUAKEY_ENABLE_MOCKS #endif + #include #include + #include "hash_set.h" void hash_set_init(HashSet *set) diff --git a/src/main.c b/src/main.c index c48d3a2..68e52c1 100644 --- a/src/main.c +++ b/src/main.c @@ -3,12 +3,13 @@ #else #define POLL_CAPACITY 1024 #endif + #include #include -#include "metadata_server.h" #include "chunk_server.h" #include "random_client.h" +#include "metadata_server.h" #ifdef MAIN_METADATA_SERVER int main(int argc, char **argv) diff --git a/src/message.c b/src/message.c index 5b9391e..b1d2346 100644 --- a/src/message.c +++ b/src/message.c @@ -1,8 +1,10 @@ #if defined(MAIN_SIMULATION) || defined(MAIN_TEST) #define QUAKEY_ENABLE_MOCKS #endif + #include #include + #include "message.h" bool binary_read(BinaryReader *reader, void *dst, int len) diff --git a/src/message.h b/src/message.h index 71aacd8..5c4851f 100644 --- a/src/message.h +++ b/src/message.h @@ -4,8 +4,10 @@ #if defined(MAIN_SIMULATION) || defined(MAIN_TEST) #define QUAKEY_ENABLE_MOCKS #endif + #include #include + #include "basic.h" #include "byte_queue.h" diff --git a/src/metadata_server.h b/src/metadata_server.h index dad2c68..60aa9e3 100644 --- a/src/metadata_server.h +++ b/src/metadata_server.h @@ -3,10 +3,10 @@ #include "tcp.h" #include "wal.h" -#include "file_tree.h" -#include "config.h" #include "basic.h" +#include "config.h" #include "hash_set.h" +#include "file_tree.h" #define CONNECTION_TAG_CLIENT -2 #define CONNECTION_TAG_UNKNOWN -3 diff --git a/src/tcp.c b/src/tcp.c index da811ad..b922b66 100644 --- a/src/tcp.c +++ b/src/tcp.c @@ -1,4 +1,3 @@ - #if defined(MAIN_SIMULATION) || defined(MAIN_TEST) #define QUAKEY_ENABLE_MOCKS #endif diff --git a/src/wal.c b/src/wal.c index 967b2c2..a4077da 100644 --- a/src/wal.c +++ b/src/wal.c @@ -7,8 +7,8 @@ #include #include "wal.h" -#include "file_system.h" #include "file_tree.h" +#include "file_system.h" #define WAL_MAGIC 0xcafebebe #define WAL_VERSION 1