[
https://issues.apache.org/jira/browse/HADOOP-15340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16412174#comment-16412174
]
Xiaoyu Yao commented on HADOOP-15340:
-------------------------------------
Thanks [~elek] for reporting the issue and posting the fix. The patch looks
good to me overall.
Just have two minor suggestions:
RPC.java
Line 816-820: can you move comments into a javadoc with examples illustrating
the expected behavior
If I understand correctly, serverNameFromClass tries to get meaningful server
name based on class name passed in. The first two cases should work with
getSimpleName.
0. Simple class works the same as getSimpleName().
1. If it is an embedded class, returns the inner class name (same as the
getSimpleName())
E.g., o.a.h.h.proto.classA$classB$classC then return classC
Cases 2-4 are where getSimpleNmae() returns either '' or null. We should
document the expected behavior:
2. If it is an Object created from a class factory
E.g., org.apache.hadoop.ipc.TestRPC$TestClass$2
serverNameFromClass returns parent class TestClass.
3. If it is an anonymous class
E.g., 'org.apache.hadoop.ipc.TestRPC$10'
serverNameFromClass returns parent class TestRPC.
4. If it is a lambda runnable/consumer, etc. class
E.g., 'org.apache.hadoop.ipc.TestRPC$$Lambda$1/1360767589'
serverNameFromClass returns "Lambda", should we return parent class here
instead of Lambda?
Line 826: NIT: pattern can be moved to static final member of the abstract
class.
> Fix the RPC server name usage to provide information about the metrics
> ----------------------------------------------------------------------
>
> Key: HADOOP-15340
> URL: https://issues.apache.org/jira/browse/HADOOP-15340
> Project: Hadoop Common
> Issue Type: Bug
> Components: common
> Affects Versions: 3.2.0
> Reporter: Elek, Marton
> Assignee: Elek, Marton
> Priority: Major
> Attachments: HADOOP-15340.001.patch
>
>
> In case of multiple RPC servers in the same JVM it's hard to identify the
> metric data. The only available information as of now is the port number.
> Server name is also added in the constructor of Server.java but it's not used
> at all.
> This patch fix this behaviour:
> 1. The server name is saved to a field in Server.java (constructor signature
> is not changed)
> 2. ServerName is added as a tag to the metrics in RpcMetrics
> 3. The naming convention for the severs are fix.
> About 3: if the server name is not defined the current code tries to identify
> the name from the class name. Which is not always an easy task as in some
> cases the server has a protobuf generated dirty name which also could be an
> inner class.
> The patch also improved the detection of the name (if it's not defined). It's
> a compatible change as the current name is not user ad all.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]