Commit 72fe3341 authored by Ramon Nou's avatar Ramon Nou
Browse files

Added Redis set

parent 7944ed3e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -167,6 +167,15 @@ option(SCORD_BUILD_EXAMPLES "Build examples (disabled by default)" OFF)

option(SCORD_BUILD_TESTS "Build tests (disabled by default)" OFF)

### REDIS_ADDRESS
set(REDIS_ADDRESS
  "tcp://127.0.0.1:6379"
  CACHE STRING
  "Define a redis address (default: tcp://127.0.0.1:6379)"
)

message(STATUS "[${PROJECT_NAME}] Redis address: ${REDIS_ADDRESS}")

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# ##############################################################################
@@ -305,6 +314,8 @@ find_package(RedisPlusPlus 1.3.3 REQUIRED)
message(STATUS "[${PROJECT_NAME}] Checking for Cargo")
find_package(Cargo 0.3.1 REQUIRED)

message(STATUS "[${PROJECT_NAME}] Checking for Hiredis")
find_package(hiredis REQUIRED)

# ##############################################################################
# Process subdirectories
+3 −0
Original line number Diff line number Diff line
@@ -11,3 +11,6 @@ global_settings:

  # address to bind to
  address: "@SCORD_TRANSPORT_PROTOCOL@://@SCORD_BIND_ADDRESS@:@SCORD_BIND_PORT@"

  # redis connection
  redisaddress : "@REDIS_ADDRESS@"
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -11,3 +11,6 @@ global_settings:

  # address to bind to
  address: "@SCORD_TRANSPORT_PROTOCOL@://@SCORD_BIND_ADDRESS@:@SCORD_BIND_PORT@"

  # redis connection
  redisaddress : "@REDIS_ADDRESS@"
 No newline at end of file
+6 −4
Original line number Diff line number Diff line
@@ -303,6 +303,8 @@ struct adhoc_storage {
    name() const;
    type
    type() const;
    std::string
    type_tostr() const;
    std::uint64_t
    id() const;
    adhoc_storage::ctx const&
+17 −0
Original line number Diff line number Diff line
@@ -867,6 +867,23 @@ adhoc_storage::type() const {
    return m_pimpl->type();
}

std::string
adhoc_storage::type_tostr() const {
    switch(m_pimpl->type()) {
        case adhoc_storage::type::hercules:
            return "Hercules";
        case adhoc_storage::type::dataclay:
            return "DataClay";
        case adhoc_storage::type::gekkofs:
            return "GekkoFS";
        case adhoc_storage::type::expand:
            return "Expand";
        default:
            return "Unknown";
    }
    return "Unknown";
}

std::uint64_t
adhoc_storage::id() const {
    return m_pimpl->id();
Loading