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 61A92200C92 for ; Mon, 12 Jun 2017 17:51:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 60562160BD9; Mon, 12 Jun 2017 15:51:24 +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 CD957160BD6 for ; Mon, 12 Jun 2017 17:51:23 +0200 (CEST) Received: (qmail 58378 invoked by uid 500); 12 Jun 2017 15:51:22 -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 58363 invoked by uid 99); 12 Jun 2017 15:51:21 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jun 2017 15:51:21 +0000 Received: from aljoschas-mbp.fritz.box (dslb-084-059-068-070.084.059.pools.vodafone-ip.de [84.59.68.70]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id D50D51A00A8; Mon, 12 Jun 2017 15:51:20 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Use Single Sink For All windows From: Aljoscha Krettek In-Reply-To: <1747645.ifJNGfsv0h@nico-work> Date: Mon, 12 Jun 2017 17:51:17 +0200 Cc: user , rhashmi Content-Transfer-Encoding: quoted-printable Message-Id: References: <1496558868204-13475.post@n4.nabble.com> <1496758951159-13525.post@n4.nabble.com> <1747645.ifJNGfsv0h@nico-work> To: Nico Kruber X-Mailer: Apple Mail (2.3273) archived-at: Mon, 12 Jun 2017 15:51:24 -0000 Ah, I think now I get your problem. You could manually implement = batching inside your SinkFunction, The SinkFunction would batch values = in memory and periodically (based on the count of values and on a = timeout) send these values as a single batch to MySQL. To ensure that = data is not lost you can implement the CheckpointedFunction interface = and make sure to always flush to MySQL when a snapshot is happening. Does that help? > On 8. Jun 2017, at 11:46, Nico Kruber wrote: >=20 > How about using asynchronous I/O operations? >=20 > = https://ci.apache.org/projects/flink/flink-docs-release-1.3/dev/stream/ > asyncio.html >=20 >=20 > Nico >=20 > On Tuesday, 6 June 2017 16:22:31 CEST rhashmi wrote: >> because of parallelism i am seeing db contention. Wondering if i can = merge >> sink of multiple windows and insert in batch. >>=20 >>=20 >>=20 >> -- >> View this message in context: >> = http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Use-Si= n >> gle-Sink-For-All-windows-tp13475p13525.html Sent from the Apache = Flink User >> Mailing List archive. mailing list archive at Nabble.com. >=20