Return-Path: X-Original-To: apmail-flink-user-archive@minotaur.apache.org Delivered-To: apmail-flink-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9C99C1823F for ; Wed, 23 Sep 2015 11:21:24 +0000 (UTC) Received: (qmail 15100 invoked by uid 500); 23 Sep 2015 11:21:21 -0000 Delivered-To: apmail-flink-user-archive@flink.apache.org Received: (qmail 15016 invoked by uid 500); 23 Sep 2015 11:21:21 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@flink.apache.org Delivered-To: mailing list user@flink.apache.org Received: (qmail 15006 invoked by uid 99); 23 Sep 2015 11:21:21 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2015 11:21:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 0B41FC137B for ; Wed, 23 Sep 2015 11:21:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.994 X-Spam-Level: X-Spam-Status: No, score=0.994 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.006] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id BeZH0W4c89cf for ; Wed, 23 Sep 2015 11:21:15 +0000 (UTC) Received: from mail.marmelandia.com (marmelandia.com [46.19.36.96]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 5687525DDE for ; Wed, 23 Sep 2015 11:20:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.marmelandia.com (Postfix) with ESMTP id 966CB22CCB for ; Wed, 23 Sep 2015 13:20:39 +0200 (CEST) X-Virus-Scanned: amavisd-new at marmelandia.com Received: from mail.marmelandia.com ([127.0.0.1]) by localhost (marmelandia.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id V4MB7C7Gae4Y for ; Wed, 23 Sep 2015 13:20:39 +0200 (CEST) Received: from [10.52.76.31] (mobile-access-bcee4c-31.dhcp.inet.fi [188.238.76.31]) by mail.marmelandia.com (Postfix) with ESMTPSA id 2134022372 for ; Wed, 23 Sep 2015 13:20:39 +0200 (CEST) Subject: Immutable data From: Jack Content-Type: text/plain; charset=us-ascii X-Mailer: iPhone Mail (11B651) Message-Id: <22186F9B-5EE7-4FC6-9408-087205DC1D23@marmelandia.com> Date: Wed, 23 Sep 2015 14:29:03 +0300 To: user@flink.apache.org Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Hi, I'm having trouble integrating existing Scala code with Flink, due to POJO-o= nly requirement.=20 We're using AnyVal heavily for type safety, and immutable classes as a defau= lt. For example, the following does not work: object Test { class Id(val underlying: Int) extends AnyVal class X(var id: Id) { def this() { this(new Id(0)) }=20 } class MySource extends SourceFunction[X] { def run(ctx: SourceFunction.SourceContext[X]) { ctx.collect(new X(new Id(1))) } def cancel() {} } def main(args: Array[String]) { val env =3D StreamExecutionContext.getExecutionContext env.addSource(new MySource).print env.execute("Test") } } Currently I'm thinking that I would need to have duplicate classes and code f= or Flint and for non-Flint code, or somehow use immutable interfaces for non= -Flint code. Both ways are expensive in terms of development time.=20 Would you have any guidance on how to integrate Flink with a code base that h= as immutability as a norm? Thanks=