[jira] [Commented] (HBASE-20359) why Comparator extends comparable?

2018-10-14 Thread Nick.han (JIRA)


[ 
https://issues.apache.org/jira/browse/HBASE-20359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16649682#comment-16649682
 ] 

Nick.han commented on HBASE-20359:
--

sorry,I reviewed this question,and it missed something,my bad,what I mean is 
class ByteArrayComparable and it's subclass LongComparator,BinaryComparator 
...etc,ByteArrayComparable is not named well beacuse it's subclass is 
Comparator, a comparator is a tool,it's not right that a comparator extends a 
comparable.

> why Comparator extends comparable?
> --
>
> Key: HBASE-20359
> URL: https://issues.apache.org/jira/browse/HBASE-20359
> Project: HBase
>  Issue Type: Improvement
>Reporter: Nick.han
>Priority: Minor
>
> Comparable is an interface,object implements this interface can be compare 
> with some other object, Comparator is a tool for compare object,the tool 
> itself can be compare is useless, so why a tool implement the comparable 
> interface?Do we have to  improve this?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (HBASE-20359) why Comparator extends comparable?

2018-05-02 Thread maoling (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-20359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16460974#comment-16460974
 ] 

maoling commented on HBASE-20359:
-

[~mdrob] 

add below config in the hbase\hbase-build-configuration\pom.xml
{code:java}
-Xep:ComparableAndComparator:ERROR
{code}
maven build success.It seems that no codes violate the ComparableAndComparator 
rule?

> why Comparator extends comparable?
> --
>
> Key: HBASE-20359
> URL: https://issues.apache.org/jira/browse/HBASE-20359
> Project: HBase
>  Issue Type: Improvement
>Reporter: Nick.han
>Priority: Minor
>
> Comparable is an interface,object implements this interface can be compare 
> with some other object, Comparator is a tool for compare object,the tool 
> itself can be compare is useless, so why a tool implement the comparable 
> interface?Do we have to  improve this?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (HBASE-20359) why Comparator extends comparable?

2018-04-29 Thread Mike Drob (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-20359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16458230#comment-16458230
 ] 

Mike Drob commented on HBASE-20359:
---

http://errorprone.info/bugpattern/ComparableAndComparator

It shows up as a compilation warning with {{-P errorProne}} given.

> why Comparator extends comparable?
> --
>
> Key: HBASE-20359
> URL: https://issues.apache.org/jira/browse/HBASE-20359
> Project: HBase
>  Issue Type: Improvement
>Reporter: Nick.han
>Priority: Minor
>
> Comparable is an interface,object implements this interface can be compare 
> with some other object, Comparator is a tool for compare object,the tool 
> itself can be compare is useless, so why a tool implement the comparable 
> interface?Do we have to  improve this?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (HBASE-20359) why Comparator extends comparable?

2018-04-29 Thread maoling (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-20359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16458020#comment-16458020
 ] 

maoling commented on HBASE-20359:
-

[~mdrob] search aroud the code base.sorry, I cannot get your idea.

> why Comparator extends comparable?
> --
>
> Key: HBASE-20359
> URL: https://issues.apache.org/jira/browse/HBASE-20359
> Project: HBase
>  Issue Type: Improvement
>Reporter: Nick.han
>Priority: Minor
>
> Comparable is an interface,object implements this interface can be compare 
> with some other object, Comparator is a tool for compare object,the tool 
> itself can be compare is useless, so why a tool implement the comparable 
> interface?Do we have to  improve this?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (HBASE-20359) why Comparator extends comparable?

2018-04-26 Thread Mike Drob (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-20359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16454199#comment-16454199
 ] 

Mike Drob commented on HBASE-20359:
---

This is also an error-prone check, yes we should improve this.

> why Comparator extends comparable?
> --
>
> Key: HBASE-20359
> URL: https://issues.apache.org/jira/browse/HBASE-20359
> Project: HBase
>  Issue Type: Improvement
>Reporter: Nick.han
>Priority: Minor
>
> Comparable is an interface,object implements this interface can be compare 
> with some other object, Comparator is a tool for compare object,the tool 
> itself can be compare is useless, so why a tool implement the comparable 
> interface?Do we have to  improve this?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (HBASE-20359) why Comparator extends comparable?

2018-04-26 Thread maoling (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-20359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16454188#comment-16454188
 ] 

maoling commented on HBASE-20359:
-

[~Nick.han] can you give some examples?

> why Comparator extends comparable?
> --
>
> Key: HBASE-20359
> URL: https://issues.apache.org/jira/browse/HBASE-20359
> Project: HBase
>  Issue Type: Improvement
>Reporter: Nick.han
>Priority: Minor
>
> Comparable is an interface,object implements this interface can be compare 
> with some other object, Comparator is a tool for compare object,the tool 
> itself can be compare is useless, so why a tool implement the comparable 
> interface?Do we have to  improve this?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)