[
https://issues.apache.org/jira/browse/HDFS-7223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14167382#comment-14167382
]
Colin Patrick McCabe commented on HDFS-7223:
--------------------------------------------
Hmm. Maybe it would be nice to get a short class name as well so we had
something like {{ClientNamenodeProtocol#getServerDefaults}}. In contrast, the
current patch would just report {{getServerDefaults}}. I guess that works if
all the RPC names are unique, but the class would be nice.
One thing that makes it complicated is that protobuf generates some glue code,
so if you just use {{method.getClass().getSimpleName}}, you get
{{BlockingInterface}}. I wrote some code that might help get back a nicer
class name by ignoring inner classes:
{code}
+ /**
+ * Convert an RPC method to a string.
+ * The format we want is 'MethodOuterClassShortName#methodName'.
+ *
+ * For example, if the method is:
+ * org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.
+ * ClientNamenodeProtocol.BlockingInterface.getServerDefaults
+ *
+ * the format we want is:
+ * ClientNamenodeProtocol#getServerDefaults
+ */
+ static String methodToTraceString(Method method) {
+ Class<?> clazz = method.getDeclaringClass();
+ while (true) {
+ Class<?> next = clazz.getEnclosingClass();
+ if (next == null) break;
+ clazz = next;
+ }
+ return clazz.getSimpleName() + "#" + method.getName();
+ }
{code}
> Tracing span description of IPC client is too long
> --------------------------------------------------
>
> Key: HDFS-7223
> URL: https://issues.apache.org/jira/browse/HDFS-7223
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: Masatake Iwasaki
> Assignee: Masatake Iwasaki
> Priority: Minor
> Attachments: HDFS-7223-0.patch
>
>
> Current span description for IPC call is too long.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)