Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ public final class OzoneConfigKeys {

public static final String OZONE_NETWORK_TOPOLOGY_AWARE_READ_KEY =
"ozone.network.topology.aware.read";
public static final boolean OZONE_NETWORK_TOPOLOGY_AWARE_READ_DEFAULT = false;
public static final boolean OZONE_NETWORK_TOPOLOGY_AWARE_READ_DEFAULT = true;

public static final String OZONE_MANAGER_FAIR_LOCK = "ozone.om.lock.fair";
public static final boolean OZONE_MANAGER_FAIR_LOCK_DEFAULT = false;
Expand Down
4 changes: 2 additions & 2 deletions hadoop-hdds/common/src/main/resources/ozone-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@
</property>
<property>
<name>ozone.scm.container.placement.impl</name>
<value>org.apache.hadoop.hdds.scm.container.placement.algorithms.SCMContainerPlacementRandom</value>
<value>org.apache.hadoop.hdds.scm.container.placement.algorithms.SCMContainerPlacementRackAware</value>
<tag>OZONE, MANAGEMENT</tag>
<description>
The full name of class which implements
Expand Down Expand Up @@ -2753,7 +2753,7 @@
</property>
<property>
<name>ozone.network.topology.aware.read</name>
<value>false</value>
<value>true</value>
<tag>OZONE, PERFORMANCE</tag>
<description>
Whether to enable topology aware read to improve the read performance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,13 @@ public void testRackAwarePolicy() throws IOException {
}

@Test
public void testDefaultPolicy() throws IOException {
public void testRackAwareContainerPolicy() throws IOException {
conf.set(ScmConfigKeys.OZONE_SCM_CONTAINER_PLACEMENT_IMPL_KEY,
SCMContainerPlacementRackAware.class.getName());
PlacementPolicy policy = ContainerPlacementPolicyFactory
.getPolicy(conf, null, null, true, null);
Assertions.assertSame(SCMContainerPlacementRandom.class, policy.getClass());
Assertions.assertSame(SCMContainerPlacementRackAware.class,
policy.getClass());
}
Comment on lines 165 to 173
Copy link
Contributor

Choose a reason for hiding this comment

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

I would have preferred keeping the intention of this test: testing default setting. Sorry for not noticing this earlier.


@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public void testCorrectDnsReturnedFromPipeline() throws IOException {
@Timeout(5)
public void testRandomFirstNodeIsCommandTarget() throws IOException {
final ArrayList<DatanodeDetails> allDNs = new ArrayList<>(dns);
conf.setBoolean(
OzoneConfigKeys.OZONE_NETWORK_TOPOLOGY_AWARE_READ_KEY, false);
// Using a new Xceiver Client, call it repeatedly until all DNs in the
// pipeline have been the target of the command, indicating it is shuffling
// the DNs on each call with a new client. This test will timeout if this
Expand Down