From user-return-21373-archive-asf-public=cust-asf.ponee.io@flink.apache.org Tue Jul 17 15:49:29 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 A1E21180600 for ; Tue, 17 Jul 2018 15:49:28 +0200 (CEST) Received: (qmail 65828 invoked by uid 500); 17 Jul 2018 13:49:27 -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 65816 invoked by uid 99); 17 Jul 2018 13:49:27 -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; Tue, 17 Jul 2018 13:49:27 +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 CCB631A12A0 for ; Tue, 17 Jul 2018 13:49:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.47 X-Spam-Level: ** X-Spam-Status: No, score=2.47 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=okkam-it.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id k0rXU2jO-vCw for ; Tue, 17 Jul 2018 13:49:25 +0000 (UTC) Received: from mail-vk0-f67.google.com (mail-vk0-f67.google.com [209.85.213.67]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D145A5F35A for ; Tue, 17 Jul 2018 13:49:24 +0000 (UTC) Received: by mail-vk0-f67.google.com with SMTP id t4-v6so591704vke.9 for ; Tue, 17 Jul 2018 06:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=okkam-it.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=LcGb6aFg+qVXJkxlFhLlqT/cIRoLfguQPZkXySvznqs=; b=o25DstOC62i4Z9Z5KWrlXeieygul3T7TbePZ6SObSDppYOQCjb3RHTrhZMXfvUDkrq exs5htuVuAA4pkzLS9rvvmK85OmSa1aaoTyxDBabUIBe2Mchs/8DkpICK68h8h4GT+Tk nAaEWTHDQbmi+s88pEtuYRwiF0QUIJ2e7ChGadhPDhbQcQpD7FnEoESkRZkYXgtaaQyR TtswdaSWgzk4+jiiJ54CAm2PvtNnOl1LWk189izPWj+qcEB0v+VDTyFcBC0I5ogDXIeJ tiXlESCSs/H0sTBa6+Nt9ldPkJPsHDvIPOvhG/DQdXjawDO5yN06+5P9xylP7wduqvFp F2Vg== 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=LcGb6aFg+qVXJkxlFhLlqT/cIRoLfguQPZkXySvznqs=; b=KhM/sFdpSiZLmFFxcLWVXskQeEJFFVIQkmntchXvF9OZma1V5FROTi5w6EJkol/ZKM Y2q/cL+RydMEROjvlQ6GyXclscLLSESsCWnEEc/BGK0xYTM7lJlC0cyRc0Ai0Emrr6rM QG4FCGzxQde7k/bwzGQ1vHYMdQMbBDv84+aVA13LV00roWA8AdwEcFD2fkQPZ43XHUn2 CEfLFOZzaTHOdpHLw1VzOT8PzXT/f+cTJ3ZupUdL/QrddeDHBJs5Q9gVpS5OdYEnpRtR 2/IaqTSH0M7ogOr8QvGLOnQVq47Zie0hau6ROybN471UvBBdSzvW6QhGsBX1OogJ9i96 lMjQ== X-Gm-Message-State: AOUpUlEvuXXoQ2D0LtAdoyquYXCVLDpRmONkIl6kCLcqv32eniesLRzW qakdHlind66whH0MvaOxTVeYrg/beilS/7OKvvWWBEV1 X-Google-Smtp-Source: AAOMgpeaG8o0LG0VFC3cH6VTGzW008omrYyOLXoougrearXBKZsaB83x2IgjugspwmKmM0gOOCnYtsZic2tEECA0Ohs= X-Received: by 2002:a1f:d507:: with SMTP id m7-v6mr943028vkg.40.1531835358044; Tue, 17 Jul 2018 06:49:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:492b:0:0:0:0:0 with HTTP; Tue, 17 Jul 2018 06:48:57 -0700 (PDT) X-Originating-IP: [77.43.114.114] From: Flavio Pompermaier Date: Tue, 17 Jul 2018 15:48:57 +0200 Message-ID: Subject: RequiredParameters in Flink 1.5.1 To: user Content-Type: multipart/alternative; boundary="0000000000005efeee057132364c" --0000000000005efeee057132364c Content-Type: text/plain; charset="UTF-8" Hi to all, I'm trying to migrate a job from Flink 1.3.1 to 1.5.1 but it seems that RequiredParameters and ParameterTool works differently from before... My code is the following: ParameterTool parameters = ParameterTool.fromArgs(args); RequiredParameters required = new RequiredParameters(); required.add(*getMyBooleanOption*()); required.applyTo(parameters); where *getMyBooleanOption*() creates an Option 'xxx' with a default value of "true". In Flink 1.3.1 parameters.getBoolean(getMyBooleanOption().getName()) returns true while in 1.5.1 throws an exception: Exception in thread "main" java.lang.RuntimeException: No data for required key 'xxx' at org.apache.flink.api.java.utils.ParameterTool.getRequired(ParameterTool.java:289) at org.apache.flink.api.java.utils.ParameterTool.getBoolean(ParameterTool.java:427) Is this a regression or is the inteded behaviour? This could be simply fixed using parameters.getBoolean(*getMyBooleanOption*().getName(),Boolean.valueOf( *getMyBooleanOption*().getDefaultValue())); but the previous mechanism was better (IMHO). Thanks in advance, Flavio --0000000000005efeee057132364c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi to all,
I'm trying to migrate a job from Flink = 1.3.1 to 1.5.1 but it seems that RequiredParameters and=C2=A0ParameterTool = works differently from before...

My co= de is the following:

ParameterTool parameters= =3D ParameterTool.fromArgs(args);
RequiredParameters required = =3D new RequiredParameters();
required.add(getMyBooleanOp= tion());
required.applyTo(parameters);
where getMyBooleanOption() creates an Option 'xxx= ' with a default value of "true".

=
In Flink 1.3.1=C2=A0paramete= rs.getBoolean(getMyBooleanOption().getNam= e()) returns true while in 1.5.1 throws an exception:

<= div>Exception in thread "main" java.lang.RuntimeException: No dat= a for required key 'xxx'
= at org.apache.flink.api.java.utils.ParameterTool.getRequired(Parame= terTool.java:289)
at org.= apache.flink.api.java.utils.ParameterTool.getBoolean(ParameterTool.java:427= )

Is this a regression or is t= he inteded behaviour? This could be simply fixed using

=
parameters.getBoolean(getMyBooleanOption().getName()= ,Boolean.valueOf(getMyBooleanOption().getDefaultValue()))= ;

but the previous mechanism was better (IMHO)= .

Thanks in advance,
Flavio
--0000000000005efeee057132364c--