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

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

bq. If user calls wrap or getTracerPool, that is ok against NullTracer?

{{NullTracer#wrap}} should work fine, since it's just using the wrapper classes 
that call {{newScope}}, and we have overridden that in {{NullScope}}.  
{{NullTracer#getTracerPool}} will return {{TracerPool.NULL_TRACER_POOL}}-- this 
is not the default tracer pool, but it is a valid tracer pool.

bq. A subclass is returning an instance of superclass... \[in gettNullTracer\]

It's a static method, so this should be OK?  The motivation for putting it in 
{{Tracer.java}} rather than {{NullTracer.java}} was because I didn't want to 
make {{NullTracer}} a public class (reduce API surface).

I looked at the Hadoop code, and I don't think we really need this patch there. 
 We fixed the null pointer exception we had earlier by correctly initializing 
the tracer variable.  I'll have to think about the patch-- like I said, I'm a 
little worried that overuse of {{NullTracer}} in client code could cause us to 
lose spans.  Maybe there are some use-cases I haven't thought about...

> Add NullTracer which never creates a trace span
> -----------------------------------------------
>
>                 Key: HTRACE-275
>                 URL: https://issues.apache.org/jira/browse/HTRACE-275
>             Project: HTrace
>          Issue Type: Improvement
>          Components: api
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HTRACE-275.001.patch
>
>
> [~iwasakims] suggested adding a {{NullTracer}} which never creates a trace 
> span.  This would be more convenient than checking tracer objects against 
> null in some cases.



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

Reply via email to