[ 
https://issues.apache.org/jira/browse/HDDS-16018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18100473#comment-18100473
 ] 

Shuo Huang commented on HDDS-16018:
-----------------------------------


Hi, I would like to work on this.

I evaluated the SCM mapping setup. In SCM, the configured DNSToSwitchMapping is 
currently wrapped with CachedDNSToSwitchMapping unless it is already an 
instance of CachedDNSToSwitchMapping.

I also checked the Hadoop dependency with this command:

{code:java}
javap -classpath 
~/.m2/repository/org/apache/hadoop/hadoop-common/3.4.3/hadoop-common-3.4.3.jar 
org.apache.hadoop.net.ScriptBasedMapping
{code}

The output shows:
{code:java}
public class org.apache.hadoop.net.ScriptBasedMapping extends 
org.apache.hadoop.net.CachedDNSToSwitchMapping
{code}
So the default cached behavior can be preserved without SCM wrapping every 
configured DNSToSwitchMapping.

For mappings such as StaticMapping, SCM currently adds an extra 
CachedDNSToSwitchMapping wrapper, which can change the input through hostname 
normalization before delegating to the configured mapping.

I plan to update SCM to use the configured mapping directly and add tests to 
cover both the default cached behavior and direct StaticMapping usage. Please 
let me know if this direction sounds reasonable.

> Avoid unnecessary CachedDNSToSwitchMapping wrapping in StorageContainerManager
> ------------------------------------------------------------------------------
>
>                 Key: HDDS-16018
>                 URL: https://issues.apache.org/jira/browse/HDDS-16018
>             Project: Apache Ozone
>          Issue Type: Improvement
>            Reporter: Hsu Han Wen
>            Assignee: Shuo Huang
>            Priority: Major
>
> Currently StorageContainerManager always wraps the configured
> DNSToSwitchMapping with CachedDNSToSwitchMapping.
> We should evaluate whether this wrapping is necessary for all mapping
> implementations, or whether implementations that do not require caching
> can be used directly.
> Related discussion:
> https://github.com/apache/ozone/pull/10598#discussion_r3670439580



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to