public class TracerPool extends Object
Tracer running inside a single 'process'; for example,
unit tests may spin up a DataNode, a NameNode, and HDFS clients all running in a single JVM
instance, each with its own Tracer. TracerPool is where all Tracer instances register
on creation so Tracers can coordinate around shared resources such as SpanReceiver
instances. TracerPool takes care of properly cleaning up registered Tracer instances on shutdown.| Constructor and Description |
|---|
TracerPool(String name) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addReceiver(SpanReceiver receiver)
Add a new span receiver.
|
static TracerPool |
getGlobalTracerPool()
Get the global tracer pool.
|
String |
getName()
Return the name of this TracerPool.
|
SpanReceiver[] |
getReceivers()
Returns an array of all the current span receivers.
|
Tracer[] |
getTracers()
Returns an array of all the current Tracers.
|
SpanReceiver |
loadReceiverType(String className,
HTraceConfiguration conf,
ClassLoader classLoader)
Given a SpanReceiver class name, return the existing instance of that span
receiver, if possible; otherwise, invoke the callable to create a new
instance.
|
boolean |
removeAndCloseReceiver(SpanReceiver receiver)
Remove and close a span receiver.
|
boolean |
removeReceiver(SpanReceiver receiver)
Remove a span receiver.
|
String |
toString() |
public TracerPool(String name)
public static TracerPool getGlobalTracerPool()
public String getName()
public SpanReceiver[] getReceivers()
public boolean addReceiver(SpanReceiver receiver)
receiver - The new receiver to add.public boolean removeReceiver(SpanReceiver receiver)
receiver - The receiver to remove.public boolean removeAndCloseReceiver(SpanReceiver receiver)
receiver - The receiver to remove.public SpanReceiver loadReceiverType(String className, HTraceConfiguration conf, ClassLoader classLoader)
className - The span receiver class name.conf - The HTrace configuration.classLoader - The class loader to use.public Tracer[] getTracers()
Copyright © 2016 The Apache Software Foundation. All Rights Reserved.