mobject-server.h 1.63 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 <bake-client.h>
Matthieu Dorier's avatar
Matthieu Dorier committed
12
#include <sdskv-client.h>
Matthieu Dorier's avatar
Matthieu Dorier committed
13
#include <sdskv-server.h>
14 15
/* server-side utilities and routines.  Clients are looking for either
 * libmobject-store.h or librados-mobject-store.h */
16 17 18
#ifdef __cplusplus
extern "C" {
#endif
19

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

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

25 26 27
/**
 * Start a mobject server instance
 *
28
 * @param[in] mid           margo instance id
29 30 31
 * @param[in] mplex_id      multiplex id of the provider
 * @param[in] pool          Argobots pool for the provider
 * @param[in] bake_ph       Bake provider handle to use to write/read data
Matthieu Dorier's avatar
Matthieu Dorier committed
32
 * @param[in] sdskv_ph      SDSKV provider handle to use to access metadata
33
 * @param[in] cluster_file  file name to write cluster connect info to
34
 * @param[out] provider     resulting provider
35
 * 
36
 * @returns 0 on success, negative error code on failure
37
 */
38 39 40 41 42
int mobject_provider_register(
        margo_instance_id mid,
        uint8_t mplex_id,
        ABT_pool pool,
        bake_provider_handle_t bake_ph,
Matthieu Dorier's avatar
Matthieu Dorier committed
43
        sdskv_provider_handle_t sdskv_ph,
44 45
        const char *cluster_file,
        mobject_provider_t* provider);
46

Matthieu Dorier's avatar
Matthieu Dorier committed
47 48 49 50 51 52 53 54 55 56
/**
 * 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);

57 58 59 60
#ifdef __cplusplus
}
#endif

61
#endif