HDDS-1801. Make Topology Aware Replication/Read non-default for ozone 0.4.1. Contributed by Xiaoyu Yao.
Signed-off-by: Anu Engineer <aengineer@apache.org>
This commit is contained in:
parent
c58e11bf52
commit
eb0849b547
|
@ -110,7 +110,8 @@ public class XceiverClientGrpc extends XceiverClientSpi {
|
||||||
public void connect() throws Exception {
|
public void connect() throws Exception {
|
||||||
// connect to the closest node, if closest node doesn't exist, delegate to
|
// connect to the closest node, if closest node doesn't exist, delegate to
|
||||||
// first node, which is usually the leader in the pipeline.
|
// first node, which is usually the leader in the pipeline.
|
||||||
DatanodeDetails dn = this.pipeline.getClosestNode();
|
DatanodeDetails dn = topologyAwareRead ? this.pipeline.getClosestNode() :
|
||||||
|
this.pipeline.getFirstNode();
|
||||||
// just make a connection to the picked datanode at the beginning
|
// just make a connection to the picked datanode at the beginning
|
||||||
connectToDatanode(dn, null);
|
connectToDatanode(dn, null);
|
||||||
}
|
}
|
||||||
|
@ -122,8 +123,8 @@ public class XceiverClientGrpc extends XceiverClientSpi {
|
||||||
public void connect(String encodedToken) throws Exception {
|
public void connect(String encodedToken) throws Exception {
|
||||||
// connect to the closest node, if closest node doesn't exist, delegate to
|
// connect to the closest node, if closest node doesn't exist, delegate to
|
||||||
// first node, which is usually the leader in the pipeline.
|
// first node, which is usually the leader in the pipeline.
|
||||||
DatanodeDetails dn;
|
DatanodeDetails dn = topologyAwareRead ? this.pipeline.getClosestNode() :
|
||||||
dn = this.pipeline.getClosestNode();
|
this.pipeline.getFirstNode();
|
||||||
// just make a connection to the picked datanode at the beginning
|
// just make a connection to the picked datanode at the beginning
|
||||||
connectToDatanode(dn, encodedToken);
|
connectToDatanode(dn, encodedToken);
|
||||||
}
|
}
|
||||||
|
|
|
@ -317,10 +317,6 @@ public final class ScmConfigKeys {
|
||||||
public static final String OZONE_SCM_CONTAINER_PLACEMENT_IMPL_KEY =
|
public static final String OZONE_SCM_CONTAINER_PLACEMENT_IMPL_KEY =
|
||||||
"ozone.scm.container.placement.impl";
|
"ozone.scm.container.placement.impl";
|
||||||
|
|
||||||
public static final String OZONE_SCM_CONTAINER_PLACEMENT_IMPL_DEFAULT =
|
|
||||||
"org.apache.hadoop.hdds.scm.container.placement.algorithms." +
|
|
||||||
"SCMContainerPlacementRackAware";
|
|
||||||
|
|
||||||
public static final String OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT =
|
public static final String OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT =
|
||||||
"ozone.scm.pipeline.owner.container.count";
|
"ozone.scm.pipeline.owner.container.count";
|
||||||
public static final int OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT_DEFAULT = 3;
|
public static final int OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT_DEFAULT = 3;
|
||||||
|
@ -371,7 +367,7 @@ public final class ScmConfigKeys {
|
||||||
public static final String DFS_NETWORK_TOPOLOGY_AWARE_READ_ENABLED =
|
public static final String DFS_NETWORK_TOPOLOGY_AWARE_READ_ENABLED =
|
||||||
"dfs.network.topology.aware.read.enable";
|
"dfs.network.topology.aware.read.enable";
|
||||||
public static final String DFS_NETWORK_TOPOLOGY_AWARE_READ_ENABLED_DEFAULT =
|
public static final String DFS_NETWORK_TOPOLOGY_AWARE_READ_ENABLED_DEFAULT =
|
||||||
"true";
|
"false";
|
||||||
|
|
||||||
public static final String HDDS_TRACING_ENABLED = "hdds.tracing.enabled";
|
public static final String HDDS_TRACING_ENABLED = "hdds.tracing.enabled";
|
||||||
public static final boolean HDDS_TRACING_ENABLED_DEFAULT = true;
|
public static final boolean HDDS_TRACING_ENABLED_DEFAULT = true;
|
||||||
|
|
|
@ -823,13 +823,13 @@
|
||||||
<property>
|
<property>
|
||||||
<name>ozone.scm.container.placement.impl</name>
|
<name>ozone.scm.container.placement.impl</name>
|
||||||
<value>
|
<value>
|
||||||
org.apache.hadoop.hdds.scm.container.placement.algorithms.SCMContainerPlacementRackAware
|
org.apache.hadoop.hdds.scm.container.placement.algorithms.SCMContainerPlacementRandom
|
||||||
</value>
|
</value>
|
||||||
<tag>OZONE, MANAGEMENT</tag>
|
<tag>OZONE, MANAGEMENT</tag>
|
||||||
<description>
|
<description>
|
||||||
The full name of class which implements org.apache.hadoop.hdds.scm.container.placement.algorithms.ContainerPlacementPolicy.
|
The full name of class which implements org.apache.hadoop.hdds.scm.container.placement.algorithms.ContainerPlacementPolicy.
|
||||||
The class decides which datanode will be used to host the container replica. If not set,
|
The class decides which datanode will be used to host the container replica. If not set,
|
||||||
org.apache.hadoop.hdds.scm.container.placement.algorithms.SCMContainerPlacementRackAware will be used as default value.
|
org.apache.hadoop.hdds.scm.container.placement.algorithms.SCMContainerPlacementRandom will be used as default value.
|
||||||
</description>
|
</description>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
|
@ -2347,7 +2347,7 @@
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>dfs.network.topology.aware.read.enable</name>
|
<name>dfs.network.topology.aware.read.enable</name>
|
||||||
<value>true</value>
|
<value>false</value>
|
||||||
<tag>OZONE, PERFORMANCE</tag>
|
<tag>OZONE, PERFORMANCE</tag>
|
||||||
<description>
|
<description>
|
||||||
Whether to enable topology aware read to improve the read performance.
|
Whether to enable topology aware read to improve the read performance.
|
||||||
|
|
|
@ -34,6 +34,10 @@ public final class ContainerPlacementPolicyFactory {
|
||||||
private static final Logger LOG =
|
private static final Logger LOG =
|
||||||
LoggerFactory.getLogger(ContainerPlacementPolicyFactory.class);
|
LoggerFactory.getLogger(ContainerPlacementPolicyFactory.class);
|
||||||
|
|
||||||
|
private static final Class<? extends ContainerPlacementPolicy>
|
||||||
|
OZONE_SCM_CONTAINER_PLACEMENT_IMPL_DEFAULT =
|
||||||
|
SCMContainerPlacementRandom.class;
|
||||||
|
|
||||||
private ContainerPlacementPolicyFactory() {
|
private ContainerPlacementPolicyFactory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +46,7 @@ public final class ContainerPlacementPolicyFactory {
|
||||||
final boolean fallback) throws SCMException{
|
final boolean fallback) throws SCMException{
|
||||||
final Class<? extends ContainerPlacementPolicy> placementClass = conf
|
final Class<? extends ContainerPlacementPolicy> placementClass = conf
|
||||||
.getClass(ScmConfigKeys.OZONE_SCM_CONTAINER_PLACEMENT_IMPL_KEY,
|
.getClass(ScmConfigKeys.OZONE_SCM_CONTAINER_PLACEMENT_IMPL_KEY,
|
||||||
SCMContainerPlacementRackAware.class,
|
OZONE_SCM_CONTAINER_PLACEMENT_IMPL_DEFAULT,
|
||||||
ContainerPlacementPolicy.class);
|
ContainerPlacementPolicy.class);
|
||||||
Constructor<? extends ContainerPlacementPolicy> constructor;
|
Constructor<? extends ContainerPlacementPolicy> constructor;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -26,11 +26,12 @@ OZONE-SITE.XML_ozone.scm.client.address=scm
|
||||||
OZONE-SITE.XML_ozone.replication=1
|
OZONE-SITE.XML_ozone.replication=1
|
||||||
OZONE-SITE.XML_hdds.datanode.dir=/data/hdds
|
OZONE-SITE.XML_hdds.datanode.dir=/data/hdds
|
||||||
OZONE-SITE.XML_hdds.profiler.endpoint.enabled=true
|
OZONE-SITE.XML_hdds.profiler.endpoint.enabled=true
|
||||||
|
OZONE-SITE.XML_ozone.scm.container.placement.impl=org.apache.hadoop.hdds.scm.container.placement.algorithms.SCMContainerPlacementRackAware
|
||||||
|
OZONE-SITE.XML_net.topology.node.switch.mapping.impl=org.apache.hadoop.net.TableMapping
|
||||||
|
OZONE-SITE.XML_net.topology.table.file.name=/opt/hadoop/compose/ozone-topology/network-config
|
||||||
|
OZONE-SITE.XML_dfs.network.topology.aware.read.enable=true
|
||||||
HDFS-SITE.XML_rpc.metrics.quantile.enable=true
|
HDFS-SITE.XML_rpc.metrics.quantile.enable=true
|
||||||
HDFS-SITE.XML_rpc.metrics.percentiles.intervals=60,300
|
HDFS-SITE.XML_rpc.metrics.percentiles.intervals=60,300
|
||||||
HDFS-SITE.XML_net.topology.node.switch.mapping.impl=org.apache.hadoop.net.TableMapping
|
|
||||||
HDFS-SITE.XML_net.topology.table.file.name=/opt/hadoop/compose/ozone-topology/network-config
|
|
||||||
HDFS-SITE.XML_dfs.network.topology.aware.read.enable=true
|
|
||||||
ASYNC_PROFILER_HOME=/opt/profiler
|
ASYNC_PROFILER_HOME=/opt/profiler
|
||||||
LOG4J.PROPERTIES_log4j.rootLogger=DEBUG, ARF
|
LOG4J.PROPERTIES_log4j.rootLogger=DEBUG, ARF
|
||||||
LOG4J.PROPERTIES_log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
LOG4J.PROPERTIES_log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||||
|
|
Loading…
Reference in New Issue