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 C23D4200CAD for ; Wed, 14 Jun 2017 03:36:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C0D28160BE9; Wed, 14 Jun 2017 01:36:05 +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 12D76160BDC for ; Wed, 14 Jun 2017 03:36:04 +0200 (CEST) Received: (qmail 90618 invoked by uid 500); 14 Jun 2017 01:36:04 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 90609 invoked by uid 99); 14 Jun 2017 01:36:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2017 01:36:04 +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 D5E9CC047C for ; Wed, 14 Jun 2017 01:36:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id ByWDrQssSIa4 for ; Wed, 14 Jun 2017 01:36:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 8A6A55F523 for ; Wed, 14 Jun 2017 01:36:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C13ECE0C1B for ; Wed, 14 Jun 2017 01:36:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 17AC821E0E for ; Wed, 14 Jun 2017 01:36:00 +0000 (UTC) Date: Wed, 14 Jun 2017 01:36:00 +0000 (UTC) From: "Luke Cwik (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (BEAM-1314) DoFn per-key lifecycle (Setup/Teardown) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 14 Jun 2017 01:36:06 -0000 [ https://issues.apache.org/jira/browse/BEAM-1314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16048581#comment-16048581 ] Luke Cwik edited comment on BEAM-1314 at 6/14/17 1:35 AM: ---------------------------------------------------------- I believe this is more of an implementation detail of how the Java SDK works. Nothing in the model says that a DoFn which uses user state can't be re-used across different keys within the same bundle. I believe the flaws are within the usage of a KeyedWorkItem and how the current key propagates through all the context objects within Java SDK runners core. was (Author: lcwik): I believe this is more of an implementation detail of how the Java SDK works. Nothing in the model says that a DoFn which uses user state can't be re-used across different keys within the same bundle. I believe the flaws are within the usage of a KeyedWorkItem and how the current key propagates through all the context objects within the Java SDK runners core. > DoFn per-key lifecycle (Setup/Teardown) > --------------------------------------- > > Key: BEAM-1314 > URL: https://issues.apache.org/jira/browse/BEAM-1314 > Project: Beam > Issue Type: Wish > Components: beam-model > Reporter: Eugene Kirpichov > > DoFn's that use state and timers are implicitly per-key. Setup/Teardown methods are usually used to establish expensive resources - long-standing connections and such. > For per-key DoFn's, we'd often want to use these per-key, so it'd be good to have ability in the model to ask that there be 1 instance of the DoFn per key, reused between e.g. different timer or trigger firings for this key, but not used for other keys. > E.g. this would be particularly useful for Splittable DoFn - for its ability to reuse expensive resources between checkpoints. -- This message was sent by Atlassian JIRA (v6.4.14#64029)