-
Notifications
You must be signed in to change notification settings - Fork 58
nfs: remove nfs from service engine, refactor nfs to a single module #142
Conversation
@@ -84,7 +84,8 @@ void replica::on_checkpoint_timer() | |||
(int64_t)_options->log_private_reserve_max_size_mb * 1024 * 1024, | |||
(int64_t)_options->log_private_reserve_max_time_seconds); | |||
if (status() == partition_status::PS_PRIMARY) | |||
_counter_private_log_size->set(_private_log->total_size() / 1000000); | |||
_counter_private_log_size->set(_private_log->total_size() / |
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.
这个改动是不是没必要
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.
这个改回来了,我也没明白为啥原来换了一行。
} | ||
|
||
aio_task_ptr nfs_node::copy_remote_directory(rpc_address remote, | ||
const std::string &source_dir, |
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.
接口传 String 参数推荐用 string_view
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.
之前用的也是string,我就没改。string_view的好处是,传const char*进来,能避免一次拷贝吗?
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.
是的,行业内一般接口是用的 string_view,像 rocksdb 用的 Slice。内部类无所谓。这个我觉得尽量吧,不行也没关系。
} | ||
|
||
aio_task_ptr nfs_node::copy_remote_files(rpc_address remote, | ||
const std::string &source_dir, |
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.
我理解这个是我们 copy file 的新的接口,替代 dsn_file_copy_remote_files
?那应该用 string_view。
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.
这个因为有个vectorstd::string, 所以为了看起来一致舒服一些,就用了string了
几个问题哈:
|
|
No description provided.