Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class TestAvailableSpaceRackFaultTolerantBPP {
public static void setupCluster() throws Exception {
conf = new HdfsConfiguration();
conf.setFloat(
DFSConfigKeys.DFS_NAMENODE_AVAILABLE_SPACE_BLOCK_PLACEMENT_POLICY_BALANCED_SPACE_PREFERENCE_FRACTION_KEY,
DFSConfigKeys.DFS_NAMENODE_AVAILABLE_SPACE_RACK_FAULT_TOLERANT_BLOCK_PLACEMENT_POLICY_BALANCED_SPACE_PREFERENCE_FRACTION_KEY,
0.6f);
String[] racks = new String[NUM_RACKS];
for (int i = 0; i < NUM_RACKS; i++) {
Expand Down Expand Up @@ -189,6 +189,13 @@ public void testChooseDataNode() {
}
}

@Test
public void testDefaultConfigValue() {
Assert.assertEquals(
conf.get("DFS_NAMENODE_AVAILABLE_SPACE_RACK_FAULT_TOLERANT_BLOCK_PLACEMENT_POLICY_BALANCED_SPACE_PREFERENCE_FRACTION_KEY")
,0.6f);
}

Copy link
Member

Choose a reason for hiding this comment

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

This isn't required, this isn't checking the BPP, but how the conf object works. you can remove this test.

Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't required, this isn't checking the BPP, but how the conf object works. you can remove this test.

Thanks @ayushtkn for your review. I have removed the test case, but not sure if the CI will pass if no tests added. hope it works.

/**
* Test if the nodes are all spread across all racks.
*/
Expand Down