From commits-return-8568-apmail-zookeeper-commits-archive=zookeeper.apache.org@zookeeper.apache.org Wed Oct 21 03:13:56 2020 Return-Path: X-Original-To: apmail-zookeeper-commits-archive@www.apache.org Delivered-To: apmail-zookeeper-commits-archive@www.apache.org Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by minotaur.apache.org (Postfix) with ESMTP id 606D019DA4 for ; Wed, 21 Oct 2020 03:13:56 +0000 (UTC) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id 1F62B436E9 for ; Wed, 21 Oct 2020 03:13:56 +0000 (UTC) Received: (qmail 21797 invoked by uid 500); 21 Oct 2020 03:13:55 -0000 Delivered-To: apmail-zookeeper-commits-archive@zookeeper.apache.org Received: (qmail 21705 invoked by uid 500); 21 Oct 2020 03:13:53 -0000 Mailing-List: contact commits-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list commits@zookeeper.apache.org Received: (qmail 21688 invoked by uid 99); 21 Oct 2020 03:13:53 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Oct 2020 03:13:53 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id C0F5A81786; Wed, 21 Oct 2020 03:13:52 +0000 (UTC) Date: Wed, 21 Oct 2020 03:13:52 +0000 To: "commits@zookeeper.apache.org" Subject: [zookeeper] branch master updated: ZOOKEEPER-3722: make logs of ResponseCache more readable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <160325003259.23612.10451317838942608974@gitbox.apache.org> From: hanm@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: zookeeper X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 1af3dcc633d4829864da74ca6b030428448fcc16 X-Git-Newrev: e4534976898520b5c334a55761672dc03dff5727 X-Git-Rev: e4534976898520b5c334a55761672dc03dff5727 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. hanm pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/zookeeper.git The following commit(s) were added to refs/heads/master by this push: new e453497 ZOOKEEPER-3722: make logs of ResponseCache more readable e453497 is described below commit e4534976898520b5c334a55761672dc03dff5727 Author: Nishanth Entoor AuthorDate: Tue Oct 20 20:13:42 2020 -0700 ZOOKEEPER-3722: make logs of ResponseCache more readable As per [ZOOKEEPER-3722](https://issues.apache.org/jira/browse/ZOOKEEPER-3722), we need to make ResponseCache logs more readable by adding the request type to the logs. For this I made the following changes: - Added a parameter named requestType to ResponseCache constructor. - Passed requestType as getData and getChild when the constructor is called to initialize readResponseCache and getChildrenResponseCache respectively. Please let me know if additional changes are required. Author: Nishanth Entoor Reviewers: hanm, HorizonNet, maoling Closes #1253 from nishanth-entoor/ZOOKEEPER-3722 --- .../src/main/java/org/apache/zookeeper/server/ResponseCache.java | 4 ++-- .../src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ResponseCache.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ResponseCache.java index 4a76a0f..5c74caa 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ResponseCache.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ResponseCache.java @@ -39,10 +39,10 @@ public class ResponseCache { private final Map cache; - public ResponseCache(int cacheSize) { + public ResponseCache(int cacheSize, String requestType) { this.cacheSize = cacheSize; cache = Collections.synchronizedMap(new LRUCache<>(cacheSize)); - LOG.info("Response cache size is initialized with value {}.", cacheSize); + LOG.info("{} response cache size is initialized with value {}.", requestType, cacheSize); } public int getCacheSize() { diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java index 00550be..d277851 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java @@ -327,11 +327,11 @@ public class ZooKeeperServer implements SessionExpirer, ServerStats.Provider { readResponseCache = new ResponseCache(Integer.getInteger( GET_DATA_RESPONSE_CACHE_SIZE, - ResponseCache.DEFAULT_RESPONSE_CACHE_SIZE)); + ResponseCache.DEFAULT_RESPONSE_CACHE_SIZE), "getData"); getChildrenResponseCache = new ResponseCache(Integer.getInteger( GET_CHILDREN_RESPONSE_CACHE_SIZE, - ResponseCache.DEFAULT_RESPONSE_CACHE_SIZE)); + ResponseCache.DEFAULT_RESPONSE_CACHE_SIZE), "getChildren"); this.initialConfig = initialConfig;