Commit 522f6fd1 authored by Marc Vef's avatar Marc Vef
Browse files

Merge branch 'dev_backport' into 'master'

towards path resolution

Closes #52

See merge request zdvresearch_bsc/adafs!88

Also tested with benchmark test tool.
parents af8c9be9 17583296
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -87,3 +87,14 @@ test directories:
  artifacts:
    paths:
     - "${LOG_PATH}"

test truncate:
  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_truncate
  artifacts:
    paths:
     - "${LOG_PATH}"
+21 −0
Original line number Diff line number Diff line
find_library(Snappy_LIBRARY
        NAMES snappy
        HINTS ${ADAFS_DEPS_INSTALL}
)

find_path(Snappy_INCLUDE_DIR
    NAMES snappy.h
    HINTS ${ADAFS_DEPS_INSTALL}
)

set(Snappy_LIBRARIES ${Snappy_LIBRARY})
set(Snappy_INCLUDE_DIRS ${Snappy_INCLUDE_DIR})


include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(snappy DEFAULT_MSG Snappy_LIBRARY Snappy_INCLUDE_DIR)

mark_as_advanced(
        Snappy_LIBRARY
        Snappy_INCLUDE_DIR
)

ifs/CMake/Findsnappy.cmake

deleted100644 → 0
+0 −44
Original line number Diff line number Diff line
find_path(snappy_DIR
        HINTS
        /usr
        /usr/local
        /usr/local/adafs/
        ${ADAFS_DEPS_INSTALL}
        )

find_path(snappy_INCLUDE_DIR snappy.h
        HINTS
        ${ADAFS_DEPS_INSTALL}
        $ENV{HOME}/opt
        /usr
        /usr/local
        /usr/local/adafs
        /opt
        PATH_SUFFIXES include
        PATH_SUFFIXES include/snappy
        )

find_library(snappy_LIBRARY snappy
        HINTS
        ${ADAFS_DEPS_INSTALL}
        $ENV{HOME}/opt
        /usr
        /usr/local
        /usr/local/adafs
        /opt/
        PATH_SUFFIXES lib
        PATH_SUFFIXES lib/snappy
        )

set(snappy_INCLUDE_DIRS ${snappy_INCLUDE_DIR})
set(snappy_LIBRARIES ${snappy_LIBRARY})


include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(snappy DEFAULT_MSG snappy_LIBRARY snappy_INCLUDE_DIR)

mark_as_advanced(
        snappy_DIR
        snappy_LIBRARY
        snappy_INCLUDE_DIR
)
+2 −2
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
find_package(LZ4 REQUIRED)
find_package(ZLIB REQUIRED)
find_package(BZip2 REQUIRED)
find_package(snappy REQUIRED)
find_package(Snappy REQUIRED)
find_package(ZStd REQUIRED)
find_package(JeMalloc) # required if rocksdb has been build with jemalloc
find_package(RocksDB REQUIRED)
@@ -69,7 +69,7 @@ target_link_libraries(RocksDB
    INTERFACE
    ${ROCKSDB_LIBRARIES}
    # rocksdb libs
    ${snappy_LIBRARIES}
    ${Snappy_LIBRARIES}
    ${ZLIB_LIBRARIES}
    ${BZIP2_LIBRARIES}
    ${ZSTD_LIBRARIES}
+7 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
#define IFS_CHUNK_STORAGE_HPP

#include <abt.h>
#include <limits.h>
#include <string>
#include <memory>

@@ -18,19 +19,24 @@ class ChunkStorage {
        std::shared_ptr<spdlog::logger> log;

        std::string root_path;
        size_t chunksize;
        inline std::string absolute(const std::string& internal_path) const;
        static inline std::string get_chunks_dir(const std::string& file_path);
        static inline std::string get_chunk_path(const std::string& file_path, unsigned int chunk_id);
        void init_chunk_space(const std::string& file_path) const;

    public:
        ChunkStorage(const std::string& path);
        ChunkStorage(const std::string& path, const size_t chunksize);
        void write_chunk(const std::string& file_path, unsigned int chunk_id,
                         const char * buff, size_t size, off64_t offset,
                         ABT_eventual& eventual) const;
        void read_chunk(const std::string& file_path, unsigned int chunk_id,
                         char * buff, size_t size, off64_t offset,
                         ABT_eventual& eventual) const;
        void trim_chunk_space(const std::string& file_path, unsigned int chunk_start,
                unsigned int chunk_end = UINT_MAX);
        void delete_chunk(const std::string& file_path, unsigned int chunk_id);
        void truncate_chunk(const std::string& file_path, unsigned int chunk_id, off_t length);
        void destroy_chunk_space(const std::string& file_path) const;
};

Loading