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 9DA42200CFC for ; Thu, 28 Sep 2017 13:59:40 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9C29B1609CD; Thu, 28 Sep 2017 11:59:40 +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 E0F2E1609C2 for ; Thu, 28 Sep 2017 13:59:39 +0200 (CEST) Received: (qmail 10258 invoked by uid 500); 28 Sep 2017 11:59:38 -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 10249 invoked by uid 99); 28 Sep 2017 11:59:38 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Sep 2017 11:59:38 +0000 Received: from [192.168.178.53] (dslb-094-222-124-158.094.222.pools.vodafone-ip.de [94.222.124.158]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 5F0361A003E for ; Thu, 28 Sep 2017 11:59:36 +0000 (UTC) Subject: Re: Custom Serializers To: user@flink.apache.org References: <1505482444598-0.post@n4.nabble.com> <1505495471043-0.post@n4.nabble.com> <1505733649628-0.post@n4.nabble.com> <1505734704582-0.post@n4.nabble.com> <1505737083354-0.post@n4.nabble.com> <1505752117004-0.post@n4.nabble.com> <08e2e15f-f4cc-cacf-1a4b-9cb0b2b5e4a6@apache.org> <1505813976505-0.post@n4.nabble.com> <1506526982731-0.post@n4.nabble.com> From: Chesnay Schepler Message-ID: <1cc70c37-61f4-937d-14f7-fd2585b772f7@apache.org> Date: Thu, 28 Sep 2017 13:59:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1506526982731-0.post@n4.nabble.com> Content-Type: multipart/alternative; boundary="------------D6DEFB075955A569A431D2D2" Content-Language: en-US archived-at: Thu, 28 Sep 2017 11:59:40 -0000 This is a multi-part message in MIME format. --------------D6DEFB075955A569A431D2D2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 19.09.2017 11:39, nragon wrote: > createInstance(Object[] fields) at TupleSerializerBase seems not to be part > of TypeSerializer API. > Will I be loosing any functionality? In what cases do you use this instead > of createInstance()? > > // We use this in the Aggregate and Distinct Operators to create instances > // of immutable Tuples (i.e. Scala Tuples) > > Thanks Taken from TupleSerializerBase: // We use this in the Aggregate and Distinct Operators to create instances // of immutable Tuples (i.e. Scala Tuples) public abstract T createInstance(Object[] fields); On 27.09.2017 17:43, nragon wrote: > Should I use TypeSerializerSingleton if it is independent of the object which > it's serializing? > > > > -- > Sent from:http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/ > Generally, use TypeSerializerSingleton. There is virtually no reason to not use it. Do keep this section of the TypeSerializer javadoc in mind: * The methods in this class are assumed to be stateless, such that it is effectively thread safe. Stateful * implementations of the methods may lead to unpredictable side effects and will compromise both stability and * correctness of the program. --------------D6DEFB075955A569A431D2D2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
On 19.09.2017 11:39, nragon wrote:
createInstance(Object[] fields) at TupleSerializerBase seems not to be part
of TypeSerializer API.
Will I be loosing any functionality? In what cases do you use this instead
of createInstance()?

// We use this in the Aggregate and Distinct Operators to create instances
// of immutable Tuples (i.e. Scala Tuples)

Thanks
Taken from TupleSerializerBase:
// We use this in the Aggregate and Distinct Operators to create instances
// of immutable Tuples (i.e. Scala Tuples)
public abstract T createInstance(Object[] fields);

On 27.09.2017 17:43, nragon wrote:
Should I use TypeSerializerSingleton if it is independent of the object which
it's serializing?



--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/

Generally, use TypeSerializerSingleton. There is virtually no reason to not use it. Do keep this section of the TypeSerializer javadoc in mind:

* The methods in this class are assumed to be stateless, such that it is effectively thread safe. Stateful
* implementations of the methods may lead to unpredictable side effects and will compromise both stability and
* correctness of the program.
--------------D6DEFB075955A569A431D2D2--