Commit 5d17b351 authored by Matthieu Dorier's avatar Matthieu Dorier

correcting bugs when disabling REMI

parent ab646472
......@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([sds-keyval], [0.1], [robl@mcs.anl.gov])
AC_INIT([sds-keyval], [0.1.4], [robl@mcs.anl.gov])
AM_INIT_AUTOMAKE([1.13.4 -Wall -Werror foreign subdir-objects silent-rules])
AM_SILENT_RULES([yes])
AC_CONFIG_MACRO_DIR([m4])
......@@ -69,6 +69,12 @@ LIBS="$MARGO_LIBS $LIBS"
CPPFLAGS="$MARGO_CFLAGS $CPPFLAGS"
CFLAGS="$MARGO_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([ABTIO],[abt-io],[],
AC_MSG_ERROR([Could not find working abt-io installation!]) )
LIBS="$ABTIO_LIBS $LIBS"
CPPFLAGS="$ABTIO_CFLAGS $CPPFLAGS"
CFLAGS="$ABTIO_CFLAGS $CFLAGS"
SERVER_DEPS_PKG=""
#PKG_CHECK_MODULES([SSG], [ssg], [],
......@@ -166,6 +172,7 @@ AM_CONDITIONAL(ENABLE_REMI, test x$enable_remi = xyes)
if test "$enable_remi" = "yes"; then
PKG_CHECK_MODULES(REMI, remi)
AC_DEFINE(USE_REMI, 1, [REMI support enabled.])
SERVER_DEPS_PKG="${SERVER_DEPS_PKG} remi"
USE_REMI=1
LIBS="$REMI_LIBS $LIBS"
CPPFLAGS="$REMI_CFLAGS $CPPFLAGS"
......
......@@ -56,6 +56,24 @@ int sdskv_provider_handle_create(
uint16_t provider_id,
sdskv_provider_handle_t* handle);
/**
* @brief Retrieves the information (string address and provider id)
* from a provider handle. If any argument is NULL, the corresponding
* field will be ignored.
*
* @param[in] ph Provider handle.
* @param[inout] client Client.
* @param[inout] addr Address.
* @param[inout] provider_id
*
* @return SDSKV_SUCCESS or error code defined in sdskv-common.h
*/
int sdskv_provider_handle_get_info(
sdskv_provider_handle_t ph,
sdskv_client_t* client,
hg_addr_t* addr,
uint16_t* provider_id);
/**
* @brief Increments the reference counter of a provider handle.
*
......@@ -449,7 +467,7 @@ int sdskv_migrate_keys(
uint16_t target_provider_id,
sdskv_database_id_t target_db_id,
hg_size_t num_keys,
const void** keys,
const void* const* keys,
const hg_size_t* key_sizes,
int flag);
......
......@@ -20,6 +20,7 @@ typedef uint64_t sdskv_database_id_t;
#define SDSKV_KEEP_ORIGINAL 0 /* for migration operations, keep original */
#define SDSKV_REMOVE_ORIGINAL 1 /* for migration operations, remove the origin after migrating */
/* Note: the values below are used in sdskv-common.hpp, do not change them! */
#define SDSKV_SUCCESS 0 /* Success */
#define SDSKV_ERR_ALLOCATION -1 /* Error allocating something */
#define SDSKV_ERR_INVALID_ARG -2 /* An argument is invalid */
......
......@@ -5,7 +5,7 @@ includedir=@includedir@
Name: sdskv-client
Description: services-based keyval client
Version: 0.1
Version: 0.1.4
URL: https://xgitlab.cels.anl.gov/sds/sds-keyval
Requires: margo
Libs: -L${libdir} -lsdskv-client
......
......@@ -5,8 +5,8 @@ includedir=@includedir@
Name: sdskv-server
Description: services-based keyval server
Version: 0.1
Version: 0.1.4
URL: https://xgitlab.cels.anl.gov/sds/sds-keyval
Requires: margo remi @SERVER_DEPS_PKG@
Requires: margo abt-io @SERVER_DEPS_PKG@
Libs: -L${libdir} -lsdskv-server @SERVER_LIBS_EXT@
Cflags: -I${includedir}
......@@ -382,6 +382,7 @@ int BerkeleyDBDataStore::compkeys(Db *db, const Dbt *dbt1, const Dbt *dbt2, size
}
}
#ifdef USE_REMI
remi_fileset_t BerkeleyDBDataStore::create_and_populate_fileset() const {
remi_fileset_t fileset = REMI_FILESET_NULL;
std::string local_root = _path;
......@@ -399,3 +400,4 @@ remi_fileset_t BerkeleyDBDataStore::create_and_populate_fileset() const {
}
return fileset;
}
#endif
......@@ -40,7 +40,9 @@ class BerkeleyDBDataStore : public AbstractDataStore {
_no_overwrite = true;
}
virtual void sync();
remi_fileset_t create_and_populate_fileset() const;
#ifdef USE_REMI
virtual remi_fileset_t create_and_populate_fileset() const;
#endif
protected:
virtual std::vector<ds_bulk_t> vlist_keys(
const ds_bulk_t &start, size_t count, const ds_bulk_t &prefix) const;
......
......@@ -5,7 +5,10 @@
#include "kv-config.h"
#include "bulk.h"
#include <margo.h>
#ifdef USE_REMI
#include "remi/remi-common.h"
#endif
#include <vector>
......@@ -29,7 +32,10 @@ class AbstractDataStore {
virtual void set_comparison_function(const std::string& name, comparator_fn less)=0;
virtual void set_no_overwrite()=0;
virtual void sync() = 0;
#ifdef USE_REMI
virtual remi_fileset_t create_and_populate_fileset() const = 0;
#endif
const std::string& get_path() const {
return _path;
......
......@@ -242,6 +242,7 @@ std::vector<std::pair<ds_bulk_t,ds_bulk_t>> LevelDBDataStore::vlist_keyval_range
return result;
}
#ifdef USE_REMI
remi_fileset_t LevelDBDataStore::create_and_populate_fileset() const {
remi_fileset_t fileset = REMI_FILESET_NULL;
std::string local_root = _path;
......@@ -258,3 +259,4 @@ remi_fileset_t LevelDBDataStore::create_and_populate_fileset() const {
}
return fileset;
}
#endif
......@@ -53,7 +53,9 @@ class LevelDBDataStore : public AbstractDataStore {
_no_overwrite = true;
}
virtual void sync();
remi_fileset_t create_and_populate_fileset() const;
#ifdef USE_REMI
virtual remi_fileset_t create_and_populate_fileset() const;
#endif
protected:
virtual std::vector<ds_bulk_t> vlist_keys(
const ds_bulk_t &start, size_t count, const ds_bulk_t &prefix) const;
......
......@@ -115,9 +115,11 @@ class MapDataStore : public AbstractDataStore {
_no_overwrite = true;
}
remi_fileset_t create_and_populate_fileset() const {
#ifdef USE_REMI
virtual remi_fileset_t create_and_populate_fileset() const {
return REMI_FILESET_NULL;
}
#endif
protected:
......
......@@ -180,6 +180,24 @@ int sdskv_provider_handle_create(
return SDSKV_SUCCESS;
}
int sdskv_provider_handle_get_info(
sdskv_provider_handle_t ph,
sdskv_client_t* client,
hg_addr_t* addr,
uint16_t* provider_id) {
if(ph) {
if(client) *client = ph->client;
if(addr) *addr = ph->addr;
if(provider_id) *provider_id = ph->provider_id;
} else {
if(client) *client = SDSKV_CLIENT_NULL;
if(addr) *addr = HG_ADDR_NULL;
if(provider_id) *provider_id = 0;
}
return SDSKV_SUCCESS;
}
int sdskv_provider_handle_ref_incr(
sdskv_provider_handle_t handle)
{
......@@ -1345,7 +1363,7 @@ int sdskv_migrate_keys(
uint16_t target_provider_id,
sdskv_database_id_t target_db_id,
hg_size_t num_keys,
const void** keys,
const void* const* keys,
const hg_size_t* key_sizes,
int flag)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment