Commit 63ff28a9 authored by Patrick D. Hunt's avatar Patrick D. Hunt
Browse files

ZOOKEEPER-1986. refactor log trace on touchSession (Hongchao Deng via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1613323 13f79535-47bb-0310-9956-ffa450edef68
parent 0dfc2b84
......@@ -1023,6 +1023,9 @@ IMPROVEMENTS:
ZOOKEEPER-927. there are currently 24 RAT warnings in the build --
address directly or via exclusions (Michi Mutsuzaki via phunt)
ZOOKEEPER-1986. refactor log trace on touchSession
(Hongchao Deng via phunt)
headers
Release 3.4.0 -
......
......@@ -20,6 +20,7 @@ package org.apache.zookeeper.server;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.MessageFormat;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
......@@ -179,20 +180,22 @@ public class SessionTrackerImpl extends ZooKeeperCriticalThread implements
}
private void logTraceTouchSession(long sessionId, int timeout, String sessionStatus){
if (LOG.isTraceEnabled()) {
ZooTrace.logTraceMessage(LOG,
ZooTrace.CLIENT_PING_TRACE_MASK,
"SessionTrackerImpl --- Touch " + sessionStatus + "session: 0x"
+ Long.toHexString(sessionId) + " with timeout " + timeout);
}
if (!LOG.isTraceEnabled())
return;
String msg = MessageFormat.format(
"SessionTrackerImpl --- Touch {0}session: 0x{1} with timeout {2}",
sessionStatus, Long.toHexString(sessionId), Integer.toString(timeout));
ZooTrace.logTraceMessage(LOG, ZooTrace.CLIENT_PING_TRACE_MASK, msg);
}
private void logTraceTouchInvalidSession(long sessionId, int timeout) {
logTraceTouchSession(sessionId, timeout, "invalid");
logTraceTouchSession(sessionId, timeout, "invalid ");
}
private void logTraceTouchClosingSession(long sessionId, int timeout) {
logTraceTouchSession(sessionId, timeout, "closing");
logTraceTouchSession(sessionId, timeout, "closing ");
}
public int getSessionTimeout(long sessionId) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment