Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F057818DC1 for ; Thu, 1 Oct 2015 10:15:28 +0000 (UTC) Received: (qmail 60687 invoked by uid 500); 1 Oct 2015 10:15:28 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 60635 invoked by uid 500); 1 Oct 2015 10:15:28 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 60620 invoked by uid 99); 1 Oct 2015 10:15:28 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2015 10:15:28 +0000 Date: Thu, 1 Oct 2015 10:15:28 +0000 (UTC) From: "Akira AJISAKA (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-11104) org.apache.hadoop.metrics2.lib.MetricsRegistry needs numerical parameter checking 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/HADOOP-11104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14939626#comment-14939626 ] Akira AJISAKA commented on HADOOP-11104: ---------------------------------------- Cancelling my +1, [~rchiang] would you render the lines within 80 characters? {code} + expectMetricsException("Interval should be positive. Value passed is: -20", new Runnable() { + @Override + public void run() { r.newQuantiles("q1", "New Quantile 1", "qq1", "qv1", (int)-20); } + }); {code} I'm +1 if that is addressed. Sorry for late response. > org.apache.hadoop.metrics2.lib.MetricsRegistry needs numerical parameter checking > --------------------------------------------------------------------------------- > > Key: HADOOP-11104 > URL: https://issues.apache.org/jira/browse/HADOOP-11104 > Project: Hadoop Common > Issue Type: Improvement > Reporter: Ray Chiang > Assignee: Ray Chiang > Priority: Minor > Labels: BB2015-05-TBR, newbie, supportability > Attachments: HADOOP-11104.001.patch, HADOOP-11104.002.patch, HADOOP-11104.003.patch > > > Passing a negative value to the interval field of MetricsRegistry#newQuantiles should throw a MetricsException with a clear error message. The current stack trace looks something like: > java.lang.IllegalArgumentException: null > at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(ScheduledThreadPoolExecutor.java:420) > at org.apache.hadoop.metrics2.lib.MutableQuantiles.(MutableQuantiles.java:107) > at org.apache.hadoop.metrics2.lib.MetricsRegistry.newQuantiles(MetricsRegistry.java:200) > Along similar lines, should the other methods like MetricsRegistry#newCounter() also have parameter checking for negative int/long values? -- This message was sent by Atlassian JIRA (v6.3.4#6332)