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 9BB45200C2C for ; Fri, 3 Mar 2017 16:24:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9A5F8160B57; Fri, 3 Mar 2017 15:24:51 +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 BD6C5160B6D for ; Fri, 3 Mar 2017 16:24:50 +0100 (CET) Received: (qmail 15382 invoked by uid 500); 3 Mar 2017 15:24:49 -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 15372 invoked by uid 99); 3 Mar 2017 15:24:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Mar 2017 15:24:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5392F18819E for ; Fri, 3 Mar 2017 15:24:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.999 X-Spam-Level: * X-Spam-Status: No, score=1.999 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=data-artisans-com.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id D3KfP2rrtKuu for ; Fri, 3 Mar 2017 15:24:47 +0000 (UTC) Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 790995FAE8 for ; Fri, 3 Mar 2017 15:24:46 +0000 (UTC) Received: by mail-wr0-f175.google.com with SMTP id u48so75974449wrc.0 for ; Fri, 03 Mar 2017 07:24:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=data-artisans-com.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=tGAM6LR6398v629OR0eTor33WCZKWp77Y66R8VuVAAc=; b=t6rAFa9nHENCPycxHwsqV9xL/8HB6Uzx5jAmIbzJoz21Td/0Sv5mbt2V00DEZcWuyI Ms49pEbMQjy37FtpyhRdeaB1XCU576IErVQbdbQOCyXCNRWxoPeDH+SbYNv0bspMeJNY I3sdnEAJqfQBl/3X+byux9Wd6YHRK6512PssEJu2M0qpiV89i5SGMgo5FhQozEPzUXtx hFvrpTKigzrZpPucX5hotJ9SSyyw8oMprjwPYuTMZAcRspMnRFLqc7p5hypQhPwEjaH2 BSeLVmtE86IRuVVb4lKLu4MiijUmiJ6Xe30+Mf5WDBqz0Zr2ts+Lic1TnIO9jOvSJIck 2mHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=tGAM6LR6398v629OR0eTor33WCZKWp77Y66R8VuVAAc=; b=jN7eyk5LR5OQQiPB0piOmwdaUmZSVmeLpbyEpzrVjEx3lTU+yPCogjls5tm9BH7NvB rruj0m1zVZfVT1ixHUsM6eQEpMG8vmphdqCytaTjhj2PhBwhihd8CeB/QMhA7F8vVnJT z0CpzXTevUFvXdRRb62UtkTBKV1yaVJ1JVw6+7W4UKJQlXPaWeWYc4T7g5aw9xUtTsTP ZKr/sDTsEz/p7SGJgoSBuBXbHF1g7zbUUMu4po0TiaRekjg8JD4UTzFl7dA7YZwZZxLi rk2EobQ/uRDAi+5ttHVYZA34NZFOG7IA7jQE0q50QNc3lRQ05TgHgm66rYpB39odJd/V WDGg== X-Gm-Message-State: AMke39kkBbJoQo65r9wJQ5xaMkN+VUurACGMUrHNduJL1LXEDDp7K2tH+65LGSWXeWAGlUo/ X-Received: by 10.223.134.98 with SMTP id 31mr3507740wrw.69.1488554681071; Fri, 03 Mar 2017 07:24:41 -0800 (PST) Received: from skynet.fritz.box (ipservice-092-219-046-010.092.219.pools.vodafone-ip.de. [92.219.46.10]) by smtp.gmail.com with ESMTPSA id u184sm3432240wmb.29.2017.03.03.07.24.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Mar 2017 07:24:40 -0800 (PST) From: Stefan Richter Content-Type: multipart/alternative; boundary="Apple-Mail=_08C2CB04-2E74-44FD-A76C-FB3885834F97" Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: A Link Sink that writes to OAuth2.0 protected resource Date: Fri, 3 Mar 2017 16:24:39 +0100 References: <837394F3-8E9D-4EBC-A205-FD756FD31517@zalando.de> To: user@flink.apache.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3259) archived-at: Fri, 03 Mar 2017 15:24:51 -0000 --Apple-Mail=_08C2CB04-2E74-44FD-A76C-FB3885834F97 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Hussein, for your information, today we added a description of task and operator = lifecycles to the documentation: = https://ci.apache.org/projects/flink/flink-docs-release-1.3/internals/task= _lifecycle.html = . Best, Stefan=20 > Am 03.03.2017 um 15:30 schrieb Tzu-Li (Gordon) Tai = : >=20 > Hi Hussein! >=20 > Your approach seems reasonable to me. The open() method will be called = only once for the UDF every time the job has started (and when the job = is restored from failures also). >=20 > Cheers, > Gordon >=20 > On March 3, 2017 at 7:03:22 PM, Hussein Baghdadi = (hussein.baghdadi@zalando.de ) = wrote: >=20 >> Hello,=20 >>=20 >> In our Sink, we are dealing with a system that uses OAuth 2.0. So the = in the open() method of the Sink we are getting the token and then we = initialise the client that we can use in order to write from Flink to = that API.=20 >>=20 >> Is there a better approach to handle that? =20 >>=20 >> open() is a lifecycle method which I assume it will be called only = once when creating a Sink, correct? Are there any conditions that might = trigger open() to be called not upon creations?=20 >>=20 >> Thanks a lot for your help and time. --Apple-Mail=_08C2CB04-2E74-44FD-A76C-FB3885834F97 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Hi Hussein,

for your information, today we added a description of task = and operator lifecycles to the documentation: https://ci.apache.org/projects/flink/flink-docs-release-1.3/int= ernals/task_lifecycle.html .

Best,
Stefan 

Am = 03.03.2017 um 15:30 schrieb Tzu-Li (Gordon) Tai <tzulitai@apache.org>:

Hi Hussein!

Your approach = seems reasonable to me. The open() method will be called only once for = the UDF every time the job has started (and when the job is restored = from failures also).

Cheers,
Gordon

On March 3, = 2017 at 7:03:22 PM, Hussein Baghdadi (hussein.baghdadi@zalando.de) wrote:

Hello, 

In our Sink, we are dealing with a system that uses OAuth = 2.0. So the in the open() method of the Sink we are getting the token = and then we initialise the client that we can use in order to write from = Flink to that API. 

Is there a better approach to handle = that?  

open() is a lifecycle method which I assume it will be called = only once when creating a Sink, correct? Are there any conditions that = might trigger open() to be called not upon creations? 

Thanks a lot for your help and = time.

= --Apple-Mail=_08C2CB04-2E74-44FD-A76C-FB3885834F97--