Skip to content

Commit

Permalink
Remove Doxygen warnings for src/rpc_thallium.h. (HDFGroup#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoklee committed Nov 1, 2022
1 parent ac3791d commit f6ffd8b
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/rpc_thallium.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ namespace tl = thallium;

namespace hermes {

const int kMaxServerNamePrefix = 32;
const int kMaxServerNamePostfix = 8;
const char kBoPrefix[] = "BO::";
const int kMaxServerNamePrefix = 32; /**< max. server name prefix */
const int kMaxServerNamePostfix = 8; /**< max. server name suffix */
const char kBoPrefix[] = "BO::"; /**< buffer organizer prefix */
/** buffer organizer prefix length */
const int kBoPrefixLength = sizeof(kBoPrefix) - 1;

/**
Expand Down Expand Up @@ -86,7 +87,7 @@ void serialize(A &ar, BucketID &bucket_id) {
* This function is called implicitly by Thallium.
*
* @param ar An archive provided by Thallium.
* @param bucket_id The VBucketID to serialize.
* @param vbucket_id The VBucketID to serialize.
*/
template <typename A>
void serialize(A &ar, VBucketID &vbucket_id) {
Expand Down Expand Up @@ -119,6 +120,7 @@ void serialize(A &ar, TargetID &target_id) {
ar &target_id.as_int;
}

/** serialize \a swap_blob */
template <typename A>
void serialize(A &ar, SwapBlob &swap_blob) {
ar &swap_blob.node_id;
Expand All @@ -127,6 +129,7 @@ void serialize(A &ar, SwapBlob &swap_blob) {
ar &swap_blob.bucket_id;
}

/** serialize \a info */
template <typename A>
void serialize(A &ar, BufferInfo &info) {
ar &info.id;
Expand Down Expand Up @@ -169,25 +172,29 @@ void load(A &ar, MapType &map_type) {
map_type = (MapType)val;
}

/** save \a priority */
template <typename A>
void save(A &ar, BoPriority &priority) {
int val = (int)priority;
ar.write(&val, 1);
}

/** load \a priority */
template <typename A>
void load(A &ar, BoPriority &priority) {
int val = 0;
ar.read(&val, 1);
priority = (BoPriority)val;
}

/** save \a violation */
template <typename A>
void save(A &ar, ThresholdViolation &violation) {
int val = (int)violation;
ar.write(&val, 1);
}

/** load \a violation */
template <typename A>
void load(A &ar, ThresholdViolation &violation) {
int val = 0;
Expand All @@ -196,31 +203,36 @@ void load(A &ar, ThresholdViolation &violation) {
}
#endif // #ifndef THALLIUM_USE_CEREAL

/** save buffer organizer \a op */
template <typename A>
void save(A &ar, BoOperation &op) {
int val = (int)op;
ar.write(&val, 1);
}

/** load buffer organizer \a op */
template <typename A>
void load(A &ar, BoOperation &op) {
int val = 0;
ar.read(&val, 1);
op = (BoOperation)val;
}

/** serialize buffer organizer arguments */
template <typename A>
void serialize(A &ar, BoArgs &bo_args) {
ar &bo_args.move_args.src;
ar &bo_args.move_args.dest;
}

/** serialize buffer organizer task */
template <typename A>
void serialize(A &ar, BoTask &bo_task) {
ar &bo_task.op;
ar &bo_task.args;
}

/** serialize violation information */
template <typename A>
void serialize(A &ar, ViolationInfo &info) {
ar &info.target_id;
Expand Down Expand Up @@ -250,19 +262,21 @@ void load(A &ar, api::Context &ctx) {

std::string GetRpcAddress(RpcContext *rpc, Config *config, u32 node_id,
int port);

/** get Thallium state */
static inline ThalliumState *GetThalliumState(RpcContext *rpc) {
ThalliumState *result = (ThalliumState *)rpc->state;

return result;
}

/** get Thallium client state */
static inline ClientThalliumState *GetClientThalliumState(RpcContext *rpc) {
ClientThalliumState *result = (ClientThalliumState *)rpc->client_rpc.state;

return result;
}

/** is \a func_name buffer organizer function? */
static bool IsBoFunction(const char *func_name) {
bool result = false;
int i = 0;
Expand All @@ -281,6 +295,7 @@ static bool IsBoFunction(const char *func_name) {
return result;
}

/** RPC call */
template <typename ReturnType, typename... Ts>
ReturnType RpcCall(RpcContext *rpc, u32 node_id, const char *func_name,
Ts... args) {
Expand Down

0 comments on commit f6ffd8b

Please sign in to comment.