Commit bcc74e03 authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

omap, name, and oid databases working properly

parent a29d8576
......@@ -386,7 +386,8 @@ int mobject_store_read_op_operate(mobject_store_read_op_t read_op,
if(r != 0) return r;
r = mobject_read_op_operate(mph,read_op, ioctx->pool_name, oid, flags);
return 0;
mobject_provider_handle_release(mph);
return r;
}
// send a shutdown signal to a server cluster
......
......@@ -13,6 +13,11 @@
#include "src/server/core/fake-kv.hpp"
#include "src/server/core/covermap.hpp"
static int tabs = 0;
#define ENTERING {for(int i=0; i<tabs; i++) fprintf(stderr," "); fprintf(stderr,"[ENTERING]>> %s\n",__FUNCTION__); tabs += 1;}
#define LEAVING {tabs -= 1; for(int i=0; i<tabs; i++) fprintf(stderr," "); fprintf(stderr,"[LEAVING]<<< %s\n",__FUNCTION__); }
#define ERROR {for(int i=0; i<(tabs+1); i++) fprintf(stderr, " "); fprintf(stderr,"[ERROR] "); }
static void read_op_exec_begin(void*);
static void read_op_exec_stat(void*, uint64_t*, time_t*, int*);
static void read_op_exec_read(void*, uint64_t, size_t, buffer_u, size_t*, int*);
......@@ -53,16 +58,22 @@ extern "C" void core_read_op(mobject_store_read_op_t read_op, server_visitor_arg
void read_op_exec_begin(void* u)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
LEAVING;
}
void read_op_exec_stat(void* u, uint64_t* psize, time_t* pmtime, int* prval)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
// TODO
LEAVING;
}
void read_op_exec_read(void* u, uint64_t offset, size_t len, buffer_u buf, size_t* bytes_read, int* prval)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
bake_provider_handle_t bph = vargs->srv_ctx->bake_ph;
bake_target_id_t bti = vargs->srv_ctx->bake_tid;
......@@ -88,6 +99,8 @@ void read_op_exec_read(void* u, uint64_t offset, size_t len, buffer_u buf, size_
}
if(oid == 0) {
*prval = -1;
ERROR fprintf(stderr,"oid == 0\n");
LEAVING;
return;
}
......@@ -116,8 +129,13 @@ 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_proxy_read(bph, region, region_offset, remote_bulk,
ret = bake_proxy_read(bph, region, region_offset, remote_bulk,
remote_offset, remote_addr_str, segment_size);
if(ret != 0) {
ERROR fprintf(stderr,"bake_proxy_read returned %d\n", ret);
LEAVING;
return;
}
if(*bytes_read < r.end) *bytes_read = r.end;
}
break;
......@@ -134,19 +152,36 @@ void read_op_exec_read(void* u, uint64_t offset, size_t len, buffer_u buf, size_
hg_size_t buf_sizes[1] = { segment_size };
hg_bulk_t handle;
ret = margo_bulk_create(mid,1, buf_ptrs, buf_sizes, HG_BULK_READ_ONLY, &handle);
if(ret != HG_SUCCESS) {
ERROR fprintf(stderr,"margo_bulk_create returned %d\n", ret);
LEAVING;
return;
}
ret = margo_bulk_transfer(mid, HG_BULK_PUSH, remote_addr, remote_bulk, buf.as_offset+remote_offset, handle, 0, segment_size);
if(ret != HG_SUCCESS) {
ERROR fprintf(stderr,"margo_bulk_transfer returned %d\n", ret);
LEAVING;
return;
}
ret = margo_bulk_free(handle);
if(ret != HG_SUCCESS) {
ERROR fprintf(stderr,"margo_bulk_free returned %d\n", ret);
LEAVING;
return;
}
if(*bytes_read < r.end) *bytes_read = r.end;
}
}
}
it++;
}
LEAVING;
}
void read_op_exec_omap_get_keys(void* u, const char* start_after, uint64_t max_return,
mobject_store_omap_iter_t* iter, int* prval)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
const char* object_name = vargs->object_name;
sdskv_provider_handle_t sdskv_ph = vargs->srv_ctx->sdskv_ph;
......@@ -163,6 +198,8 @@ void read_op_exec_omap_get_keys(void* u, const char* start_after, uint64_t max_r
}
if(oid == 0) {
*prval = -1;
ERROR fprintf(stderr, "oid == 0\n");
LEAVING;
return;
}
......@@ -173,7 +210,7 @@ void read_op_exec_omap_get_keys(void* u, const char* start_after, uint64_t max_r
strcpy(lb->key, start_after);
hg_size_t max_keys = 10;
hg_size_t key_len = 128;
hg_size_t key_len = MAX_OMAP_KEY_SIZE+sizeof(omap_key_t);
std::vector<void*> keys(max_keys);
std::vector<hg_size_t> ksizes(max_keys, key_len);
std::vector<std::vector<char>> buffers(max_keys, std::vector<char>(key_len));
......@@ -188,6 +225,7 @@ void read_op_exec_omap_get_keys(void* u, const char* start_after, uint64_t max_r
&keys_retrieved);
if(ret != SDSKV_SUCCESS) {
*prval = -1;
ERROR fprintf(stderr, "sdskv_list_keys returned %d\n", ret);
break;
}
const char* k;
......@@ -206,10 +244,12 @@ void read_op_exec_omap_get_keys(void* u, const char* start_after, uint64_t max_r
out:
free(lb);
LEAVING;
}
void read_op_exec_omap_get_vals(void* u, const char* start_after, const char* filter_prefix, uint64_t max_return, mobject_store_omap_iter_t* iter, int* prval)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
const char* object_name = vargs->object_name;
sdskv_provider_handle_t sdskv_ph = vargs->srv_ctx->sdskv_ph;
......@@ -226,18 +266,19 @@ void read_op_exec_omap_get_vals(void* u, const char* start_after, const char* fi
}
if(oid == 0) {
*prval = -1;
ERROR fprintf(stderr, "oid == 0\n");
LEAVING;
return;
}
hg_size_t max_items = 10;
// TODO make this changeable
hg_size_t key_len = 128 + sizeof(omap_key_t);
hg_size_t val_len = 256;
hg_size_t max_items = std::min(max_return, (decltype(max_return))10);
hg_size_t key_len = MAX_OMAP_KEY_SIZE + sizeof(omap_key_t);
hg_size_t val_len = MAX_OMAP_VAL_SIZE;
omap_iter_create(iter);
/* omap_key_t equivalent of start_key */
hg_size_t lb_size = sizeof(omap_key_t)+strlen(start_after);
hg_size_t lb_size = key_len;
omap_key_t* lb = (omap_key_t*)calloc(1, lb_size);
lb->oid = oid;
strcpy(lb->key, start_after);
......@@ -247,11 +288,9 @@ void read_op_exec_omap_get_vals(void* u, const char* start_after, const char* fi
omap_key_t* prefix = (omap_key_t*)calloc(1, prefix_size);
prefix->oid = oid;
strcpy(prefix->key, filter_prefix);
hg_size_t prefix_actual_size = offsetof(omap_key_t, key)+strlen(filter_prefix);
/* we need the above because the prefix in sdskv is not considered a string */
/* key entry used to navigate the returned keys */
omap_key_t* key = (omap_key_t*)calloc(1, key_len);
key->oid = oid;
/* initialize structures to pass to SDSKV functions */
std::vector<void*> keys(max_items);
std::vector<void*> vals(max_items);
......@@ -270,12 +309,13 @@ void read_op_exec_omap_get_vals(void* u, const char* start_after, const char* fi
ret = sdskv_list_keyvals_with_prefix(
sdskv_ph, omap_db_id,
(const void*)lb, lb_size,
(const void*)prefix, prefix_size,
(const void*)prefix, prefix_actual_size,
keys.data(), ksizes.data(),
vals.data(), vsizes.data(),
&items_retrieved);
if(ret != SDSKV_SUCCESS) {
*prval = -1;
ERROR fprintf(stderr, "sdskv_list_keyvals_with_prefix returned %d\n", ret);
break;
}
const char* k;
......@@ -287,19 +327,21 @@ void read_op_exec_omap_get_vals(void* u, const char* start_after, const char* fi
omap_iter_append(*iter, k, (const char*)vals[i], vsizes[i]);
}
memset(lb, 0, lb_size);
lb->oid = oid;
strcpy(lb->key, k);
lb_size = strlen(k) + sizeof(omap_key_t);
//lb_size = strlen(k) + sizeof(omap_key_t);
} while(items_retrieved == max_items && count < max_return);
out:
free(lb);
free(key);
LEAVING;
}
void read_op_exec_omap_get_vals_by_keys(void* u, char const* const* keys, size_t num_keys, mobject_store_omap_iter_t* iter, int* prval)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
const char* object_name = vargs->object_name;
sdskv_provider_handle_t sdskv_ph = vargs->srv_ctx->sdskv_ph;
......@@ -316,6 +358,8 @@ void read_op_exec_omap_get_vals_by_keys(void* u, char const* const* keys, size_t
}
if(oid == 0) {
*prval = -1;
ERROR fprintf(stderr, "oid == 0\n");
LEAVING;
return;
}
......@@ -325,14 +369,16 @@ void read_op_exec_omap_get_vals_by_keys(void* u, char const* const* keys, size_t
std::vector<hg_size_t> ksizes(num_keys);
hg_size_t max_ksize = 0;
for(auto i=0; i < num_keys; i++) {
hg_size_t s = strlen(keys[i])+1;
hg_size_t s = offsetof(omap_key_t,key)+strlen(keys[i])+1;
if(s > max_ksize) max_ksize = s;
ksizes[i] = s;
}
max_ksize += sizeof(omap_key_t);
omap_key_t* key = (omap_key_t*)calloc(1, sizeof(omap_key_t)+max_ksize);
key->oid = oid;
omap_key_t* key = (omap_key_t*)calloc(1, max_ksize);
for(size_t i=0; i < num_keys; i++) {
memset(key, 0, max_ksize);
key->oid = oid;
strcpy(key->key, keys[i]);
// get length of the value
hg_size_t vsize;
......@@ -340,6 +386,7 @@ void read_op_exec_omap_get_vals_by_keys(void* u, char const* const* keys, size_t
(const void*)key, ksizes[i], &vsize);
if(ret != SDSKV_SUCCESS) {
*prval = -1;
ERROR fprintf(stderr, "sdskv_length returned %d\n", ret);
break;
}
std::vector<char> value(vsize);
......@@ -348,10 +395,12 @@ void read_op_exec_omap_get_vals_by_keys(void* u, char const* const* keys, size_t
(void*)value.data(), &vsize);
if(ret != SDSKV_SUCCESS) {
*prval = -1;
ERROR fprintf(stderr, "sdskv_get returned %d\n", ret);
break;
}
omap_iter_append(*iter, keys[i], value.data(), vsize);
}
LEAVING;
}
void read_op_exec_end(void* u)
......@@ -364,9 +413,14 @@ static oid_t get_oid_from_name(
sdskv_database_id_t name_db_id,
const char* name)
{
ENTERING;
oid_t result = 0;
hg_size_t oid_size = sizeof(result);
int ret = sdskv_get(ph, name_db_id, (const void*)name, strlen(name+1), (void*)&result, &oid_size);
if(ret != SDSKV_SUCCESS) return 0;
int ret = sdskv_get(ph, name_db_id, (const void*)name, strlen(name)+1, (void*)&result, &oid_size);
if(ret != SDSKV_SUCCESS) result = 0;
if(result == 0) {
ERROR fprintf(stderr,"oid == 0\n");
}
LEAVING;
return result;
}
......@@ -8,6 +8,11 @@
#include "src/io-chain/write-op-visitor.h"
#include "src/server/core/fake-kv.hpp"
static int tabs = 0;
#define ENTERING {for(int i=0; i<tabs; i++) fprintf(stderr," "); fprintf(stderr,"[ENTERING]>> %s\n",__FUNCTION__); tabs += 1;}
#define LEAVING {tabs -= 1; for(int i=0; i<tabs; i++) fprintf(stderr," "); fprintf(stderr,"[LEAVING]<<< %s\n",__FUNCTION__); }
#define ERROR {for(int i=0; i<(tabs+1); i++) fprintf(stderr, " "); fprintf(stderr,"[ERROR] "); }
static void write_op_exec_begin(void*);
static void write_op_exec_end(void*);
static void write_op_exec_create(void*, int);
......@@ -66,15 +71,21 @@ void write_op_exec_end(void* u)
void write_op_exec_create(void* u, int exclusive)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
sdskv_provider_handle_t sdskv_ph = vargs->srv_ctx->sdskv_ph;
sdskv_database_id_t name_db_id = vargs->srv_ctx->name_db_id;
sdskv_database_id_t oid_db_id = vargs->srv_ctx->oid_db_id;
get_or_create_oid(sdskv_ph, name_db_id, oid_db_id, vargs->object_name);
oid_t oid = get_or_create_oid(sdskv_ph, name_db_id, oid_db_id, vargs->object_name);
if(oid == 0) {
ERROR fprintf(stderr,"oid == 0\n");
}
LEAVING;
}
void write_op_exec_write(void* u, buffer_u buf, size_t len, uint64_t offset)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
oid_t oid = vargs->oid;
if(oid == 0) {
......@@ -82,6 +93,10 @@ void write_op_exec_write(void* u, buffer_u buf, size_t len, uint64_t offset)
sdskv_database_id_t name_db_id = vargs->srv_ctx->name_db_id;
sdskv_database_id_t oid_db_id = vargs->srv_ctx->oid_db_id;
oid = get_or_create_oid(sdskv_ph, name_db_id, oid_db_id, vargs->object_name);
if(oid == 0) {
ERROR fprintf(stderr,"oid == 0\n");
return;
}
vargs->oid = oid;
}
......@@ -96,8 +111,18 @@ 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_create(bake_ph, bti, len, &rid);
if(ret != 0) {
ERROR fprintf(stderr,"bake_create returned %d\n",ret);
return;
}
ret = bake_proxy_write(bake_ph, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, len);
if(ret != 0) {
ERROR fprintf(stderr, "bake_proxy_write returned %d\n", ret);
}
ret = bake_persist(bake_ph, rid);
if(ret != 0) {
ERROR fprintf(stderr, "bake_persist returned %d\n", ret);
}
insert_region_log_entry(oid, offset, len, &rid);
} else {
......@@ -107,15 +132,26 @@ void write_op_exec_write(void* u, buffer_u buf, size_t len, uint64_t offset)
hg_size_t buf_sizes[1] = {len};
hg_bulk_t handle;
ret = margo_bulk_create(mid,1, buf_ptrs, buf_sizes, HG_BULK_WRITE_ONLY, &handle);
if(ret != 0) {
ERROR fprintf(stderr, "margo_bulk_create returned %d\n", ret);
}
ret = margo_bulk_transfer(mid, HG_BULK_PULL, remote_addr, remote_bulk, buf.as_offset, handle, 0, len);
if(ret != 0) {
ERROR fprintf(stderr, "margo_bulk_transfer returned %d\n", ret);
}
ret = margo_bulk_free(handle);
if(ret != 0) {
ERROR fprintf(stderr, "margo_bulk_free returned %d\n", ret);
}
insert_small_region_log_entry(oid, offset, len, data);
}
LEAVING;
}
void write_op_exec_write_full(void* u, buffer_u buf, size_t len)
{
ENTERING;
// TODO: this function will not be valid if the new object is
// smaller than its previous version. Instead we should remove the object
// and re-create it.
......@@ -139,18 +175,17 @@ void write_op_exec_write_full(void* u, buffer_u buf, size_t len)
int ret;
unsigned i;
fprintf(stderr, "In Mobject, input bti is ");
for(i=0; i<16; i++) fprintf(stderr, "%d ", bti.id[i]);
fprintf(stderr, "\n");
// TODO: check return values of those calls
ret = bake_create(bph, bti, len, &rid);
ret = bake_proxy_write(bph, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, len);
ret = bake_persist(bph, rid);
insert_region_log_entry(oid, 0, len, &rid);
LEAVING;
}
void write_op_exec_writesame(void* u, buffer_u buf, size_t data_len, size_t write_len, uint64_t offset)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
oid_t oid = vargs->oid;
if(oid == 0) {
......@@ -169,11 +204,6 @@ void write_op_exec_writesame(void* u, buffer_u buf, size_t data_len, size_t writ
hg_addr_t remote_addr = vargs->client_addr;
int ret;
unsigned ii;
fprintf(stderr, "In Mobject, input bti is ");
for(ii=0; ii<16; ii++) fprintf(stderr, "%d ", bti.id[ii]);
fprintf(stderr, "\n");
// TODO: check return values of those calls
ret = bake_create(bph, bti, data_len, &rid);
ret = bake_proxy_write(bph, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, data_len);
......@@ -187,10 +217,12 @@ void write_op_exec_writesame(void* u, buffer_u buf, size_t data_len, size_t writ
// TODO normally we should have the same timestamps but right now it bugs...
insert_region_log_entry(oid, offset+i, std::min(data_len, write_len - i), &rid);//, ts);
}
LEAVING;
}
void write_op_exec_append(void* u, buffer_u buf, size_t len)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
oid_t oid = vargs->oid;
if(oid == 0) {
......@@ -209,11 +241,6 @@ void write_op_exec_append(void* u, buffer_u buf, size_t len)
hg_addr_t remote_addr = vargs->client_addr;
int ret;
unsigned i;
fprintf(stderr, "In Mobject, input bti is ");
for(i=0; i<16; i++) fprintf(stderr, "%d ", bti.id[i]);
fprintf(stderr, "\n");
ret = bake_create(bph, bti, len, &rid);
ret = bake_proxy_write(bph, rid, 0, remote_bulk, buf.as_offset, remote_addr_str, len);
ret = bake_persist(bph, rid);
......@@ -223,17 +250,21 @@ void write_op_exec_append(void* u, buffer_u buf, size_t len)
uint64_t offset = compute_size(oid,ts);
insert_region_log_entry(oid, offset, len, &rid, ts);
LEAVING;
}
void write_op_exec_remove(void* u)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
write_op_exec_truncate(u,0);
// TODO: technically should mark the object as removed
LEAVING;
}
void write_op_exec_truncate(void* u, uint64_t offset)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
oid_t oid = vargs->oid;
if(oid == 0) {
......@@ -245,10 +276,12 @@ void write_op_exec_truncate(void* u, uint64_t offset)
}
insert_punch_log_entry(oid, offset);
LEAVING;
}
void write_op_exec_zero(void* u, uint64_t offset, uint64_t len)
{
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
oid_t oid = vargs->oid;
if(oid == 0) {
......@@ -260,6 +293,7 @@ void write_op_exec_zero(void* u, uint64_t offset, uint64_t len)
}
insert_zero_log_entry(oid, offset, len);
LEAVING;
}
void write_op_exec_omap_set(void* u, char const* const* keys,
......@@ -267,6 +301,7 @@ void write_op_exec_omap_set(void* u, char const* const* keys,
const size_t *lens,
size_t num)
{
ENTERING;
int ret;
auto vargs = static_cast<server_visitor_args_t>(u);
sdskv_provider_handle_t sdskv_ph = vargs->srv_ctx->sdskv_ph;
......@@ -279,20 +314,37 @@ void write_op_exec_omap_set(void* u, char const* const* keys,
vargs->oid = oid;
}
/* find out the max key length */
size_t max_k_len = 0;
for(auto i=0; i<num; i++) {
size_t s = strlen(keys[i]);
max_k_len = max_k_len < s ? s : max_k_len;
}
/* create an omap key of the right size */
omap_key_t* k = (omap_key_t*)calloc(1, max_k_len + sizeof(omap_key_t));
for(auto i=0; i<num; i++) {
ret = sdskv_put(sdskv_ph, omap_db_id,
(const void*)keys[i], strlen(keys[i])+1,
size_t k_len = strlen(keys[i])+sizeof(omap_key_t);
memset(k, 0, max_k_len + sizeof(omap_key_t));
k->oid = oid;
strcpy(k->key, keys[i]);
ret = sdskv_put(sdskv_ph, omap_db_id,
(const void*)k, k_len,
(const void*)vals[i], lens[i]);
if(ret != SDSKV_SUCCESS) {
fprintf(stderr, "write_op_exec_omap_set: error in sdskv_put() (ret = %d)\n", ret);
}
}
free(k);
LEAVING;
}
void write_op_exec_omap_rm_keys(void* u, char const* const* keys, size_t num_keys)
{
int ret;
ENTERING;
auto vargs = static_cast<server_visitor_args_t>(u);
sdskv_provider_handle_t sdskv_ph = vargs->srv_ctx->sdskv_ph;
sdskv_database_id_t name_db_id = vargs->srv_ctx->name_db_id;
......@@ -310,6 +362,7 @@ void write_op_exec_omap_rm_keys(void* u, char const* const* keys, size_t num_key
if(ret != SDSKV_SUCCESS)
fprintf(stderr, "write_op_exec_omap_rm_keys: error in sdskv_erase() (ret = %d)\n", ret);
}
LEAVING;
}
oid_t get_or_create_oid(
......@@ -318,6 +371,8 @@ oid_t get_or_create_oid(
sdskv_database_id_t oid_db_id,
const char* object_name)
{
ENTERING;
oid_t oid = 0;
hg_size_t vsize = sizeof(oid);
int ret;
......@@ -337,23 +392,35 @@ oid_t get_or_create_oid(
oid += 1;
}
// we make sure we stopped at an unknown key (not another SDSKV error)
if(ret != SDSKV_ERR_UNKNOWN_KEY) return 0;
if(ret != SDSKV_ERR_UNKNOWN_KEY) {
fprintf(stderr, "[ERROR] ret != SDSKV_ERR_UNKNOWN_KEY (ret = %d)\n", ret);
LEAVING;
return 0;
}
// set name => oid
ret = sdskv_put(ph, name_db_id, (const void*)object_name,
strlen(object_name)+1, &oid, sizeof(oid));
if(ret != SDSKV_SUCCESS) return 0;
if(ret != SDSKV_SUCCESS) {
fprintf(stderr, "[ERROR] after sdskv_put(name->oid), ret != SDSKV_SUCCESS (ret = %d)\n", ret);
LEAVING;
return 0;
}
// set oid => name
ret = sdskv_put(ph, oid_db_id, &oid, sizeof(oid),
(const void*)object_name, strlen(object_name)+1);
if(ret != SDSKV_SUCCESS) return 0;
} else {
oid = 0;
if(ret != SDSKV_SUCCESS) {
fprintf(stderr, "[ERROR] after sdskv_put(oid->name), ret != SDSKV_SUCCESS (ret = %d)\n", ret);
LEAVING;
return 0;
}
}
LEAVING;
return oid;
}
static void insert_region_log_entry(oid_t oid, uint64_t offset, uint64_t len, bake_region_id_t* region, double ts)
{
ENTERING;
segment_key_t seg;
seg.oid = oid;
seg.timestamp = ts < 0 ? ABT_get_wtime() : ts;
......@@ -361,10 +428,12 @@ static void insert_region_log_entry(oid_t oid, uint64_t offset, uint64_t len, ba
seg.end_index = offset+len;
seg.type = seg_type_t::BAKE_REGION;
segment_map[seg] = *region;
LEAVING;
}
static void insert_small_region_log_entry(oid_t oid, uint64_t offset, uint64_t len, const char* data, double ts)
{
ENTERING;
segment_key_t seg;
seg.oid = oid;
seg.timestamp = ts < 0 ? ABT_get_wtime() : ts;
......@@ -373,10 +442,12 @@ static void insert_small_region_log_entry(oid_t oid, uint64_t offset, uint64_t l
seg.type = seg_type_t::SMALL_REGION;
void* b = static_cast<void*>(&segment_map[seg]);
std::memcpy(b, data, len);
LEAVING;
}
static void insert_zero_log_entry(oid_t oid, uint64_t offset, uint64_t len, double ts)
{
ENTERING;
segment_key_t seg;
seg.oid = oid;
seg.timestamp = ts < 0 ? ABT_get_wtime() : ts;
......@@ -384,10 +455,12 @@ static void insert_zero_log_entry(oid_t oid, uint64_t offset, uint64_t len, doub
seg.end_index = offset+len;
seg.type = seg_type_t::ZERO;
segment_map[seg] = bake_region_id_t();
LEAVING;
}
static void insert_punch_log_entry(oid_t oid, uint64_t offset, double ts)
{
ENTERING;
segment_key_t seg;