Commit c333e05d authored by Matthieu Dorier's avatar Matthieu Dorier

renamed bake_migrate => bake_migrate_region

parent ae3f4d88
......@@ -334,7 +334,7 @@ int bake_proxy_read(
*
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_migrate(
int bake_migrate_region(
bake_provider_handle_t source,
bake_region_id_t source_rid,
int remove_source,
......@@ -343,6 +343,55 @@ int bake_migrate(
bake_target_id_t dest_target_id,
bake_region_id_t* dest_rid);
/**
* @brief Requests the source provider to migrate a particular
* region (source_rid) to a destination provider. After the call,
* the designated region will have been removed from the source
* and the dest_rid parameter will be set to the new region id
* in the destination provider.
*
* @param source Source provider.
* @param source_rid Region to migrate.
* @param remove_source Whether the source region should be removed.
* @param dest_addr Address of the destination provider.
* @param dest_provider_id Id of the destination provider.
* @param dest_target_id Destination target.
* @param dest_rid Resulting region id in the destination target.
*
* @return BAKE_SUCCESS or corresponding error code.
*/
__attribute__((deprecated("use bake_migrate_region instead")))
inline int bake_migrate(
bake_provider_handle_t source,
bake_region_id_t source_rid,
int remove_source,
const char* dest_addr,
uint16_t dest_provider_id,
bake_target_id_t dest_target_id,
bake_region_id_t* dest_rid)
{
return bake_migrate_region(source, source_rid, remove_source,
dest_addr, dest_provider_id, dest_target_id, dest_rid);
}
/**
* @brief Migrates a full target from a provider to another.
*
* @param source Provider initially managing the target
* @param src_target_id Source target it.
* @param remove_source Whether the source target should be removed.
* @param dest_addr Address of the destination provider.
* @param dest_provider_id Provider id of the destination provider.
*
* @return BAKE_SUCCESS or corresponding error code.
*/
int bake_migrate_target(
bake_provider_handle_t source,
bake_target_id_t src_target_id,
int remove_source,
const char* dest_addr,
uint16_t dest_provider_id);
/**
* Shuts down a remote BAKE service (given an address).
* This will shutdown all the providers on the target address.
......
......@@ -34,7 +34,7 @@ struct bake_client
hg_id_t bake_read_id;
hg_id_t bake_noop_id;
hg_id_t bake_remove_id;
hg_id_t bake_migrate_id;
hg_id_t bake_migrate_region_id;
uint64_t num_provider_handles;
};
......@@ -70,7 +70,7 @@ static int bake_client_register(bake_client_t client, margo_instance_id mid)
margo_registered_name(mid, "bake_read_rpc", &client->bake_read_id, &flag);
margo_registered_name(mid, "bake_noop_rpc", &client->bake_noop_id, &flag);
margo_registered_name(mid, "bake_remove_rpc", &client->bake_remove_id, &flag);
margo_registered_name(mid, "bake_migrate_rpc", &client->bake_migrate_id, &flag);
margo_registered_name(mid, "bake_migrate_region_rpc", &client->bake_migrate_region_id, &flag);
} else { /* RPCs not already registered */
......@@ -110,9 +110,9 @@ static int bake_client_register(bake_client_t client, margo_instance_id mid)
client->bake_remove_id =
MARGO_REGISTER(mid, "bake_remove_rpc",
bake_remove_in_t, bake_remove_out_t, NULL);
client->bake_migrate_id =
MARGO_REGISTER(mid, "bake_migrate_rpc",
bake_migrate_in_t, bake_migrate_out_t, NULL);
client->bake_migrate_region_id =
MARGO_REGISTER(mid, "bake_migrate_region_rpc",
bake_migrate_region_in_t, bake_migrate_region_out_t, NULL);
}
return BAKE_SUCCESS;
......@@ -721,7 +721,7 @@ int bake_get_data(
return(ret);
}
int bake_migrate(
int bake_migrate_region(
bake_provider_handle_t source,
bake_region_id_t source_rid,
int remove_source,
......@@ -732,8 +732,8 @@ int bake_migrate(
{
hg_return_t hret;
hg_handle_t handle;
bake_migrate_in_t in;
bake_migrate_out_t out;
bake_migrate_region_in_t in;
bake_migrate_region_out_t out;
int ret;
in.source_rid = source_rid;
......@@ -743,7 +743,7 @@ int bake_migrate(
in.dest_target_id = dest_target_id;
hret = margo_create(source->client->mid, source->addr,
source->client->bake_migrate_id, &handle);
source->client->bake_migrate_region_id, &handle);
if(hret != HG_SUCCESS)
return BAKE_ERR_MERCURY;
......
......@@ -122,14 +122,14 @@ MERCURY_GEN_PROC(bake_remove_in_t,
MERCURY_GEN_PROC(bake_remove_out_t,
((int32_t)(ret)))
/* BAKE migrate */
MERCURY_GEN_PROC(bake_migrate_in_t,
/* BAKE migrate region */
MERCURY_GEN_PROC(bake_migrate_region_in_t,
((bake_region_id_t)(source_rid))\
((int32_t)(remove_src))\
((hg_const_string_t)(dest_addr))\
((uint16_t)(dest_provider_id))\
((bake_target_id_t)(dest_target_id)))
MERCURY_GEN_PROC(bake_migrate_out_t,
MERCURY_GEN_PROC(bake_migrate_region_out_t,
((int32_t)(ret))\
((bake_region_id_t)(dest_rid)))
......
......@@ -25,7 +25,7 @@ DECLARE_MARGO_RPC_HANDLER(bake_eager_read_ult)
DECLARE_MARGO_RPC_HANDLER(bake_probe_ult)
DECLARE_MARGO_RPC_HANDLER(bake_noop_ult)
DECLARE_MARGO_RPC_HANDLER(bake_remove_ult)
DECLARE_MARGO_RPC_HANDLER(bake_migrate_ult)
DECLARE_MARGO_RPC_HANDLER(bake_migrate_region_ult)
/* definition of BAKE root data structure (just a uuid for now) */
typedef struct
......@@ -163,8 +163,8 @@ int bake_provider_register(
bake_remove_in_t, bake_remove_out_t, bake_remove_ult,
provider_id, abt_pool);
margo_register_data(mid, rpc_id, (void*)tmp_svr_ctx, NULL);
rpc_id = MARGO_REGISTER_PROVIDER(mid, "bake_migrate_rpc",
bake_migrate_in_t, bake_migrate_out_t, bake_migrate_ult,
rpc_id = MARGO_REGISTER_PROVIDER(mid, "bake_migrate_region_rpc",
bake_migrate_region_in_t, bake_migrate_region_out_t, bake_migrate_region_ult,
provider_id, abt_pool);
margo_register_data(mid, rpc_id, (void*)tmp_svr_ctx, NULL);
......@@ -1134,10 +1134,10 @@ static void bake_remove_ult(hg_handle_t handle)
}
DEFINE_MARGO_RPC_HANDLER(bake_remove_ult)
static void bake_migrate_ult(hg_handle_t handle)
static void bake_migrate_region_ult(hg_handle_t handle)
{
bake_migrate_in_t in;
bake_migrate_out_t out;
bake_migrate_region_in_t in;
bake_migrate_region_out_t out;
hg_return_t hret;
pmemobj_region_id_t* prid;
......@@ -1277,7 +1277,7 @@ static void bake_migrate_ult(hg_handle_t handle)
return;
}
DEFINE_MARGO_RPC_HANDLER(bake_migrate_ult)
DEFINE_MARGO_RPC_HANDLER(bake_migrate_region_ult)
static void bake_server_finalize_cb(void *data)
{
......
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