From issues-return-157430-archive-asf-public=cust-asf.ponee.io@flink.apache.org Thu Mar 8 13:49:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 454FA180677 for ; Thu, 8 Mar 2018 13:49:06 +0100 (CET) Received: (qmail 39327 invoked by uid 500); 8 Mar 2018 12:49:05 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 39316 invoked by uid 99); 8 Mar 2018 12:49:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2018 12:49:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C74F21A175A for ; Thu, 8 Mar 2018 12:49:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id g1X9jsHxY_eD for ; Thu, 8 Mar 2018 12:49:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id C07025F5FA for ; Thu, 8 Mar 2018 12:49:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 59F3DE0250 for ; Thu, 8 Mar 2018 12:49:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 90B2A25415 for ; Thu, 8 Mar 2018 12:49:00 +0000 (UTC) Date: Thu, 8 Mar 2018 12:49:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-6053) Gauge should only take subclasses of Number, rather than everything 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/FLINK-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16391200#comment-16391200 ] ASF GitHub Bot commented on FLINK-6053: --------------------------------------- Github user StephanEwen commented on a diff in the pull request: https://github.com/apache/flink/pull/5501#discussion_r173146558 --- Diff: flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/StringGauge.java --- @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.metrics; + +/** + * A StringGauge is a {@link Metric} that calculates a specific {@link String} value at a point in time. + */ +public interface StringGauge extends Metric { --- End diff -- Should be annotated with `@FunctionalInterface` to guard that this always stays lambda-able. Also annotate with Public / PublicEvolving? > Gauge should only take subclasses of Number, rather than everything > ---------------------------------------------------------------------- > > Key: FLINK-6053 > URL: https://issues.apache.org/jira/browse/FLINK-6053 > Project: Flink > Issue Type: Improvement > Components: Metrics > Affects Versions: 1.2.0 > Reporter: Bowen Li > Assignee: Chesnay Schepler > Priority: Major > Fix For: 1.6.0 > > > Currently, Flink's Gauge is defined as > ```java > public interface Gauge extends Metric { > T getValue(); > } > ``` > But it doesn't make sense to have Gauge take generic types other than Number. And it blocks I from finishing FLINK-6013, because I cannot assume Gauge is only about Number. So the class should be like > ```java > public interface Gauge extends Metric { > T getValue(); > } > ``` -- This message was sent by Atlassian JIRA (v7.6.3#76005)