Commit a21b705b authored by Ramon Nou's avatar Ramon Nou
Browse files

Added network data compression

parent 64181971
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -596,6 +596,7 @@ Client-metrics require the CMake argument `-DGKFS_ENABLE_CLIENT_METRICS=ON` (see
- `LIBGKFS_CREATE_WRITE_OPTIMIZATION` - Optimization for write operations (default: OFF).
- `LIBGKFS_READ_INLINE_PREFETCH` - Prefetch inline data when opening files (default: OFF).
- `LIBGKFS_USE_DIRENTS_COMPRESSION` - Enable compression for directory entries (default: OFF).
- `LIBGKFS_DATA_COMPRESSION` - Enable compression for data transfer (default: OFF).
- `LIBGKFS_DIRENTS_BUFF_SIZE` - Buffer size for directory entries (default: 8MB).

#### Caching
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ static constexpr auto RANGE_FD = ADD_PREFIX("RANGE_FD");
static constexpr auto DIRENTS_BUFF_SIZE = ADD_PREFIX("DIRENTS_BUFF_SIZE");
static constexpr auto USE_DIRENTS_COMPRESSION =
        ADD_PREFIX("USE_DIRENTS_COMPRESSION");
static constexpr auto DATA_COMPRESSION = ADD_PREFIX("DATA_COMPRESSION");

static constexpr auto NUM_REPL = ADD_PREFIX("NUM_REPL");
static constexpr auto PROXY_PID_FILE = ADD_PREFIX("PROXY_PID_FILE");
+7 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ private:
    std::bitset<MAX_USER_FDS> protected_fds_;
    std::string hostname;
    int replicas_;
    bool use_compression_{false};

    bool protect_fds_{false};
    bool protect_files_generator_{false};
@@ -326,6 +327,12 @@ public:
    int
    get_replicas();

    bool
    use_compression() const;

    void
    enable_compression(bool enable);

    bool
    protect_fds() const;

+10 −0
Original line number Diff line number Diff line
@@ -59,6 +59,16 @@ forward_read(const std::string& path, void* buf, off64_t offset,
             size_t read_size, const int8_t num_copies,
             std::set<int8_t>& failed);

std::pair<int, ssize_t>
forward_write_compressed(const std::string& path, const void* buf,
                         off64_t offset, size_t write_size,
                         const int8_t num_copy = 0);

std::pair<int, ssize_t>
forward_read_compressed(const std::string& path, void* buf, off64_t offset,
                        size_t read_size, const int8_t num_copies,
                        std::set<int8_t>& failed);

int
forward_truncate(const std::string& path, size_t current_size, size_t new_size,
                 const int8_t num_copies);
+2 −0
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@ constexpr auto rename = "rpc_srv_rename";

constexpr auto write = "rpc_srv_write_data";
constexpr auto read = "rpc_srv_read_data";
constexpr auto write_compressed = "rpc_srv_write_data_compressed";
constexpr auto read_compressed = "rpc_srv_read_data_compressed";
constexpr auto truncate = "rpc_srv_trunc_data";
constexpr auto get_chunk_stat = "rpc_srv_chunk_stat";
// IPC communication between client and proxy
Loading