Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3A22610296 for ; Thu, 27 Aug 2015 10:17:50 +0000 (UTC) Received: (qmail 79111 invoked by uid 500); 27 Aug 2015 10:17:47 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 79053 invoked by uid 500); 27 Aug 2015 10:17:47 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 78998 invoked by uid 99); 27 Aug 2015 10:17:47 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Aug 2015 10:17:47 +0000 Date: Thu, 27 Aug 2015 10:17:47 +0000 (UTC) From: "Rafi Shachar (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-14324) MetricSampleQuantiles maintains quantiles summary in a wrong way MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-14324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14716423#comment-14716423 ] Rafi Shachar commented on HBASE-14324: -------------------------------------- In allowaleError method replace int size = sample.size(); with int size = count; > MetricSampleQuantiles maintains quantiles summary in a wrong way > ---------------------------------------------------------------- > > Key: HBASE-14324 > URL: https://issues.apache.org/jira/browse/HBASE-14324 > Project: HBase > Issue Type: Bug > Components: metrics > Reporter: Rafi Shachar > > The MetricSampleQuantiles computes quantiles estimations for data stream according to a paper published by CKMS in 2005. However the implementation is incorrect compared to the paper. In particular, the insert and compact methods use the rank of an item in the summary whereas the rank should be the estimated rank in the stream. Due to this bug the resulting summary is much larger than required: according to my experiments it is more than 10 times larger. Furthermore, the summary size continues to grow with stream size while the distribution doesn't change. When the number of items is in the tens of millions the summary size is about 200K while it should be in the range of few thousands. This has significant effect on performance. I didn't see significant effect on accuracy. > The insert batch and compress methods call allowableError() passing the rank of the item in the summary. It actually should pass the estimated rank in the stream. In the CKMS paper this rank is denoted by r_i, which more precisely is the estimated rank of item i-1. allowableError now considers the size of the summary where it should consider the number of items that has been observed. > In addition, the class currently uses a static sized buffer of size 500. This yields poor runtime performance. Increasing this buffer to size 10000 or more yields much better performance (I'm using it with buffer size of 100K). The buffer size can be dynamic and grow with number of items in the stream. -- This message was sent by Atlassian JIRA (v6.3.4#6332)