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

Lisheng Sun commented on HDFS-15255:
------------------------------------

According to DatanodeInfoWithStorage, DatanodeDescriptor, DatanodeInfo 's 
relationship, I write a test program as follow:

I run it OK in my local.
{code:java}
public class Test {
    public static void main(String[] args) {
        A b = new B(1);
        A c = new C(1);
        System.out.println(b.equals(c));
    }

}

class A {
   private int a;

    public A(int a) {
        this.a = a;
    }

    public int getA() {
        return a;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof A) {
            return this.a == ((A)obj).getA();
        }
        return false;
    }
}

class B extends A {
    private int b;

    public B(int a) {
        super(a);
    }

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }
}

class C extends A {
    private int c;

    public C(int a) {
        super(a);
    }

    @Override
    public boolean equals(Object obj) {
        return  super.equals(obj);
    }
}





{code}

> Consider StorageType when DatanodeManager#sortLocatedBlock()
> ------------------------------------------------------------
>
>                 Key: HDFS-15255
>                 URL: https://issues.apache.org/jira/browse/HDFS-15255
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Lisheng Sun
>            Assignee: Lisheng Sun
>            Priority: Major
>             Fix For: 3.4.0
>
>         Attachments: HDFS-15255.001.patch, HDFS-15255.002.patch, 
> HDFS-15255.003.patch, HDFS-15255.004.patch, HDFS-15255.005.patch, 
> HDFS-15255.006.patch, experiment-find-bugs.001.patch
>
>
> When only one replica of a block is SDD, the others are HDD. 
> When the client reads the data, the current logic is that it considers the 
> distance between the client and the dn. I think it should also consider the 
> StorageType of the replica. Priority to return fast StorageType node when the 
> distance is same.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to