mobject-server.h 1.56 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 16
/* server-side utilities and routines.  Clients are looking for either
 * libmobject-store.h or librados-mobject-store.h */

17
#define MOBJECT_SERVER_GROUP_NAME "mobject-store-servers"
18
#define MOBJECT_ABT_POOL_DEFAULT ABT_POOL_NULL
19

20
typedef struct mobject_server_context* mobject_provider_t;
Matthieu Dorier's avatar
Matthieu Dorier committed
21

22 23 24
/**
 * Start a mobject server instance
 *
25
 * @param[in] mid           margo instance id
26 27 28
 * @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
29
 * @param[in] sdskv_ph      SDSKV provider handle to use to access metadata
30
 * @param[in] cluster_file  file name to write cluster connect info to
31
 * @param[out] provider     resulting provider
32
 * 
33
 * @returns 0 on success, negative error code on failure
34
 */
35 36 37 38 39
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
40
        sdskv_provider_handle_t sdskv_ph,
41 42
        const char *cluster_file,
        mobject_provider_t* provider);
43

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

54
#endif