mobject-server.h 1.75 KB
Newer Older
1 2 3 4 5 6 7 8 9
/*
 * (C) 2017 The University of Chicago
 *
 * See COPYRIGHT in top-level directory.
 */

#ifndef MOBJECT_SERVER_H
#define MOBJECT_SERVER_H

10
#include <margo.h>
11
#include <ssg.h>
12
#include <bake-client.h>
13
#include <sdskv-client.h>
14
#include <sdskv-server.h>
15 16
/* server-side utilities and routines.  Clients are looking for either
 * libmobject-store.h or librados-mobject-store.h */
17 18 19
#ifdef __cplusplus
extern "C" {
#endif
20

21
#define MOBJECT_SERVER_GROUP_NAME "mobject-store-servers"
22
#define MOBJECT_ABT_POOL_DEFAULT ABT_POOL_NULL
23

24
typedef struct mobject_server_context* mobject_provider_t;
Matthieu Dorier's avatar
Matthieu Dorier committed
25

26 27 28
/**
 * Start a mobject server instance
 *
29
 * @param[in] mid           margo instance id
30
 * @param[in] provider_id   id of the provider
31 32
 * @param[in] pool          Argobots pool for the provider
 * @param[in] bake_ph       Bake provider handle to use to write/read data
33
 * @param[in] sdskv_ph      SDSKV provider handle to use to access metadata
34
 * @param[in] gid           SSG group id of the group gathering all mobject providers
35
 * @param[in] cluster_file  file name to write cluster connect info to
36
 * @param[out] provider     resulting provider
37
 * 
38
 * @returns 0 on success, negative error code on failure
39
 */
40 41
int mobject_provider_register(
        margo_instance_id mid,
42
        uint16_t provider_id,
43 44
        ABT_pool pool,
        bake_provider_handle_t bake_ph,
45
        sdskv_provider_handle_t sdskv_ph,
46
        ssg_group_id_t gid,
47 48
        const char *cluster_file,
        mobject_provider_t* provider);
49

50 51 52 53 54 55 56 57 58 59
/**
 * Helper function that sets up the appropriate databases
 * in a given SDSKV provider. 
 *
 * @param sdskv_prov SDSKV provider
 *
 * @return 0 on success, negative error code on failure
 */
int mobject_sdskv_provider_setup(sdskv_provider_t sdskv_prov);

60 61 62 63
#ifdef __cplusplus
}
#endif

64
#endif