sumitagrawl commented on code in PR #11852:
URL: https://github.com/apache/ozone/pull/11852#discussion_r4439803178
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java:
##########
@@ -394,13 +394,34 @@ private static boolean hasUsableTracer() {
*/
public static <T> T createProxy(
T delegate, Class<T> itf, ConfigurationSource conf) {
+ return createProxy(delegate, itf, conf, SpanKind.INTERNAL);
+ }
+
+ /** Same as {@link #createProxy(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)
{
Review Comment:
can define as private
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/TracingUtil.java:
##########
@@ -394,13 +394,34 @@ private static boolean hasUsableTracer() {
*/
public static <T> T createProxy(
Review Comment:
we can rename as createProxyInternal
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/tracing/InternalSpanKind.java:
##########
@@ -23,11 +23,12 @@
import java.lang.annotation.Target;
/**
- * Annotation that marks a proxied client method as SpanKind.INTERNAL.
+ * Annotation that marks a method of a proxied delegate class, or every method
declared in that class, as
+ * SpanKind.INTERNAL.
* Used for methods that do not send an outbound RPC.
*/
@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.TYPE})
Review Comment:
we can remove Element.TYPE as not used
--
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]