LCOV - code coverage report
Current view: top level - src/daemon/classes - fs_data.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 114 132 86.4 %
Date: 2024-04-23 00:09:24 Functions: 46 52 88.5 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   Copyright 2018-2024, Barcelona Supercomputing Center (BSC), Spain
       3             :   Copyright 2015-2024, Johannes Gutenberg Universitaet Mainz, Germany
       4             : 
       5             :   This software was partially supported by the
       6             :   EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).
       7             : 
       8             :   This software was partially supported by the
       9             :   ADA-FS project under the SPPEXA project funded by the DFG.
      10             : 
      11             :   This file is part of GekkoFS.
      12             : 
      13             :   GekkoFS is free software: you can redistribute it and/or modify
      14             :   it under the terms of the GNU General Public License as published by
      15             :   the Free Software Foundation, either version 3 of the License, or
      16             :   (at your option) any later version.
      17             : 
      18             :   GekkoFS is distributed in the hope that it will be useful,
      19             :   but WITHOUT ANY WARRANTY; without even the implied warranty of
      20             :   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      21             :   GNU General Public License for more details.
      22             : 
      23             :   You should have received a copy of the GNU General Public License
      24             :   along with GekkoFS.  If not, see <https://www.gnu.org/licenses/>.
      25             : 
      26             :   SPDX-License-Identifier: GPL-3.0-or-later
      27             : */
      28             : 
      29             : #include <daemon/classes/fs_data.hpp>
      30             : #include <daemon/backend/metadata/db.hpp>
      31             : 
      32             : #include <spdlog/spdlog.h>
      33             : 
      34             : namespace gkfs::daemon {
      35             : 
      36             : // getter/setter
      37             : 
      38             : const std::shared_ptr<spdlog::logger>&
      39        7100 : FsData::spdlogger() const {
      40        7100 :     return spdlogger_;
      41             : }
      42             : 
      43             : void
      44          33 : FsData::spdlogger(const std::shared_ptr<spdlog::logger>& spdlogger) {
      45          33 :     FsData::spdlogger_ = spdlogger;
      46          33 : }
      47             : 
      48             : const std::shared_ptr<gkfs::metadata::MetadataDB>&
      49        2615 : FsData::mdb() const {
      50        2615 :     return mdb_;
      51             : }
      52             : 
      53             : void
      54          33 : FsData::mdb(const std::shared_ptr<gkfs::metadata::MetadataDB>& mdb) {
      55          33 :     mdb_ = mdb;
      56          33 : }
      57             : 
      58             : void
      59          33 : FsData::close_mdb() {
      60          33 :     mdb_.reset();
      61          33 : }
      62             : 
      63             : const std::shared_ptr<gkfs::data::ChunkStorage>&
      64         186 : FsData::storage() const {
      65         186 :     return storage_;
      66             : }
      67             : 
      68             : void
      69          33 : FsData::storage(const std::shared_ptr<gkfs::data::ChunkStorage>& storage) {
      70          33 :     storage_ = storage;
      71          33 : }
      72             : 
      73             : const std::string&
      74         281 : FsData::rootdir() const {
      75         281 :     return rootdir_;
      76             : }
      77             : 
      78             : void
      79          33 : FsData::rootdir(const std::string& rootdir) {
      80          33 :     FsData::rootdir_ = rootdir;
      81          33 : }
      82             : 
      83             : const std::string&
      84          33 : FsData::rootdir_suffix() const {
      85          33 :     return rootdir_suffix_;
      86             : }
      87             : 
      88             : void
      89           0 : FsData::rootdir_suffix(const std::string& rootdir_suffix) {
      90           0 :     FsData::rootdir_suffix_ = rootdir_suffix;
      91           0 : }
      92             : 
      93             : const std::string&
      94         281 : FsData::mountdir() const {
      95         281 :     return mountdir_;
      96             : }
      97             : 
      98             : void
      99          33 : FsData::mountdir(const std::string& mountdir) {
     100          33 :     FsData::mountdir_ = mountdir;
     101          33 : }
     102             : 
     103             : const std::string&
     104          33 : FsData::metadir() const {
     105          33 :     return metadir_;
     106             : }
     107             : 
     108             : void
     109          33 : FsData::metadir(const std::string& metadir) {
     110          33 :     FsData::metadir_ = metadir;
     111          33 : }
     112             : 
     113             : std::string_view
     114          33 : FsData::dbbackend() const {
     115          33 :     return dbbackend_;
     116             : }
     117             : 
     118             : void
     119          33 : FsData::dbbackend(const std::string& dbbackend) {
     120          33 :     FsData::dbbackend_ = dbbackend;
     121          33 : }
     122             : 
     123             : const std::string&
     124          33 : FsData::rpc_protocol() const {
     125          33 :     return rpc_protocol_;
     126             : }
     127             : 
     128             : void
     129          33 : FsData::rpc_protocol(const std::string& rpc_protocol) {
     130          33 :     rpc_protocol_ = rpc_protocol;
     131          33 : }
     132             : 
     133             : const std::string&
     134          66 : FsData::bind_addr() const {
     135          66 :     return bind_addr_;
     136             : }
     137             : 
     138             : void
     139          33 : FsData::bind_addr(const std::string& addr) {
     140          33 :     bind_addr_ = addr;
     141          33 : }
     142             : 
     143             : const std::string&
     144         132 : FsData::hosts_file() const {
     145         132 :     return hosts_file_;
     146             : }
     147             : 
     148             : void
     149          33 : FsData::hosts_file(const std::string& lookup_file) {
     150          33 :     hosts_file_ = lookup_file;
     151          33 : }
     152             : 
     153             : bool
     154          33 : FsData::use_auto_sm() const {
     155          33 :     return use_auto_sm_;
     156             : }
     157             : 
     158             : void
     159          33 : FsData::use_auto_sm(bool use_auto_sm) {
     160          33 :     use_auto_sm_ = use_auto_sm;
     161          33 : }
     162             : 
     163             : bool
     164        2448 : FsData::atime_state() const {
     165        2448 :     return atime_state_;
     166             : }
     167             : 
     168             : void
     169          33 : FsData::atime_state(bool atime_state) {
     170          33 :     FsData::atime_state_ = atime_state;
     171          33 : }
     172             : 
     173             : bool
     174        1348 : FsData::mtime_state() const {
     175        1348 :     return mtime_state_;
     176             : }
     177             : 
     178             : void
     179          33 : FsData::mtime_state(bool mtime_state) {
     180          33 :     FsData::mtime_state_ = mtime_state;
     181          33 : }
     182             : 
     183             : bool
     184        1348 : FsData::ctime_state() const {
     185        1348 :     return ctime_state_;
     186             : }
     187             : 
     188             : void
     189          33 : FsData::ctime_state(bool ctime_state) {
     190          33 :     FsData::ctime_state_ = ctime_state;
     191          33 : }
     192             : 
     193             : bool
     194         248 : FsData::link_cnt_state() const {
     195         248 :     return link_cnt_state_;
     196             : }
     197             : 
     198             : void
     199          33 : FsData::link_cnt_state(bool link_cnt_state) {
     200          33 :     FsData::link_cnt_state_ = link_cnt_state;
     201          33 : }
     202             : 
     203             : bool
     204         248 : FsData::blocks_state() const {
     205         248 :     return blocks_state_;
     206             : }
     207             : 
     208             : void
     209          33 : FsData::blocks_state(bool blocks_state) {
     210          33 :     FsData::blocks_state_ = blocks_state;
     211          33 : }
     212             : 
     213             : unsigned long long
     214           0 : FsData::parallax_size_md() const {
     215           0 :     return parallax_size_md_;
     216             : }
     217             : 
     218             : void
     219           0 : FsData::parallax_size_md(unsigned int size_md) {
     220           0 :     FsData::parallax_size_md_ = static_cast<unsigned long long>(
     221           0 :             size_md * 1024ull * 1024ull * 1024ull);
     222           0 : }
     223             : 
     224             : const std::shared_ptr<gkfs::utils::Stats>&
     225        2692 : FsData::stats() const {
     226        2692 :     return stats_;
     227             : }
     228             : 
     229             : void
     230          33 : FsData::stats(const std::shared_ptr<gkfs::utils::Stats>& stats) {
     231          33 :     FsData::stats_ = stats;
     232          33 : }
     233             : 
     234             : void
     235          33 : FsData::close_stats() {
     236          33 :     stats_.reset();
     237          33 : }
     238             : 
     239             : bool
     240        2584 : FsData::enable_stats() const {
     241        2584 :     return enable_stats_;
     242             : }
     243             : 
     244             : void
     245          33 : FsData::enable_stats(bool enable_stats) {
     246          33 :     FsData::enable_stats_ = enable_stats;
     247          33 : }
     248             : 
     249             : bool
     250         207 : FsData::enable_chunkstats() const {
     251         207 :     return enable_chunkstats_;
     252             : }
     253             : 
     254             : void
     255          33 : FsData::enable_chunkstats(bool enable_chunkstats) {
     256          33 :     FsData::enable_chunkstats_ = enable_chunkstats;
     257          33 : }
     258             : 
     259             : bool
     260          33 : FsData::enable_forwarding() const {
     261          33 :     return enable_forwarding_;
     262             : }
     263             : 
     264             : void
     265           0 : FsData::enable_forwarding(bool enable_forwarding) {
     266           0 :     FsData::enable_forwarding_ = enable_forwarding;
     267           0 : }
     268             : bool
     269          33 : FsData::enable_prometheus() const {
     270          33 :     return enable_prometheus_;
     271             : }
     272             : 
     273             : void
     274           0 : FsData::enable_prometheus(bool enable_prometheus) {
     275           0 :     FsData::enable_prometheus_ = enable_prometheus;
     276           0 : }
     277             : 
     278             : const std::string&
     279          33 : FsData::stats_file() const {
     280          33 :     return stats_file_;
     281             : }
     282             : 
     283             : void
     284          33 : FsData::stats_file(const std::string& stats_file) {
     285          33 :     FsData::stats_file_ = stats_file;
     286          33 : }
     287             : 
     288             : const std::string&
     289          33 : FsData::prometheus_gateway() const {
     290          33 :     return prometheus_gateway_;
     291             : }
     292             : 
     293             : void
     294           0 : FsData::prometheus_gateway(const std::string& prometheus_gateway) {
     295           0 :     FsData::prometheus_gateway_ = prometheus_gateway;
     296           0 : }
     297             : 
     298             : } // namespace gkfs::daemon

Generated by: LCOV version 1.16