Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
sds-keyval
Commits
38b6d8de
Commit
38b6d8de
authored
Oct 09, 2017
by
David Rich
Committed by
Rob Latham
Nov 22, 2017
Browse files
Avoid margo_create for now. Problem with handle caching?
parent
3f56b38a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/kv-client.c
View file @
38b6d8de
...
...
@@ -62,8 +62,10 @@ hg_return_t kv_open(kv_context *context, const char *server_addr, const char *db
ret
=
margo_addr_lookup
(
context
->
mid
,
server_addr
,
&
(
context
->
svr_addr
));
assert
(
ret
==
HG_SUCCESS
);
ret
=
margo_create
(
context
->
mid
,
context
->
svr_addr
,
context
->
open_id
,
&
handle
);
// grab hg_context for mid
hg_context_t
*
hg_context
=
margo_get_context
(
context
->
mid
);
ret
=
HG_Create
(
hg_context
,
context
->
svr_addr
,
context
->
open_id
,
&
handle
);
assert
(
ret
==
HG_SUCCESS
);
strcpy
(
open_in
.
name
,
db_name
);
...
...
@@ -79,23 +81,23 @@ hg_return_t kv_open(kv_context *context, const char *server_addr, const char *db
/* put/get handles: can have as many in flight as we have registered.
* BAKE has a handle-caching mechanism we should consult.
* should margo be caching handles? */
ret
=
margo_c
reate
(
context
->
mid
,
context
->
svr_addr
,
context
->
put_id
,
&
(
context
->
put_handle
));
ret
=
HG_C
reate
(
hg_
context
,
context
->
svr_addr
,
context
->
put_id
,
&
(
context
->
put_handle
));
assert
(
ret
==
HG_SUCCESS
);
ret
=
margo_c
reate
(
context
->
mid
,
context
->
svr_addr
,
context
->
bulk_put_id
,
&
(
context
->
bulk_put_handle
));
ret
=
HG_C
reate
(
hg_
context
,
context
->
svr_addr
,
context
->
bulk_put_id
,
&
(
context
->
bulk_put_handle
));
assert
(
ret
==
HG_SUCCESS
);
ret
=
margo_c
reate
(
context
->
mid
,
context
->
svr_addr
,
context
->
get_id
,
&
(
context
->
get_handle
));
ret
=
HG_C
reate
(
hg_
context
,
context
->
svr_addr
,
context
->
get_id
,
&
(
context
->
get_handle
));
assert
(
ret
==
HG_SUCCESS
);
ret
=
margo_c
reate
(
context
->
mid
,
context
->
svr_addr
,
context
->
bulk_get_id
,
&
(
context
->
bulk_get_handle
));
ret
=
HG_C
reate
(
hg_
context
,
context
->
svr_addr
,
context
->
bulk_get_id
,
&
(
context
->
bulk_get_handle
));
assert
(
ret
==
HG_SUCCESS
);
ret
=
margo_c
reate
(
context
->
mid
,
context
->
svr_addr
,
context
->
bench_id
,
&
(
context
->
bench_handle
));
ret
=
HG_C
reate
(
hg_
context
,
context
->
svr_addr
,
context
->
bench_id
,
&
(
context
->
bench_handle
));
assert
(
ret
==
HG_SUCCESS
);
ret
=
margo_c
reate
(
context
->
mid
,
context
->
svr_addr
,
context
->
shutdown_id
,
&
(
context
->
shutdown_handle
));
ret
=
HG_C
reate
(
hg_
context
,
context
->
svr_addr
,
context
->
shutdown_id
,
&
(
context
->
shutdown_handle
));
assert
(
ret
==
HG_SUCCESS
);
margo_free_output
(
handle
,
&
open_out
);
...
...
@@ -190,8 +192,10 @@ hg_return_t kv_close(kv_context *context)
put_in_t
close_in
;
put_out_t
close_out
;
ret
=
margo_create
(
context
->
mid
,
context
->
svr_addr
,
context
->
close_id
,
&
handle
);
// grab hg_context for mid
hg_context_t
*
hg_context
=
margo_get_context
(
context
->
mid
);
ret
=
HG_Create
(
hg_context
,
context
->
svr_addr
,
context
->
close_id
,
&
handle
);
assert
(
ret
==
HG_SUCCESS
);
ret
=
margo_forward
(
handle
,
&
close_in
);
assert
(
ret
==
HG_SUCCESS
);
...
...
@@ -217,10 +221,12 @@ bench_result *kv_benchmark(kv_context *context, int count) {
ret
=
margo_create
(
context
->
mid
,
context
->
svr_addr
,
context
->
bench_id
,
&
(
context
->
bench_handle
)
);
bench_in
.
count
=
count
;
ret
=
margo_create
(
context
->
mid
,
context
->
svr_addr
,
context
->
bench_id
,
&
handle
);
// grab hg_context for mid
hg_context_t
*
hg_context
=
margo_get_context
(
context
->
mid
);
ret
=
HG_Create
(
hg_context
,
context
->
svr_addr
,
context
->
bench_id
,
&
handle
);
assert
(
ret
==
HG_SUCCESS
);
bench_in
.
count
=
count
;
ret
=
margo_forward
(
context
->
bench_handle
,
&
bench_in
);
assert
(
ret
==
HG_SUCCESS
);
ret
=
margo_get_output
(
context
->
bench_handle
,
&
bench_out
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment