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 F135E200CD7 for ; Tue, 1 Aug 2017 16:20:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EFC43167349; Tue, 1 Aug 2017 14:20:13 +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 16728167348 for ; Tue, 1 Aug 2017 16:20:12 +0200 (CEST) Received: (qmail 50676 invoked by uid 500); 1 Aug 2017 14:20:12 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 50661 invoked by uid 99); 1 Aug 2017 14:20:11 -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, 01 Aug 2017 14:20:11 +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 363311A22CB for ; Tue, 1 Aug 2017 14:20:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.978 X-Spam-Level: * X-Spam-Status: No, score=1.978 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled 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 LSPQXZJiyIRc for ; Tue, 1 Aug 2017 14:20:08 +0000 (UTC) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067038.outbound.protection.outlook.com [40.92.67.38]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 46CE35F485 for ; Tue, 1 Aug 2017 14:20:08 +0000 (UTC) Received: from HE1EUR02FT033.eop-EUR02.prod.protection.outlook.com (10.152.10.52) by HE1EUR02HT116.eop-EUR02.prod.protection.outlook.com (10.152.11.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1282.16; Tue, 1 Aug 2017 14:20:01 +0000 Received: from HE1PR0202MB2906.eurprd02.prod.outlook.com (10.152.10.54) by HE1EUR02FT033.mail.protection.outlook.com (10.152.10.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1282.16 via Frontend Transport; Tue, 1 Aug 2017 14:20:01 +0000 Received: from HE1PR0202MB2906.eurprd02.prod.outlook.com ([fe80::790e:b5c9:87d7:1de1]) by HE1PR0202MB2906.eurprd02.prod.outlook.com ([fe80::790e:b5c9:87d7:1de1%17]) with mapi id 15.01.1282.023; Tue, 1 Aug 2017 14:20:01 +0000 From: Paolo Patierno To: "dev@kafka.apache.org" Subject: Re: Kafka Streams debugging with "no fluent" API choice Thread-Topic: Kafka Streams debugging with "no fluent" API choice Thread-Index: AQHTCrOe+SCiHWQIkkywmURyWmM9UKJvaTEAgAACE5uAAB+GgIAAAgOP Date: Tue, 1 Aug 2017 14:20:01 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kafka.apache.org; dkim=none (message not signed) header.d=none;kafka.apache.org; dmarc=none action=none header.from=live.com; x-incomingtopheadermarker: OriginalChecksum:CC5F1AE29F43AD69DC32353E69D3A5EF8FFB3065F4A0AA9AD248D6BAC02CEC75;UpperCasedChecksum:0C73FBD3AA692FFA1C36BC04BD245418A570AC0C0C7D41E56382B4641E625CEF;SizeAsReceived:7498;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [Eus3Oq22NrVIJwo3+9z8e+0iAY00sf4v] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;HE1EUR02HT116;7:8O8k2ucDzOTcMOnBZR21BfdIOBPhf2J2O6zCTZGH6hSZMI9ue4tVum6PH5rBnaGF/v7R9k7NJUozSTusVfju8+/tNhL3eqHLfAsXIqb3Q94rhiyPfLsNj1zYXxzb/7t8K6SZ0xmQe2/6F5us+MOKXlfIoe6XeqDtq+dWvqD0QZu/WlYAFNKagSRn7X4gS7sqbRXYljX2Z4khYEOS5UrtA1PC+fz26Io5JOk3I0QUJCW7pQivGBg7xIhTyJUtctn+ciFtkFmARPnLBXb1Ff4o9RPqeu2Etbp8qmKf4Cg0+CIOGN9rMa7yFYHjMlCCnYhoU6Bpqc0KElPdYL5SYKMbHlUBH+sYC6gt4yPN6TNoUuDc1Zf+yEZ3A2xdMUUSoPRxsl8je42k1FMjXCw8xDJzG+qGHc7lHf2FKlIS1DuabZtk2PnVE675wc9fcGugrv20hN5bjQxHHouDfM+OFHIF8YXSsaQd2CYISaQemYtfguZLe9GUHcKbSAj8tM4HZOHDaXcg12xWKHHtVM1gGx0YrqZEoKYmI4wjvfsrLTaWt7a3ChN/F8v902W+icUsxaP9MJ/mOuG5gSgrsjuvsdPpIAs+VvTjYPjou+SxYwfVYHbmdm90joIquX8c2b2SdwooNhc0frmrdt9CH3oQ02K1UP1SDpQ6bF8uTqvvmFqo+vZil5nN/Q/jwYqVOso7rKAJ/RJ/jrJkXkQYeQn/RObt1X1rTj/JuXdvnKji7W+BHjwfa/7hjwLCuUTzIgVnuC6Rr2VQhrkDiD6wMaRIWqVkJA== x-incomingheadercount: 45 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI;SFV:NSPM;SFS:(7070007)(98901004);DIR:OUT;SFP:1901;SCL:1;SRVR:HE1EUR02HT116;H:HE1PR0202MB2906.eurprd02.prod.outlook.com;FPR:;SPF:None;LANG:en; x-ms-office365-filtering-correlation-id: 795e1488-8504-4e43-2f97-08d4d8e865d2 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322377)(1601125374)(1603101448)(1701031045)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:HE1EUR02HT116; x-ms-traffictypediagnostic: HE1EUR02HT116: x-exchange-antispam-report-test: UriScan:(134217032509453)(148322886591682)(166708455590820)(31418570063057)(47647156867600)(37052965297144)(116415991822766)(81160342030619)(105182351903845); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(444000031);SRVR:HE1EUR02HT116;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1EUR02HT116; x-forefront-prvs: 0386B406AA spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_HE1PR0202MB29062E63356137442C710CEEC9B30HE1PR0202MB2906_" MIME-Version: 1.0 X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Aug 2017 14:20:01.7567 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR02HT116 archived-at: Tue, 01 Aug 2017 14:20:14 -0000 --_000_HE1PR0202MB29062E63356137442C710CEEC9B30HE1PR0202MB2906_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Damian, changing the print() method for sure needs a KIP but I guess there is some = reason we don't know why they decided to not have a fluent API for that. Regarding my JIRA I don't think a KIP is required, it's just internal stuff= ... no ? Thanks Paolo Patierno Senior Software Engineer (IoT) @ Red Hat Microsoft MVP on Windows Embedded & IoT Microsoft Azure Advisor Twitter : @ppatierno Linkedin : paolopatierno Blog : DevExperience ________________________________ From: Damian Guy Sent: Tuesday, August 1, 2017 2:11 PM To: dev@kafka.apache.org Subject: Re: Kafka Streams debugging with "no fluent" API choice Hi Paolo, The change would require a KIP as it is a public API change. I don't see any harm in making the change, but I also don't think it is that difficult to use peek to achieve the same thing. Thanks, Damian On Tue, 1 Aug 2017 at 13:52 Paolo Patierno wrote: > Thanks Damian, > > > I knew about that but you have to write the code for printing by yourself= . > Of course you can do that even with the print() without using the default > keyvalue mapper but passing a custom one. > > At same time if you want to print you should use a Serdes for key and > value if they are bytes and it's something which happens for free with > print() passing Serdes instances. > > > Another point is ... > > as both foreach() and peek() methods relies on the KStreamPeek node, it > could be the same for the print() method which uses a KStreamPrint that i= s > a special KStreamPeek with forwardDownStream =3D false and providing the > usage of Serdes. For this I have opened the following JIRA : > > > https://issues.apache.org/jira/browse/KAFKA-5684 > > > What do you think ? > > > Thanks > > > Paolo Patierno > Senior Software Engineer (IoT) @ Red Hat > Microsoft MVP on Windows Embedded & IoT > Microsoft Azure Advisor > > Twitter : @ppatierno > Linkedin : paolopatierno > Blog : DevExperience > > > ________________________________ > From: Damian Guy > Sent: Tuesday, August 1, 2017 12:11 PM > To: dev@kafka.apache.org > Subject: Re: Kafka Streams debugging with "no fluent" API choice > > I don't know specifically why this is removed, however if you want to get > the same functionality you can use peek, i.e: > > stream.map(...).peek(...).filter(..) > > You can log the key values out in the peek call. > > On Tue, 1 Aug 2017 at 11:48 Paolo Patierno wrote: > > > Hi guys, > > > > > > I was thinking about Kafka Streams debug features and why the print() > > method overloads didn't return a KStream, in order to have a fluent DSL > > construction even during debugging, but just void. > > > > Then I came across this PR : > > > > > > https://github.com/apache/kafka/pull/1187 > > > > > > May I ask why the form : > > > > > > stream1 =3D source.map(...).filter(...); > > stream1.print(); // this is for debugging, deleted before moving to > > productiong > > > > stream2 =3D stream1.transform(...); > > stream2.print(); // this is for debugging, deleted before moving to > > productiong > > > > was considered better then the fluent one : > > > > > > source.map(...).filter(...) > > .print() // this is for debugging, deleted before moving to > > productiong > > .transform(...) > > .print(); // this is for debugging, deleted before moving t= o > > productiong > > > > > > In this first case the user has to break the topology for printing and > > after that, when the code works fine, he has to rewrite the code for > > avoiding these broken processors having a fluent construction. > > > > In the second solution, the user has just to remove the print() calls > > without touching the other parts of the code. > > > > I really liked the first solution (it was something I was going to > propose > > before coming across the PR :-)). > > > > > > Why this preference on the first one ? > > > > > > Thanks > > > > > > > > Paolo Patierno > > Senior Software Engineer (IoT) @ Red Hat > > Microsoft MVP on Windows Embedded & IoT > > Microsoft Azure Advisor > > > > Twitter : @ppatierno > > Linkedin : paolopatierno > > Blog : DevExperience > > > --_000_HE1PR0202MB29062E63356137442C710CEEC9B30HE1PR0202MB2906_--