libmobject-store.c 1.17 KB
Newer Older
1 2 3 4 5 6
/*
 * (C) 2017 The University of Chicago
 * 
 * See COPYRIGHT in top-level directory.
 */

7 8 9 10 11
#include "mobject-conf.h"

#include <stdio.h>
#include <assert.h>

12 13 14 15 16 17 18
#include <margo.h>
#include <ssg.h>

#include "mobject-store.h"

struct mobject_store_handle
{
19
    int test;
20 21
};

22
int rados_create(rados_t *cluster, const char * const id)
23
{
24 25 26 27 28 29 30 31
    struct mobject_store_handle *cluster_handle;
    (void)id; /* XXX: id unused in mobject */

    /* allocate a new cluster handle and set some fields */
    cluster_handle = malloc(sizeof(*cluster_handle));
    if (!cluster_handle)
        return(-1); /* TODO: error codes */
    cluster_handle->test = 123;
32

33 34 35 36
    /* TODO find the SSG group ID for the mobject cluster group */

    /* set the returned cluster handle */
    *cluster = cluster_handle;
37 38

    return(0);
39 40
}

41
#if 0
42 43
int mobject_store_connect(mobject_store_t cluster)
{
44
    /* TODO ssg attach to mobject cluster group id */
45
}
46
#endif
47

48
void rados_shutdown(rados_t cluster)
49
{
50 51 52 53 54 55 56
    struct mobject_store_handle *cluster_handle =
        (struct mobject_store_handle *)cluster;
    assert(cluster_handle != NULL);

    /* TODO ssg detatch from mobject cluster group id */

    free(cluster_handle);
57

58
    return;
59 60
}