Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat(bulk_load): add bulk load manager for meta #986

Merged
merged 5 commits into from
Dec 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions include/dsn/cpp/json_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,18 @@ inline bool json_decode(const JsonObject &in, std::string &str)
return true;
}

inline void json_encode(JsonWriter &out, const error_code &err)
{
const char *str = err.to_string();
out.String(str, strlen(str), true);
}
inline bool json_decode(const JsonObject &in, error_code &err)
{
dverify(in.IsString());
err = error_code(in.GetString());
return true;
}

// json serialization for bool types.
// for compatibility, we treat bool as integers, which is not this case in json standard
inline void json_encode(JsonWriter &out, bool t) { out.Int(t ? 1 : 0); }
Expand Down
1 change: 1 addition & 0 deletions include/dsn/utility/error_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,5 @@ DEFINE_ERR_CODE(ERR_SPLITTING)
DEFINE_ERR_CODE(ERR_PARENT_PARTITION_MISUSED)
DEFINE_ERR_CODE(ERR_CHILD_NOT_READY)
DEFINE_ERR_CODE(ERR_DISK_INSUFFICIENT)
DEFINE_ERR_CODE(ERR_RETRY_EXHAUSTED)
} // namespace dsn
8 changes: 7 additions & 1 deletion src/common/bulk_load.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,14 @@ struct query_bulk_load_request
struct query_bulk_load_response
{
// Possible error:
// - ERR_OK
// - ERR_APP_NOT_EXIST: app not exist
// - ERR_APP_DROPPED: app has been dropped
// - ERR_INVALID_STATE: app is not executing bulk load
// - ERR_FILE_OPERATION_FAILED: local file system error
// - ERR_FS_INTERNAL: remote file system error
// - ERR_CORRUPTION: file not exist or damaged
// - ERR_INGESTION_FAILED: ingest failed
// - ERR_RETRY_EXHAUSTED: retry too many times
1:dsn.error_code err;
2:string app_name;
3:bulk_load_status app_status;
Expand All @@ -206,4 +211,5 @@ struct query_bulk_load_response
// detailed bulk load state for each replica
6:list<map<dsn.rpc_address, partition_bulk_load_state>> bulk_load_states;
7:optional string hint_msg;
8:bool is_bulk_loading;
GiantKing marked this conversation as resolved.
Show resolved Hide resolved
hycdong marked this conversation as resolved.
Show resolved Hide resolved
}
Loading