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

Colin Patrick McCabe commented on HTRACE-6:
-------------------------------------------

Hi [~billie.rinaldi], interesting idea.

I'm not completely sure what comparing two {{TraceRunnable}} objects should 
mean.  Should they be considered alike if the {{Span}} objects they contain are 
alike?  We don't have any way of comparing the {{Runnable}} objects that 
{{TraceRunnable}} holds ({{Runnable}} doesn't implement {{Comparable}}).  And 
comparing by description just feels fragile, since it would be so easy to reuse 
the same description in multiple {{TraceRunnable}} objects.

This leads to another question, which is whether {{Span}} should implement 
Comparable (it doesn't, currently... it doesn't even implement {{hashCode}} or 
{{equals}}).  I think it's reasonable for {{Span}} objects to be compared by 
their {{spanId}}.  With {{TraceRunnable}}, I feel less sure, just because I 
don't have any intuitive idea of what it should "mean" to compare them.

Perhaps this is a case where you should just use a {{Comparator}}?  Or am I 
missing a really natural way to write a {{compareTo}} function here?

> Make TraceRunnable implement Comparable
> ---------------------------------------
>
>                 Key: HTRACE-6
>                 URL: https://issues.apache.org/jira/browse/HTRACE-6
>             Project: HTrace
>          Issue Type: Wish
>            Reporter: Billie Rinaldi
>
> Accumulo would be able to use htrace's TraceRunnable if it implemented 
> Comparable<TraceRunnable>.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to