Commit a9b4c16b authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Merge branch 'dev_backport_2' into 'master'

Path resolution

Closes #56

See merge request zdvresearch_bsc/adafs!91
parents 420f5da1 76fc9521
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -98,3 +98,14 @@ test truncate:
  artifacts:
    paths:
     - "${LOG_PATH}"

test path resolution:
  stage: test
  script:
    - mkdir -p "${LOG_PATH}"
    - ${BUILD_PATH}/bin/adafs_daemon --mount /tmp/mountdir --root /tmp/adafs_root &
    - sleep 4
    - LD_PRELOAD=${BUILD_PATH}/lib/libadafs_preload_client.so ${TESTS_BUILD_PATH}/ifs_test_path_resolution
  artifacts:
    paths:
     - "${LOG_PATH}"
+6 −6
Original line number Diff line number Diff line
# Finds liblz4.
#
# This module defines:
# LZ4_FOUND
# LZ4_INCLUDE_DIR
# LZ4_LIBRARY

# - Find Lz4
# Find the lz4 compression library and includes
#
# LZ4_FOUND - True if lz4 found.
# LZ4_LIBRARIES - List of libraries when using lz4.
# LZ4_INCLUDE_DIR - where to find lz4.h, etc.

find_path(LZ4_INCLUDE_DIR
    NAMES lz4.h
+5 −4
Original line number Diff line number Diff line
@@ -18,10 +18,11 @@ ENDIF (NOT CMAKE_BUILD_TYPE)
message("* Current build type is : ${CMAKE_BUILD_TYPE}")

# Compiler flags for various cmake build types
set(WARNINGS_FLAGS "-Wall -Wextra --pedantic -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O3")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall --pedantic -g -O0")
set(CMAKE_CXX_FLAGS_MEMCHECK "-Wall --pedantic -g -O0 -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_MAINTAINER "-Wall --pedantic -g -O0 -pg -no-pie")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${WARNINGS_FLAGS} -g -O0")
set(CMAKE_CXX_FLAGS_MEMCHECK "${WARNINGS_FLAGS} -g -O0 -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_MAINTAINER "${WARNINGS_FLAGS} -g -O0 -pg -no-pie")
mark_as_advanced(CMAKE_CXX_FLAGS_MAINTAINER)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
@@ -73,7 +74,7 @@ target_link_libraries(RocksDB
    ${ZLIB_LIBRARIES}
    ${BZIP2_LIBRARIES}
    ${ZSTD_LIBRARIES}
    ${LZ4_LIBRARY}
    ${LZ4_LIBRARIES}
)

if(${JeMalloc_FOUND})
+4 −4
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ class MergeOperand {
    protected:
        std::string serialize_id() const;
        virtual std::string serialize_params() const = 0;
        virtual const OperandID id() const = 0;
        virtual OperandID id() const = 0;
};

class IncreaseSizeOperand: public MergeOperand {
@@ -38,7 +38,7 @@ class IncreaseSizeOperand: public MergeOperand {
        IncreaseSizeOperand(const size_t size, const bool append);
        IncreaseSizeOperand(const rdb::Slice& serialized_op);

        const OperandID id() const override;
        OperandID id() const override;
        std::string serialize_params() const override;
};

@@ -49,7 +49,7 @@ class DecreaseSizeOperand: public MergeOperand {
        DecreaseSizeOperand(const size_t size);
        DecreaseSizeOperand(const rdb::Slice& serialized_op);

        const OperandID id() const override;
        OperandID id() const override;
        std::string serialize_params() const override;
};

@@ -58,7 +58,7 @@ class CreateOperand: public MergeOperand {
        std::string metadata;
        CreateOperand(const std::string& metadata);

        const OperandID id() const override;
        OperandID id() const override;
        std::string serialize_params() const override;
};

+8 −1
Original line number Diff line number Diff line
@@ -2,12 +2,19 @@
#define IFS_PATH_UTIL_HPP

#include <string>
#include <vector>

constexpr unsigned int PATH_MAX_LEN = 4096; // 4k chars

constexpr char PSP = '/'; // PATH SEPARATOR


bool is_relative_path(const std::string& path);
bool is_absolute_path(const std::string& path);
bool has_trailing_slash(const std::string& path);

std::string path_to_relative(const std::string& root_path, const std::string& complete_path);
std::string prepend_path(const std::string& path, const char * raw_path);
std::string dirname(const std::string& path);
std::vector<std::string> split_path(const std::string& path);

#endif //IFS_PATH_UTIL_HPP
Loading