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

stack commented on HTRACE-214:
------------------------------

Pity we loose Interfaces and now have Abstracts instead.

{code}
136       public void receiveSpan(Span span) {  136       public void 
receiveSpan(Span span) {
137         if (span.getTracerId().isEmpty()) {         
138           span.setTracerId(tracerId.get());         
139         }           
140                     
{code}

Why can we remove the check for trace id? Because traceid has been purged?

In MilliSpan I see this added but is it ever set or used?

53        private Tracer tracer;

NullScope probably needs a test to ensure it not mutable.

Why Sampler change from Interface to abstract when there is nothing added to 
the Sampler interface that would warrent it becoming a Class.

Could move SamplerBuilder into the abstract Sampler as inner class. This would 
tie the two.  Sampler.Builder rather than have to hunt around to figure, oh, 
there is a Builder needed to make Samplers.

We have to have jackson in htrace-core? It is a versioning PITA.  I suppose we 
have shading to insulate....

So, in a JVM, spanreceivers are distingushed by an id:

          private static final AtomicLong HIGHEST_SPAN_RECEIVER_ID = new 
AtomicLong(0);

This is just so SpanReceivers do not clash in current context? If we crash and 
SpanReceiver comes up w/ new id, it is fine..?

Ditto regards Builder for SpanReceiverBuilder about making it an inner class so 
it is staring you in the face when you can't find the constructor to use.

This was the good thing about the Trace class:

"25      * The Trace class is the primary way to interact with the library.  It 
provides                
26       * methods to create and manipulate spans."

i.e. there was such an entry point. Is it as clear now after this refactoring 
where to go to start 'tracing'?

What is a TraceExecutorService for. It is 'public'.

I used to start a span but now I say there is a newScope? Where is the writeup 
on how to use the new APIs?

Shutdown hooks are PITA. Doesn't HDFS install one. Will this interfere?  HBase 
does. Does order in which hooks run matter?

Should TracerPool be private?

Will be back w/ more review but this is enough for now.

Looking good.


> De-globalize Tracer.java
> ------------------------
>
>                 Key: HTRACE-214
>                 URL: https://issues.apache.org/jira/browse/HTRACE-214
>             Project: HTrace
>          Issue Type: Sub-task
>    Affects Versions: 4.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HTRACE-214.001.patch, HTRACE-214.002.patch, 
> HTRACE-214.003.patch, HTRACE-214.004.patch, HTRACE-214.005.patch, 
> HTRACE-214.006.patch, HTRACE-214.007.patch
>
>
> De-globalize Tracer.java.
> Currently, Tracer is a Singleton managed by TracerHolder.  Instead, Tracer 
> objects should be created by each process or library that needs to use 
> HTrace.  This enables a few things:
> * When the Tracer object is created, we can give it a name.  Then we can use 
> this name in the "process id" of all spans created by that tracer, rather 
> than trying to scrape the JVM name using "questionable" methods.
> * SpanReceivers can be shared between multiple Tracer objects in the same 
> process.  The span receivers are reference counted.  This should eliminate 
> the "double tracing" issues we have had when tracing client libraries inside 
> processes which also want tracing.
> * Tracers can be closed by calling Tracer#close.  If the Tracer being closed 
> is the last tracer in the process, it will close all the span receivers.
> * We will have a TracerFactory that takes care of the details of creating the 
> right span receivers based on the configuration.  This removes some 
> boilerplate that is currently needed to enable HTrace in an application or 
> library.  We can also make SpanReceiverFactory package-private since it will 
> no longer need to be publicly visible.



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

Reply via email to