-
Notifications
You must be signed in to change notification settings - Fork 59
refactor(split): move replica split functions into replica_split_manager class #624
Conversation
Name the directory to |
Done |
|
||
#pragma once | ||
|
||
#include "replica/replica.h" |
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.
why didn't you name it partition_split_manager
?
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.
The class name is replica_split_manager
, showing the function is partition_split, and it is used for replica, just like replica_bulk_loader
.
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.
But I saw some comments write Partition Split
, this will make someone new confused with it.
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.
The suitable class name may be replica_partition_split_manager
, but it is a little long, so I name it replica_split_manager
, split
is the abbreviation of partition split
. Could you please tell me what is your confusion raised by partition split
?
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 think it is better to give it a uniform name. or someone without a relevant knowledge background may feel confused with what's the difference between partition split
and replica split
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.
Partition Split is the user-facing word. Inside the implementation, child/parent replica both do the split job, in replica level. So replica_split_manager
is more accurate.
Futhermore, it would be better if child and parent could be separated to different classes.
In previous implmentation, split varieties and functions are defined in
replica.h
, this pull request adds a new classreplica_split_manager
and moves them into this class.replica.h
tosplit/replica_split_manager.h
replica_split.cpp
tosplit/replica_split_manager.cpp
test/replica_split_test.cpp
intosplit/test/replica_split_test.cpp
By the way, code of split will be deep refactored in further pull request, this pull request only does basic refactor to add replica_split_manager class.