horizonzy commented on a change in pull request #8739:
URL: https://github.com/apache/dubbo/pull/8739#discussion_r706206014
##########
File path:
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
##########
@@ -251,11 +251,11 @@ private String getTimeoutMessage(boolean scan) {
+ (sent > 0 ? " client elapsed: " + (sent - start)
+ " ms, server elapsed: " + (nowTimestamp - sent)
: " elapsed: " + (nowTimestamp - start)) + " ms, timeout: "
- + timeout + " ms, request: " + (logger.isDebugEnabled() ?
request : getRequestWithoutData()) + ", channel: " + channel.getLocalAddress()
+ + timeout + " ms, request: " + (logger.isDebugEnabled() ?
request : rinseRequestData(request)) + ", channel: " + channel.getLocalAddress()
+ " -> " + channel.getRemoteAddress();
}
- private Request getRequestWithoutData() {
+ private static Request rinseRequestData(Request request) {
Request newRequest = request.copy();
Review comment:
And here we can optimize the logic. Add new method copy without data
method in `Request`, avoid to copy data.
##########
File path:
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
##########
@@ -251,11 +251,11 @@ private String getTimeoutMessage(boolean scan) {
+ (sent > 0 ? " client elapsed: " + (sent - start)
+ " ms, server elapsed: " + (nowTimestamp - sent)
: " elapsed: " + (nowTimestamp - start)) + " ms, timeout: "
- + timeout + " ms, request: " + (logger.isDebugEnabled() ?
request : getRequestWithoutData()) + ", channel: " + channel.getLocalAddress()
+ + timeout + " ms, request: " + (logger.isDebugEnabled() ?
request : rinseRequestData(request)) + ", channel: " + channel.getLocalAddress()
+ " -> " + channel.getRemoteAddress();
}
- private Request getRequestWithoutData() {
+ private static Request rinseRequestData(Request request) {
Review comment:
Here maintain original method name, `rinseRequestData` sounds like do
some operation for request.
--
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]