Commit bcc74e03 authored by Matthieu Dorier's avatar Matthieu Dorier

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
......
This diff is collapsed.
This diff is collapsed.
......@@ -26,6 +26,9 @@ typedef struct omap_key_t {
char key[1];
} omap_key_t;
#define MAX_OMAP_KEY_SIZE 128
#define MAX_OMAP_VAL_SIZE 256
#define SMALL_REGION_THRESHOLD (sizeof(bake_region_id_t))
#endif
......@@ -103,13 +103,9 @@ int main(int argc, char *argv[])
sdskv_provider_register(mid, sdskv_mplex_id, SDSKV_ABT_POOL_DEFAULT, &sdskv_prov);
sdskv_provider_add_database(sdskv_prov, "oid_map", KVDB_MAP, &oid_map_compare, &oid_map_id);
fprintf(stderr, "oid_map at id %ld\n", oid_map_id);
sdskv_provider_add_database(sdskv_prov, "name_map", KVDB_MAP, &name_map_compare, &name_map_id);
fprintf(stderr, "name_map at id %ld\n", name_map_id);
sdskv_provider_add_database(sdskv_prov, "seg_map", KVDB_MAP, &seg_map_compare, &seg_map_id);
fprintf(stderr, "seg_map at id %ld\n", seg_map_id);
sdskv_provider_add_database(sdskv_prov, "omap_map", KVDB_MAP, &omap_map_compare, &omap_map_id);
fprintf(stderr, "omap_map at id %ld\n", omap_map_id);
/* SDSKV provider handle initialization from self addr */
sdskv_client_data sdskv_clt_data;
......@@ -131,6 +127,8 @@ int main(int argc, char *argv[])
return -1;
}
margo_addr_free(mid,self_addr);
margo_wait_for_finalize(mid);
MPI_Finalize();
......
......@@ -274,6 +274,7 @@ static void mobject_finalize_cb(void* data)
{
mobject_provider_t srv_ctx = (mobject_provider_t)data;
sdskv_provider_handle_release(srv_ctx->sdskv_ph);
bake_provider_handle_release(srv_ctx->bake_ph);
ssg_group_destroy(srv_ctx->gid);
......
......@@ -22,23 +22,34 @@ int main(int argc, char** argv)
mobject_store_write_op_create(write_op, LIBMOBJECT_CREATE_EXCLUSIVE, NULL);
// Add a "write_full" operation to write "AAAABBBB"
mobject_store_write_op_write_full(write_op, content, 8);
// Add a "write" operation to write "CCCC"
// Add a "write" operation to write "CCCC", content should then be "AAAABBBBCCCC"
mobject_store_write_op_write(write_op, content+8, 4, 8);
// Add a "writesame" operation to write "DDDD" in two "DD"
mobject_store_write_op_writesame(write_op, content+12, 2, 4, 12);
// Add a "writesame" operation to write "DDDD" in two "DD",
// content should then be "AAAABBBBCCCCDDDD"
// mobject_store_write_op_writesame(write_op, content+12, 2, 4, 12);
// Add a "append" operation to append "EEEEFFFF"
mobject_store_write_op_append(write_op, content+16, 8);
// content should then be "AAAABBBBCCCCDDDDEEEEFFFFF"
// mobject_store_write_op_append(write_op, content+16, 8);
// Add a "remove" operation
// mobject_store_write_op_remove(write_op);
// Add a "truncate" operation to remove the "FFFF" part
mobject_store_write_op_truncate(write_op, 20);
// content should then be "AAAABBBBCCCCDDDDEEEE"
// mobject_store_write_op_truncate(write_op, 20);
// Add a "zero" operation zero-ing the "BBBBCCCC"
mobject_store_write_op_zero(write_op, 4, 8);
// content should then be "AAAA********DDDDEEEE" where "*" represent 0s
// mobject_store_write_op_zero(write_op, 4, 8);
// Add a "omap_set" operation
const char* keys[] = { "matthieu", "rob", "shane", "phil", "robl" };
const char* values[] = { "mdorier@anl.gov", "rross@anl.gov", "ssnyder@anl.gov", "carns@anl.gov", "robl@anl.gov" };
size_t val_sizes[] = { 16, 14, 16, 14, 13 };
mobject_store_write_op_omap_set(write_op, keys, values, val_sizes, 5);
// keys will be sorted and stored as follows:
/* matthieu => mdorier@anl.gov
phil => carns@anl.gov
rob => rross@anl.gov
robl => robl@anl.gov
shane => ssnyder@anl.gov
*/
// Add a omap_rm_keys" operation
// mobject_store_write_op_omap_rm_keys(write_op, keys, 5);
......@@ -56,7 +67,7 @@ int main(int argc, char** argv)
uint64_t psize;
time_t pmtime;
int prval1;
mobject_store_read_op_stat(read_op, &psize, &pmtime, &prval1);
// mobject_store_read_op_stat(read_op, &psize, &pmtime, &prval1);
// Add "read" operation
char read_buf[512];
size_t bytes_read;
......@@ -66,12 +77,14 @@ int main(int argc, char** argv)
const char* start_after1 = "rob";
mobject_store_omap_iter_t iter3;
int prval3;
// the following should return ["robl","shane"]
mobject_store_read_op_omap_get_keys(read_op, start_after1, 7, &iter3, &prval3);
// Add "omap_get_vals" operation
const char* start_after2 = "matthieu";
const char* filter_prefix2 = "p";
mobject_store_omap_iter_t iter4;
int prval4;
// the following should return ["phil"], and its associated value
mobject_store_read_op_omap_get_vals(read_op, start_after2, filter_prefix2, 3, &iter4, &prval4);
// Add "omap_get_vals_by_keys" operation
const char* keys[] = {"matthieu", "robl"};
......@@ -86,13 +99,15 @@ int main(int argc, char** argv)
// print the results of the read operations
printf("Client received the following results:\n");
printf("stat: psize=%ld pmtime=%lld prval=%d\n", psize, (long long)pmtime, prval1);
// printf("stat: psize=%ld pmtime=%lld prval=%d\n", psize, (long long)pmtime, prval1);
{
printf("read: bytes_read = %ld, prval=%d content: ", bytes_read, prval2);
unsigned i;
for(i=0; i<bytes_read; i++) printf("%c", read_buf[i] ? read_buf[i] : '*' );
printf("\n");
}
printf("omap_get_keys: prval=%d\n", prval3);
{
char* key = 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