-
Notifications
You must be signed in to change notification settings - Fork 59
feat(bulk_load): add start bulk load http interface #693
Changes from all commits
6cbe47a
adf5114
5f78323
28fd319
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,15 @@ | |
|
||
#include <algorithm> | ||
|
||
#include <dsn/cpp/json_helper.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can move this line to the corresponding cpp file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This update is for further pull request, I will add structure in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I think you can add this line in the future pull request, because it's meaningless for this pr. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is still useful for this pull request, I use |
||
#include <dsn/http/http_server.h> | ||
|
||
namespace dsn { | ||
namespace replication { | ||
|
||
NON_MEMBER_JSON_SERIALIZATION( | ||
start_bulk_load_request, app_name, cluster_name, file_provider_type, remote_root_path) | ||
|
||
class meta_service; | ||
class meta_http_service : public http_service | ||
{ | ||
|
@@ -59,6 +63,13 @@ class meta_http_service : public http_service | |
std::placeholders::_1, | ||
std::placeholders::_2), | ||
"ip:port/meta/backup_policy"); | ||
// request body should be start_bulk_load_request | ||
register_handler("app/start_bulk_load", | ||
std::bind(&meta_http_service::start_bulk_load_handler, | ||
this, | ||
std::placeholders::_1, | ||
std::placeholders::_2), | ||
"ip:port/meta/start_bulk_load"); | ||
register_handler("app/query_bulk_load", | ||
std::bind(&meta_http_service::query_bulk_load_handler, | ||
this, | ||
|
@@ -76,6 +87,7 @@ class meta_http_service : public http_service | |
void get_app_envs_handler(const http_request &req, http_response &resp); | ||
void query_backup_policy_handler(const http_request &req, http_response &resp); | ||
void query_duplication_handler(const http_request &req, http_response &resp); | ||
void start_bulk_load_handler(const http_request &req, http_response &resp); | ||
void query_bulk_load_handler(const http_request &req, http_response &resp); | ||
|
||
private: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this simple args validate put client side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In current implmetation, client and server both will validate arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will implement HTTP argument validation in later PR. I actually did it in my staging branch. But haven't ready for review yet. Got no time to make it steady.