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
09dc6e31
Commit
09dc6e31
authored
Jun 26, 2016
by
Philip Carns
Browse files
noop rpc
parent
4ac0b187
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/bake-bulk.h
View file @
09dc6e31
...
...
@@ -143,6 +143,15 @@ int bake_shutdown_service(bake_target_id_t bti);
* Commented out for now but leaving it in place for reference
*/
/**
* Issue a no-op
*
* @param [in] bti BAKE target identifier
* @returns 0 on success, -1 on failure
*/
int
bake_bulk_noop
(
bake_target_id_t
bti
);
#if 0
/// ==== Some high-level goals ====
...
...
src/bake-bulk-rpc.c
View file @
09dc6e31
...
...
@@ -243,6 +243,17 @@ static void bake_bulk_get_size_ult(hg_handle_t handle)
}
DEFINE_MARGO_RPC_HANDLER
(
bake_bulk_get_size_ult
)
/* service a remote RPC for a no-op */
static
void
bake_bulk_noop_ult
(
hg_handle_t
handle
)
{
// printf("Got RPC request to noop bulk region.\n");
HG_Respond
(
handle
,
NULL
,
NULL
,
NULL
);
HG_Destroy
(
handle
);
return
;
}
DEFINE_MARGO_RPC_HANDLER
(
bake_bulk_noop_ult
)
/* TODO consolidate with write handler; read and write are nearly identical */
/* service a remote RPC that reads to a bulk region */
static
void
bake_bulk_read_ult
(
hg_handle_t
handle
)
...
...
src/bake-bulk-rpc.h
View file @
09dc6e31
...
...
@@ -69,6 +69,9 @@ MERCURY_GEN_PROC(bake_bulk_probe_out_t,
((
bake_target_id_t
)(
bti
)))
DECLARE_MARGO_RPC_HANDLER
(
bake_bulk_probe_ult
)
/* noop */
DECLARE_MARGO_RPC_HANDLER
(
bake_bulk_noop_ult
)
/* TODO: this should be somewhere else, just putting in this header for
* convenience right now. The type should only be visible to the server
* daemon and the rpc handlers.
...
...
src/bake-bulk-server.c
View file @
09dc6e31
...
...
@@ -139,6 +139,9 @@ int main(int argc, char **argv)
MERCURY_REGISTER
(
hg_class
,
"bake_bulk_probe_rpc"
,
void
,
bake_bulk_probe_out_t
,
bake_bulk_probe_ult_handler
);
MERCURY_REGISTER
(
hg_class
,
"bake_bulk_noop_rpc"
,
void
,
void
,
bake_bulk_noop_ult_handler
);
/* 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
...
...
src/bake-bulk.c
View file @
09dc6e31
...
...
@@ -28,6 +28,7 @@ struct hg_instance
hg_id_t
bake_bulk_persist_id
;
hg_id_t
bake_bulk_get_size_id
;
hg_id_t
bake_bulk_read_id
;
hg_id_t
bake_bulk_noop_id
;
};
/* Refers to an instance connected to a specific target */
...
...
@@ -113,6 +114,12 @@ static int hg_instance_init(const char *mercury_dest)
bake_bulk_read_in_t
,
bake_bulk_read_out_t
,
NULL
);
g_hginst
.
bake_bulk_noop_id
=
MERCURY_REGISTER
(
g_hginst
.
hg_class
,
"bake_bulk_noop_rpc"
,
void
,
void
,
NULL
);
g_hginst
.
mid
=
margo_init
(
0
,
0
,
g_hginst
.
hg_context
);
if
(
!
g_hginst
.
mid
)
...
...
@@ -472,6 +479,36 @@ int bake_bulk_get_size(
return
(
ret
);
}
int
bake_bulk_noop
(
bake_target_id_t
bti
)
{
hg_return_t
hret
;
hg_handle_t
handle
;
struct
bake_instance
*
instance
=
NULL
;
HASH_FIND
(
hh
,
instance_hash
,
&
bti
,
sizeof
(
bti
),
instance
);
if
(
!
instance
)
return
(
-
1
);
/* create handle */
hret
=
HG_Create
(
g_hginst
.
hg_context
,
instance
->
dest
,
g_hginst
.
bake_bulk_noop_id
,
&
handle
);
if
(
hret
!=
HG_SUCCESS
)
{
return
(
-
1
);
}
hret
=
margo_forward
(
g_hginst
.
mid
,
handle
,
NULL
);
if
(
hret
!=
HG_SUCCESS
)
{
HG_Destroy
(
handle
);
return
(
-
1
);
}
HG_Destroy
(
handle
);
return
(
0
);
}
int
bake_bulk_read
(
bake_target_id_t
bti
,
bake_bulk_region_id_t
rid
,
...
...
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