Commit d065c121 authored by Rob Latham's avatar Rob Latham

start gluing together services into a server

parent 3f6144ce
......@@ -10,9 +10,11 @@ AM_CFLAGS =
AM_CXXFLAGS = $(AM_CFLAGS)
lib_LTLIBRARIES = src/libmobject-store.la
lib_LTLIBRARIES += src/libmobject-store-server.la
include_HEADERS = include/libmobject-store.h \
include/librados-mobject-store.h
include/librados-mobject-store.h \
include/mobject-server.h
# setting this to empty so subdir makefiles can use +=
noinst_HEADERS =
......
/*
* (C) 2017 The University of Chicago
*
* See COPYRIGHT in top-level directory.
*/
#ifndef MOBJECT_SERVER_H
#define MOBJECT_SERVER_H
/* server-side utilities and routines. Clients are looking for either
* libmobject-store.h or librados-mobject-store.h */
/**
* Start a mobject server instance
*
* @param[in] addr_str
* @param[in poolname
* @returns 0 on success, negative error code on failure */
int mobject_server_register(const char *addr_str, const char *poolname);
#endif
......@@ -25,3 +25,6 @@ noinst_HEADERS += \
src/write-op-visitor.h \
src/read-op-visitor.h \
src/buffer-union.h
src_libmobject_store_server_la_SOURCES = \
src/mobject-server.c
#include <sds-keyval.h>
#include <bake-bulk.h>
#include <bake-bulk-server.h>
#include <margo.h>
#include <libpmemobj.h>
#include <mobject-server.h>
int mobject_server_register(const char *addr_str, const char *poolname)
{
int ret=0;
margo_instance_id mid;
kv_context *metadata;
struct bake_pool_info *pool_info;
pool_info = bake_server_makepool(poolname);
mid = margo_init(addr_str, MARGO_SERVER_MODE, 0, -1);
bake_server_register(mid, pool_info);
metadata = kv_server_register(mid);
return ret;
}
int mobject_shutdown()
{
margo_wait_for_finalize(NULL);
pmemobj_close(NULL);
}
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