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

refactor: refactor replication_options initialize function #831

Merged
merged 7 commits into from
Jun 2, 2021

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented May 8, 2021

This pull request refactor part of function replication_options::initialize. This function will get options from config and store them including replica data directory (data_dirs). To get data_dirs, initialize will first parse config[data_dirs], then read black_list file, finally exclude the directories in black list. This pr add three functions to implement them, called: get_data_dir_and_tag, get_data_dirs_in_black_list and check_if_in_black_list, besides, add unit tests for those functions.

@hycdong hycdong marked this pull request as ready for review May 8, 2021 10:03
return;
}

ddebug_f("data_dirs_black_list_file[{}] found, apply it", fname.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ddebug_f("data_dirs_black_list_file[{}] found, apply it", fname);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pr is for refactor, so I copy old code into the new functions. I will update it.

src/common/replication_common.cpp Outdated Show resolved Hide resolved
src/common/replication_common.cpp Outdated Show resolved Hide resolved
acelyc111
acelyc111 previously approved these changes May 22, 2021
@Smityz
Copy link
Contributor

Smityz commented May 25, 2021

LGTM

levy5307
levy5307 previously approved these changes May 28, 2021
src/common/replication_common.cpp Outdated Show resolved Hide resolved
src/common/replication_common.cpp Outdated Show resolved Hide resolved
src/common/replication_common.cpp Outdated Show resolved Hide resolved
src/common/replication_common.cpp Outdated Show resolved Hide resolved
src/common/replication_common.cpp Outdated Show resolved Hide resolved
Copy link
Member

@acelyc111 acelyc111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@levy5307 levy5307 merged commit 78aefe1 into XiaoMi:master Jun 2, 2021
@hycdong hycdong deleted the init_fs_refactor branch June 2, 2021 09:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants