Commit b7c26b73 authored by Matthieu Dorier's avatar Matthieu Dorier

updated bake function calls to match new API

parent 72057aaa
......@@ -91,13 +91,13 @@ SERVER_LIBS="$PMEM_LIBS $SERVER_LIBS"
SERVER_CPPFLAGS="$PMEM_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$PMEM_CFLAGS $SERVER_CFLAGS"
PKG_CHECK_MODULES([BAKESERVER],[bake-bulk-server],[],
PKG_CHECK_MODULES([BAKESERVER],[bake-server],[],
AC_MSG_ERROR([Could not find working BAKE server installation!]) )
SERVER_LIBS="$BAKESERVER_LIBS $SERVER_LIBS"
SERVER_CPPFLAGS="$BAKESERVER_CFLAGS $SERVER_CPPFLAGS"
SERVER_CFLAGS="$BAKESERVER_CFLAGS $SERVER_CFLAGS"
PKG_CHECK_MODULES([BAKECLIENT],[bake-bulk-client],[],
PKG_CHECK_MODULES([BAKECLIENT],[bake-client],[],
AC_MSG_ERROR([Could not find working BAKE client installation!]) )
SERVER_LIBS="$BAKECLIENT_LIBS $SERVER_LIBS"
SERVER_CPPFLAGS="$BAKECLIENT_CFLAGS $SERVER_CPPFLAGS"
......
......@@ -3,7 +3,7 @@
#include <iostream>
#include <algorithm>
#include <list>
#include <bake-bulk-client.h>
#include <bake-client.h>
#include "src/server/core/core-read-op.h"
#include "src/server/visitor-args.h"
#include "src/io-chain/read-op-visitor.h"
......@@ -27,7 +27,7 @@ struct read_request_t {
uint64_t region_start_index; // where to start within the region
uint64_t region_end_index; // where to end within the region
uint64_t client_offset; // offset within the client's buffer
bake_bulk_region_id_t region; // region id
bake_region_id_t region; // region id
};
static struct read_op_visitor read_op_exec = {
......@@ -59,7 +59,7 @@ void read_op_exec_read(void* u, uint64_t offset, size_t len, buffer_u buf, size_
{
auto vargs = static_cast<server_visitor_args_t>(u);
bake_target_id_t bti = vargs->srv_ctx->bake_id;
bake_bulk_region_id_t rid;
bake_region_id_t rid;
hg_bulk_t remote_bulk = vargs->bulk_handle;
const char* object_name = vargs->object_name;
const char* remote_addr_str = vargs->client_addr_str;
......@@ -86,7 +86,7 @@ void read_op_exec_read(void* u, uint64_t offset, size_t len, buffer_u buf, size_
while(!coverage.full() && it != segment_map.end() && it->first.oid == oid) {
const segment_key_t& seg = it->first;
const bake_bulk_region_id_t& region = it->second;
const bake_region_id_t& region = it->second;
switch(seg.type) {
case seg_type_t::ZERO:
......@@ -103,7 +103,7 @@ void read_op_exec_read(void* u, uint64_t offset, size_t len, buffer_u buf, size_
uint64_t segment_size = r.end - r.start;
uint64_t region_offset = r.start - seg.start_index;
uint64_t remote_offset = r.start - offset;
bake_bulk_proxy_read(bti, region, region_offset, remote_bulk,
bake_proxy_read(bti, region, region_offset, remote_bulk,
remote_offset, remote_addr_str, segment_size);
if(*bytes_read < r.end) *bytes_read = r.end;
}
......
......@@ -3,7 +3,7 @@
#include <string>
#include <iostream>
#include <limits>
#include <bake-bulk-client.h>
#include <bake-client.h>
#include "src/server/visitor-args.h"
#include "src/io-chain/write-op-visitor.h"
#include "src/server/core/fake-kv.hpp"
......@@ -22,7 +22,7 @@ static void write_op_exec_omap_set(void*, char const* const*, char const* const*
static void write_op_exec_omap_rm_keys(void*, char const* const*, size_t);
static oid_t get_or_create_oid(const char* name);
static void insert_region_log_entry(oid_t oid, uint64_t offset, uint64_t len, bake_bulk_region_id_t* region, double ts = -1.0);
static void insert_region_log_entry(oid_t oid, uint64_t offset, uint64_t len, bake_region_id_t* region, double ts = -1.0);
static void insert_small_region_log_entry(oid_t oid, uint64_t offset, uint64_t len, const char* data, double ts = -1.0);
static void insert_zero_log_entry(oid_t oid, uint64_t offset, uint64_t len, double ts=-1.0);
static void insert_punch_log_entry(oid_t oid, uint64_t offset, double ts=-1.0);
......@@ -71,7 +71,7 @@ void write_op_exec_write(void* u, buffer_u buf, size_t len, uint64_t offset)
oid_t oid = get_or_create_oid(vargs->object_name);
bake_target_id_t bti = vargs->srv_ctx->bake_id;
bake_bulk_region_id_t rid;
bake_region_id_t rid;
hg_bulk_t remote_bulk = vargs->bulk_handle;
const char* remote_addr_str = vargs->client_addr_str;
hg_addr_t remote_addr = vargs->client_addr;
......@@ -79,9 +79,9 @@ void write_op_exec_write(void* u, buffer_u buf, size_t len, uint64_t offset)
if(len > SMALL_REGION_THRESHOLD) {
// TODO: check return values of those calls
ret = bake_bulk_create(bti, len, &rid);
ret = bake_bulk_proxy_write(bti, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, len);
ret = bake_bulk_persist(bti, rid);
ret = bake_create(bti, len, &rid);
ret = bake_proxy_write(bti, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, len);
ret = bake_persist(bti, rid);
insert_region_log_entry(oid, offset, len, &rid);
} else {
......@@ -108,16 +108,16 @@ void write_op_exec_write_full(void* u, buffer_u buf, size_t len)
oid_t oid = get_or_create_oid(vargs->object_name);
bake_target_id_t bti = vargs->srv_ctx->bake_id;
bake_bulk_region_id_t rid;
bake_region_id_t rid;
hg_bulk_t remote_bulk = vargs->bulk_handle;
const char* remote_addr_str = vargs->client_addr_str;
hg_addr_t remote_addr = vargs->client_addr;
int ret;
// TODO: check return values of those calls
ret = bake_bulk_create(bti, len, &rid);
ret = bake_bulk_proxy_write(bti, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, len);
ret = bake_bulk_persist(bti, rid);
ret = bake_create(bti, len, &rid);
ret = bake_proxy_write(bti, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, len);
ret = bake_persist(bti, rid);
insert_region_log_entry(oid, 0, len, &rid);
}
......@@ -127,16 +127,16 @@ void write_op_exec_writesame(void* u, buffer_u buf, size_t data_len, size_t writ
oid_t oid = get_or_create_oid(vargs->object_name);
bake_target_id_t bti = vargs->srv_ctx->bake_id;
bake_bulk_region_id_t rid;
bake_region_id_t rid;
hg_bulk_t remote_bulk = vargs->bulk_handle;
const char* remote_addr_str = vargs->client_addr_str;
hg_addr_t remote_addr = vargs->client_addr;
int ret;
// TODO: check return values of those calls
ret = bake_bulk_create(bti, data_len, &rid);
ret = bake_bulk_proxy_write(bti, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, data_len);
ret = bake_bulk_persist(bti, rid);
ret = bake_create(bti, data_len, &rid);
ret = bake_proxy_write(bti, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, data_len);
ret = bake_persist(bti, rid);
size_t i;
......@@ -154,15 +154,15 @@ void write_op_exec_append(void* u, buffer_u buf, size_t len)
oid_t oid = get_or_create_oid(vargs->object_name);
bake_target_id_t bti = vargs->srv_ctx->bake_id;
bake_bulk_region_id_t rid;
bake_region_id_t rid;
hg_bulk_t remote_bulk = vargs->bulk_handle;
const char* remote_addr_str = vargs->client_addr_str;
hg_addr_t remote_addr = vargs->client_addr;
int ret;
ret = bake_bulk_create(bti, len, &rid);
ret = bake_bulk_proxy_write(bti, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, len);
ret = bake_bulk_persist(bti, rid);
ret = bake_create(bti, len, &rid);
ret = bake_proxy_write(bti, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, len);
ret = bake_persist(bti, rid);
// find out the current length of the object
double ts = ABT_get_wtime();
......@@ -243,7 +243,7 @@ oid_t get_or_create_oid(const char* object_name)
return oid;
}
static void insert_region_log_entry(oid_t oid, uint64_t offset, uint64_t len, bake_bulk_region_id_t* region, double ts)
static void insert_region_log_entry(oid_t oid, uint64_t offset, uint64_t len, bake_region_id_t* region, double ts)
{
segment_key_t seg;
seg.oid = oid;
......@@ -274,7 +274,7 @@ static void insert_zero_log_entry(oid_t oid, uint64_t offset, uint64_t len, doub
seg.start_index = offset;
seg.end_index = offset+len;
seg.type = seg_type_t::ZERO;
segment_map[seg] = bake_bulk_region_id_t();
segment_map[seg] = bake_region_id_t();
}
static void insert_punch_log_entry(oid_t oid, uint64_t offset, double ts)
......@@ -285,7 +285,7 @@ static void insert_punch_log_entry(oid_t oid, uint64_t offset, double ts)
seg.start_index = offset;
seg.end_index = std::numeric_limits<uint64_t>::max();
seg.type = seg_type_t::TOMBSTONE;
segment_map[seg] = bake_bulk_region_id_t();
segment_map[seg] = bake_region_id_t();
}
uint64_t compute_size(oid_t oid, double ts)
......
......@@ -4,10 +4,7 @@ bool operator<(const segment_key_t& s1, const segment_key_t& s2) {
// sort by oid first
if(s1.oid != s2.oid)
return s1.oid < s2.oid;
// larger timestamps will go first
// if(s1.timestamp != s2.timestamp)
return s1.timestamp > s2.timestamp;
// return s1.start_index < s2.start_index;
return s1.timestamp > s2.timestamp;
}
bool operator<(const omap_key_t& k1, const omap_key_t& k2) {
......@@ -18,6 +15,5 @@ bool operator<(const omap_key_t& k1, const omap_key_t& k2) {
std::map<oid_t, std::string> oid_map;
std::map<std::string, oid_t> name_map;
std::map<segment_key_t, bake_bulk_region_id_t> segment_map;
std::map<segment_key_t, bake_region_id_t> segment_map;
std::map<omap_key_t, std::vector<char>> omap_map;
//std::map<oid_t, std::size_t> size_map;
#include <map>
#include <vector>
#include <string>
#include <bake-bulk-client.h>
#include <bake-client.h>
typedef uint64_t oid_t;
......@@ -25,13 +25,13 @@ struct omap_key_t {
std::string key;
};
#define SMALL_REGION_THRESHOLD (sizeof(bake_bulk_region_id_t))
#define SMALL_REGION_THRESHOLD (sizeof(bake_region_id_t))
bool operator<(const segment_key_t& s1, const segment_key_t& s2);
bool operator<(const omap_key_t& k1, const omap_key_t& k2);
extern std::map<oid_t, std::string> oid_map;
extern std::map<std::string, oid_t> name_map;
extern std::map<segment_key_t, bake_bulk_region_id_t> segment_map;
extern std::map<segment_key_t, bake_region_id_t> segment_map;
extern std::map<omap_key_t, std::vector<char>> omap_map;
//extern std::map<oid_t, std::size_t> size_map;
......@@ -8,8 +8,8 @@
#include <margo.h>
//#include <sds-keyval.h>
#include <bake-bulk-server.h>
#include <bake-bulk-client.h>
#include <bake-server.h>
#include <bake-client.h>
//#include <libpmemobj.h>
#include <ssg-mpi.h>
......
......@@ -11,8 +11,8 @@
#include <abt.h>
#include <margo.h>
//#include <sds-keyval.h>
#include <bake-bulk-server.h>
#include <bake-bulk-client.h>
#include <bake-server.h>
#include <bake-client.h>
//#include <libpmemobj.h>
#include <ssg-mpi.h>
......
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