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
bake
Commits
6e313ec0
Commit
6e313ec0
authored
May 07, 2016
by
Philip Carns
Browse files
skeleton rpc handler for bulk write
parent
d5199990
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/bake-bulk-rpc.c
View file @
6e313ec0
...
@@ -76,3 +76,32 @@ static void bake_bulk_create_ult(hg_handle_t handle)
...
@@ -76,3 +76,32 @@ static void bake_bulk_create_ult(hg_handle_t handle)
}
}
DEFINE_MARGO_RPC_HANDLER
(
bake_bulk_create_ult
)
DEFINE_MARGO_RPC_HANDLER
(
bake_bulk_create_ult
)
/* service a remote RPC that writes to a bulk region */
static
void
bake_bulk_write_ult
(
hg_handle_t
handle
)
{
bake_bulk_write_out_t
out
;
bake_bulk_write_in_t
in
;
hg_return_t
hret
;
printf
(
"Got RPC request to write bulk region.
\n
"
);
memset
(
&
out
,
0
,
sizeof
(
out
));
hret
=
HG_Get_input
(
handle
,
&
in
);
if
(
hret
!=
HG_SUCCESS
)
{
out
.
ret
=
-
1
;
HG_Respond
(
handle
,
NULL
,
NULL
,
&
out
);
HG_Destroy
(
handle
);
return
;
}
/* TODO: implement */
out
.
ret
=
-
1
;
HG_Respond
(
handle
,
NULL
,
NULL
,
&
out
);
HG_Destroy
(
handle
);
return
;
}
DEFINE_MARGO_RPC_HANDLER
(
bake_bulk_write_ult
)
src/bake-bulk-rpc.h
View file @
6e313ec0
...
@@ -34,6 +34,7 @@ MERCURY_GEN_PROC(bake_bulk_write_in_t,
...
@@ -34,6 +34,7 @@ MERCURY_GEN_PROC(bake_bulk_write_in_t,
((
hg_bulk_t
)(
bulk_handle
)))
((
hg_bulk_t
)(
bulk_handle
)))
MERCURY_GEN_PROC
(
bake_bulk_write_out_t
,
MERCURY_GEN_PROC
(
bake_bulk_write_out_t
,
((
int32_t
)(
ret
)))
((
int32_t
)(
ret
)))
DECLARE_MARGO_RPC_HANDLER
(
bake_bulk_write_ult
)
/* TODO: where should the encoder defs live? Not in bake-bulk-rpc.c because
/* TODO: where should the encoder defs live? Not in bake-bulk-rpc.c because
* we don't really need the rpc handlers to be linked into clients...
* we don't really need the rpc handlers to be linked into clients...
...
...
src/bake-bulk-server.c
View file @
6e313ec0
...
@@ -105,6 +105,9 @@ int main(int argc, char **argv)
...
@@ -105,6 +105,9 @@ int main(int argc, char **argv)
MERCURY_REGISTER
(
hg_class
,
"bake_bulk_create_rpc"
,
bake_bulk_create_in_t
,
MERCURY_REGISTER
(
hg_class
,
"bake_bulk_create_rpc"
,
bake_bulk_create_in_t
,
bake_bulk_create_out_t
,
bake_bulk_create_out_t
,
bake_bulk_create_ult_handler
);
bake_bulk_create_ult_handler
);
MERCURY_REGISTER
(
hg_class
,
"bake_bulk_write_rpc"
,
bake_bulk_write_in_t
,
bake_bulk_write_out_t
,
bake_bulk_write_ult_handler
);
/* NOTE: at this point this server ULT has two options. It can wait on
/* NOTE: at this point this server ULT has two options. It can wait on
* whatever mechanism it wants to (however long the daemon should run and
* whatever mechanism it wants to (however long the daemon should run and
...
...
src/bake-bulk.c
View file @
6e313ec0
...
@@ -22,6 +22,7 @@ struct bake_instance
...
@@ -22,6 +22,7 @@ struct bake_instance
struct
bake_instance
g_binst
;
/* TODO: replace later, hard coded global instance */
struct
bake_instance
g_binst
;
/* TODO: replace later, hard coded global instance */
static
hg_id_t
g_bake_bulk_shutdown_id
;
/* TODO: probably not global in the long run either */
static
hg_id_t
g_bake_bulk_shutdown_id
;
/* TODO: probably not global in the long run either */
static
hg_id_t
g_bake_bulk_create_id
;
/* TODO: probably not global in the long run either */
static
hg_id_t
g_bake_bulk_create_id
;
/* TODO: probably not global in the long run either */
static
hg_id_t
g_bake_bulk_write_id
;
/* TODO: probably not global in the long run either */
int
bake_probe_instance
(
int
bake_probe_instance
(
const
char
*
mercury_dest
,
const
char
*
mercury_dest
,
...
@@ -67,6 +68,12 @@ int bake_probe_instance(
...
@@ -67,6 +68,12 @@ int bake_probe_instance(
bake_bulk_create_in_t
,
bake_bulk_create_in_t
,
bake_bulk_create_out_t
,
bake_bulk_create_out_t
,
NULL
);
NULL
);
g_bake_bulk_write_id
=
MERCURY_REGISTER
(
g_binst
.
hg_class
,
"bake_bulk_write_rpc"
,
bake_bulk_write_in_t
,
bake_bulk_write_out_t
,
NULL
);
g_binst
.
mid
=
margo_init
(
0
,
0
,
g_binst
.
hg_context
);
g_binst
.
mid
=
margo_init
(
0
,
0
,
g_binst
.
hg_context
);
if
(
!
g_binst
.
mid
)
if
(
!
g_binst
.
mid
)
...
...
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