From commits-return-68757-archive-asf-public=cust-asf.ponee.io@beam.apache.org Mon Apr 23 23:41:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 66D51180676 for ; Mon, 23 Apr 2018 23:41:04 +0200 (CEST) Received: (qmail 15210 invoked by uid 500); 23 Apr 2018 21:41:03 -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 15201 invoked by uid 99); 23 Apr 2018 21:41:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2018 21:41:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 130A81A1FE8 for ; Mon, 23 Apr 2018 21:41:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id e_IkyDs-NFrN for ; Mon, 23 Apr 2018 21:41: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 398B85F16A for ; Mon, 23 Apr 2018 21:41: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 70B1CE00C6 for ; Mon, 23 Apr 2018 21:41: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 3097E241C4 for ; Mon, 23 Apr 2018 21:41:00 +0000 (UTC) Date: Mon, 23 Apr 2018 21:41:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (BEAM-3979) New DoFn should allow injecting of all parameters in ProcessContext MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/BEAM-3979?focusedWorklogId=3D9= 4317&page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpane= l#worklog-94317 ] ASF GitHub Bot logged work on BEAM-3979: ---------------------------------------- Author: ASF GitHub Bot Created on: 23/Apr/18 21:40 Start Date: 23/Apr/18 21:40 Worklog Time Spent: 10m=20 Work Description: reuvenlax commented on a change in pull request #49= 89: [BEAM-3979] Start completing the new DoFn vision: plumb context paramet= ers into process functions. URL: https://github.com/apache/beam/pull/4989#discussion_r183546263 =20 =20 ########## File path: sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoF= nOutputReceivers.java ########## @@ -0,0 +1,75 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= . + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.sdk.transforms; + +import javax.annotation.Nullable; +import org.apache.beam.sdk.transforms.DoFn.MultiOutputReceiver; +import org.apache.beam.sdk.transforms.DoFn.OutputReceiver; +import org.apache.beam.sdk.values.TupleTag; +import org.joda.time.Instant; + +/** + * Common {@link OutputReceiver} and {@link MultiOutputReceiver} classes. + */ +public class DoFnOutputReceivers { + /** + * A {@link OutputReceiver} that delegates to a {@link DoFn.WindowedCont= ext}. + */ + public static class WindowedContextOutputReceiver implements OutputRe= ceiver { + DoFn.WindowedContext context; + @Nullable TupleTag outputTag; + public WindowedContextOutputReceiver(DoFn.WindowedContext contex= t, =20 Review comment: > **jkff** wrote: > Probably would be better to package these under static factory functio= ns. =20 Done. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 94317) > New DoFn should allow injecting of all parameters in ProcessContext > ------------------------------------------------------------------- > > Key: BEAM-3979 > URL: https://issues.apache.org/jira/browse/BEAM-3979 > Project: Beam > Issue Type: Bug > Components: sdk-java-core > Affects Versions: 2.4.0 > Reporter: Reuven Lax > Assignee: Reuven Lax > Priority: Major > Fix For: 2.5.0 > > Time Spent: 1h 50m > Remaining Estimate: 0h > > This was intended in the past, but never completed. Ideally all primitive= parameters in ProcessContext should be injectable, and OutputReceiver para= meters can be used to collection output. So, we should be able to write a D= oFn as follows > @ProcessElement > public void process(@Element String word, OutputReceiver receiver= ) { > =C2=A0 receiver.output(word.toUpperCase()); > } -- This message was sent by Atlassian JIRA (v7.6.3#76005)