-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-11580. Validate 'hdds.datanode.dir.du.reserved' property #7328
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
Changes from 5 commits
3b01c56
56df4b2
e21e162
0f51afe
aad72a8
208fb96
417e8c9
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |||||
|
|
||||||
| import org.apache.hadoop.conf.StorageUnit; | ||||||
| import org.apache.hadoop.hdds.HddsConfigKeys; | ||||||
| import org.apache.hadoop.hdds.conf.ConfigurationException; | ||||||
| import org.apache.hadoop.hdds.conf.OzoneConfiguration; | ||||||
| import org.apache.hadoop.hdds.fs.MockSpaceUsageCheckFactory; | ||||||
| import org.apache.hadoop.hdds.scm.ScmConfigKeys; | ||||||
|
|
@@ -36,6 +37,7 @@ | |||||
| import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_DATANODE_VOLUME_MIN_FREE_SPACE_PERCENT; | ||||||
| import static org.apache.hadoop.hdds.scm.ScmConfigKeys.HDDS_DATANODE_DIR_DU_RESERVED_PERCENT; | ||||||
| import static org.apache.hadoop.hdds.scm.ScmConfigKeys.HDDS_DATANODE_DIR_DU_RESERVED_PERCENT_DEFAULT; | ||||||
| import static org.apache.ozone.test.GenericTestUtils.assertThrows; | ||||||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||||||
| import static org.junit.jupiter.api.Assertions.assertNotEquals; | ||||||
|
|
||||||
|
|
@@ -166,6 +168,17 @@ public void testInvalidConfig() throws Exception { | |||||
| assertEquals(getExpectedDefaultReserved(hddsVolume2), reservedFromVolume2); | ||||||
| } | ||||||
|
|
||||||
| @Test() | ||||||
|
||||||
| @Test() | |
| @Test |
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.
Fixed
Outdated
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.
assertThrows(ConfigurationException.class, () -> volumeBuilder.conf(conf).build());
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.
and let's also check exception message
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.
Done
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 be written like this:
assertThrows(ConfigurationException.class, () -> volumeBuilder.conf(conf).build());
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.
let's mention the name of the property and what current value is
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.
Done