Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AA195200D5A for ; Thu, 14 Dec 2017 13:56:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A8996160C04; Thu, 14 Dec 2017 12:56:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CAD9E160C01 for ; Thu, 14 Dec 2017 13:56:45 +0100 (CET) Received: (qmail 98786 invoked by uid 500); 14 Dec 2017 12:56:44 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@flink.apache.org Received: (qmail 98776 invoked by uid 99); 14 Dec 2017 12:56:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2017 12:56:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id ECC77C179B for ; Thu, 14 Dec 2017 12:56:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=azion.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id WcIeVwXdLm94 for ; Thu, 14 Dec 2017 12:56:42 +0000 (UTC) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 962095F395 for ; Thu, 14 Dec 2017 12:56:42 +0000 (UTC) Received: by mail-it0-f52.google.com with SMTP id r6so10875470itr.3 for ; Thu, 14 Dec 2017 04:56:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=azion.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=SgJaAPfJIHYqSmEjNztJl2HZhMN1Y/5GLMB5xOAaHqg=; b=J4ZEdwPVcw12nFgdOJKaGUhaNyszTPa9w8kPLEsnBbwX+Jee18MZu7kTauQxTQmoL+ mI/QSjBurkwXB72tDAb/fdUxqClz4ly1WM3TSTTZMwHotgIuo1wbxxNziQsFlnCKBVEp wtPonUnlR61YBZQfXgqnbHUzqGr+D8iI9lZ0s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=SgJaAPfJIHYqSmEjNztJl2HZhMN1Y/5GLMB5xOAaHqg=; b=ogRX19iuuHyINTy/4uA/7uFglgF10MCIZ7Pi2xm/m53DX4EQGAKZH4meN9vPV0DMf0 ytlju3ukD3jb+ZS4NK7gH2b88zCjz6GUrdvamv6tDLvZVbWIUJFQq9Txa3pHuaW9qsav PdZOc8OLv9J+HinA97w6xDqs2irS3kMbvwz+pAQST5C38FseESxfyyTt+y8E5CbHY64L B/NAg3h4HgkLW2oUzWGXI/5BqUCJ4ROThcWDTmw6e2YQCdwWFgROXyxmdnDU81s6G4V1 BN3iEaoA2Aiep/+y0Tn5/EQT2FQ7ZIh75Ef+yNKzm+wl1xk+IP/G9GGpq6llrEXRTP+N Nb7g== X-Gm-Message-State: AKGB3mIF75bZOTwVfPbhynQN5xoRYLTMDsd0ozgMhsV0/0i1JR3d5uet V1qtUuh16MebD3CtYvgrBse78QVuMjxy9L9CW5oQxyCPfdg= X-Google-Smtp-Source: ACJfBosBcZ4FywTpka9vj63hhPyK3QX41CPs8TB9KkXobkW9HdgjQ16/S/Tn8bVTOyx1g0w9BUjQA4kEzNefKCQI0yY= X-Received: by 10.36.236.4 with SMTP id g4mr3521578ith.33.1513256201808; Thu, 14 Dec 2017 04:56:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.133.97 with HTTP; Thu, 14 Dec 2017 04:56:41 -0800 (PST) From: Julio Biason Date: Thu, 14 Dec 2017 10:56:41 -0200 Message-ID: Subject: [Docs] Can't add metrics to RichFilterFunction To: User Content-Type: multipart/alternative; boundary="94eb2c116ea85d0a6505604c6afa" archived-at: Thu, 14 Dec 2017 12:56:46 -0000 --94eb2c116ea85d0a6505604c6afa Content-Type: text/plain; charset="UTF-8" Hello, I'm trying to add a metric to a filter function, but following the example in the docs is not working. So I have this class: ``` class LogBrokenFilter extends RichFilterFunction[LineData] { private val logger = LoggerFactory.getLogger(this.getClass) @transient private var counter:Counter override def open(parameters:Configuration):Unit = { counter = getRuntimeContext .getMetricGroup() .counter("brokenLogs") } // and then I override `filter` to do filter events out and count those. ``` The problem is that, when compiling, I get the following errors: abstract member may not have private modifier [error] @transient private var counter:Counter and no valid targets for annotation on method counter - it is discarded unused. You may specify targets with meta-annotations, e.g. @(transient @getter) [warn] @transient private var counter:Counter [warn] ^ Any ideas? Are the docs wrong? -- *Julio Biason*, Sofware Engineer *AZION* | Deliver. Accelerate. Protect. Office: +55 51 3083 8101 | Mobile: +55 51 *99907 0554* --94eb2c116ea85d0a6505604c6afa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I'm trying to add a= metric to a filter function, but following the example in the docs is not = working.

So I have this class:

```
class LogBrokenFi= lter extends RichFilterFunction[LineData] {
=C2=A0 private val logger = =3D LoggerFactory.getLogger(this.getClass)
=C2=A0 @transient private var= counter:Counter

=C2=A0 override def open(parameters:Configuration):= Unit =3D {
=C2=A0=C2=A0=C2=A0 counter =3D getRuntimeContext
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 .getMetricGroup()
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .= counter("brokenLogs")
=C2=A0 }

=C2=A0 // and then= I override `filter` to do filter events out and count those.
= ```

The problem is that, when compiling, I get the= following errors:

abstract member may not have pr= ivate modifier
[error]=C2=A0=C2=A0 @transient private var counter:Counte= r

and

no valid targets fo= r annotation on method counter - it is discarded unused. You may specify ta= rgets with meta-annotations, e.g. @(transient @getter)
[warn]=C2=A0=C2= =A0 @transient private var counter:Counter
[warn]=C2=A0=C2=A0=C2=A0 ^

Any ideas? Are the docs wrong?

--
Julio Biason, Sofware Engineer
AZION=C2=A0 | =C2=A0Deliver. Accelerate. Protect.<= /div>
Office:=C2=A0+55 51 3083 8101=C2=A0 | =C2=A0Mobil= e:=C2=A0+55 = 51=C2=A099907 0554
--94eb2c116ea85d0a6505604c6afa--