[
https://issues.apache.org/jira/browse/HBASE-20942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16594242#comment-16594242
]
Josh Elser commented on HBASE-20942:
------------------------------------
[~krish.dey], your attempts to mention me directly aren't quite right. Type the
"\@" symbol and then someone's name. A link to my Jira profile doesn't actually
trigger a message to me (but I'm already watching this Jira issue, so I see
everything you do). That said, please be a little more gentle in the comment
deletion. We generally don't like folks doing this – we want a clear history of
what was done and removing comments make that harder.
{code:java}
private class RpcServerImplForTesting extends RpcServer{code}
Why the need for a custom implementation when you're already using Mockito? You
should be able to do something like this:
{code:java}
RpcServer mockServer = Mockito.mock(RpcServer.class);
Mockito.when(mockServer.truncateTraceLogLength(Mockito.any(String.class))).thenCallRealMethod();{code}
{code:java}
+ Logger rpcServerLog =
Logger.getLogger("org.apache.hadoop.hbase.ipc.RpcServer");{code}
Again, use the RpcServer.class, not a String that is the full class name.
nit: how about your method be named {{truncateTraceLog}} instead of
{{truncateTraceLogLength}}?
> Improve RpcServer TRACE logging
> -------------------------------
>
> Key: HBASE-20942
> URL: https://issues.apache.org/jira/browse/HBASE-20942
> Project: HBase
> Issue Type: Task
> Reporter: Esteban Gutierrez
> Assignee: Krish Dey
> Priority: Major
> Attachments: HBASE-20942.002.patch, HBASE-20942.003.patch,
> HBASE-20942.004.patch
>
>
> Two things:
> * We truncate RpcServer output to 1000 characters for trace logging. Would
> be better if that value was configurable.
> * There is the chance for an ArrayIndexOutOfBounds when truncating the TRACE
> log message.
> Esteban mentioned this to me earlier, so I'm crediting him as the reporter.
> cc: [~elserj]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)