-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29594: Add suffix to Master Region data directory #7330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: HBASE-29081
Are you sure you want to change the base?
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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.
LGTM. I just have a couple of very minor nits
Path rootDir = CommonFSUtils.getRootDir(conf); | ||
|
||
assertTrue("Master region directory should use the suffix", | ||
fs.exists(new Path(rootDir, "MasterData_replica1"))); |
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.
nit
fs.exists(new Path(rootDir, "MasterData_replica1"))); | |
fs.exists(new Path(rootDir, MasterRegionFactory.MASTER_STORE_DIR + "_replica1"))); |
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 don't think this is needed. Tests are good to have hardcoded values in order to detect anomalies in the code which happened after the test was introduced.
assertTrue("Master region directory should use the suffix", | ||
fs.exists(new Path(rootDir, "MasterData_replica1"))); | ||
assertFalse("Default master region directory should not exist when suffix is used", | ||
fs.exists(new Path(rootDir, "MasterData"))); |
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.
nit
fs.exists(new Path(rootDir, "MasterData"))); | |
fs.exists(new Path(rootDir, MasterRegionFactory.MASTER_STORE_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.
Same here.
public static final String USE_HSYNC_KEY = "hbase.master.store.region.wal.hsync"; | ||
|
||
// Default master data dir | ||
public static final String MASTER_STORE_DIR = "MasterData"; |
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 we make this private to make sure nobody is using it outside of this class?
private void addAllHFiles() throws IOException { | ||
Path masterProcDir = | ||
new Path(CommonFSUtils.getRootDir(conf), MasterRegionFactory.MASTER_STORE_DIR); | ||
new Path(CommonFSUtils.getRootDir(conf), MasterRegionFactory.getMasterRegionDirName(conf)); |
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.
Instead of calling the setter from here, add a new read-only property which will return the correct region dir name. Essentially making the property immutable.
Path rootDir = CommonFSUtils.getRootDir(conf); | ||
|
||
assertTrue("Master region directory should use the suffix", | ||
fs.exists(new Path(rootDir, "MasterData_replica1"))); |
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 don't think this is needed. Tests are good to have hardcoded values in order to detect anomalies in the code which happened after the test was introduced.
assertTrue("Master region directory should use the suffix", | ||
fs.exists(new Path(rootDir, "MasterData_replica1"))); | ||
assertFalse("Default master region directory should not exist when suffix is used", | ||
fs.exists(new Path(rootDir, "MasterData"))); |
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.
Same here.
Jira: Add suffix to Master Region data directory