ashishkumar50 commented on code in PR #11852:
URL: https://github.com/apache/ozone/pull/11852#discussion_r4464923573


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java:
##########
@@ -392,15 +392,36 @@ private static boolean hasUsableTracer() {
    * @return A new interface which implements interface but delegate all the
    * calls to the delegate and also enables tracing.
    */
-  public static <T> T createProxy(
+  public static <T> T createInternalProxy(
       T delegate, Class<T> itf, ConfigurationSource conf) {
+    return createProxy(delegate, itf, conf, SpanKind.INTERNAL);
+  }
+
+  /** Same as {@link #createInternalProxy(Object, Class, 
ConfigurationSource)}, with CLIENT spans for an RPC delegate.*/
+  public static <T> T createClientProxy(T delegate, Class<T> itf, 
ConfigurationSource conf) {
+    return createProxy(delegate, itf, conf, SpanKind.CLIENT);
+  }
+
+  /** Creates a proxy with spans named {@code <delegate class>.<method>}, also 
usable at startup without a span. */
+  public static <T> T createProxy(T delegate, Class<T> itf, SpanKind spanKind) 
{
+    if (!tracingEnabled && !applicationAware) {

Review Comment:
   Should we also check `hasUsableTracer()` before creating the proxy? 
Currently, when applicationAware is enabled but no usable tracer is available, 
we still create dynamic proxies, resulting in unnecessary proxy/reflection 
overhead even though no useful spans can be generated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to