Return-Path: X-Original-To: apmail-incubator-crunch-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-crunch-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 671B7E77D for ; Sun, 3 Feb 2013 15:28:14 +0000 (UTC) Received: (qmail 6422 invoked by uid 500); 3 Feb 2013 15:28:14 -0000 Delivered-To: apmail-incubator-crunch-dev-archive@incubator.apache.org Received: (qmail 6391 invoked by uid 500); 3 Feb 2013 15:28:13 -0000 Mailing-List: contact crunch-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: crunch-dev@incubator.apache.org Delivered-To: mailing list crunch-dev@incubator.apache.org Received: (qmail 6374 invoked by uid 99); 3 Feb 2013 15:28:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Feb 2013 15:28:12 +0000 Date: Sun, 3 Feb 2013 15:28:12 +0000 (UTC) From: "Gabriel Reid (JIRA)" To: crunch-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CRUNCH-157) Mark the setContext function in the DoFn class as final MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CRUNCH-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13569801#comment-13569801 ] Gabriel Reid commented on CRUNCH-157: ------------------------------------- What do you think of making setContext and initialize totally independent of each other (and don't make setContext final) ? This would mean that we don't make setContext final, so that decorator DoFns can just send the setContext call through to their underlying methods, as well as with initialize. We would also have to make an explicit call to DoFn#initialize in RTNode#initialize. It feels to me that doing it that way would just make things a lot more simple -- if you write a wrapper DoFn, you just have to delegate all calls to the wrapped DoFn without thinking about it, and other than that you just don't worry about the logic between initialize and setContext. > Mark the setContext function in the DoFn class as final > ------------------------------------------------------- > > Key: CRUNCH-157 > URL: https://issues.apache.org/jira/browse/CRUNCH-157 > Project: Crunch > Issue Type: Improvement > Components: Core > Affects Versions: 0.3.0, 0.4.0 > Reporter: Josh Wills > Assignee: Josh Wills > Attachments: CRUNCH-157.patch > > > We often use a pattern of nested DoFns-- DoFns that are composed of operations on other DoFns. There is currently an ambiguity around the right way to initialize those DoFns, since it can be done either via overriding the initialize() or the setContext() methods in DoFn. We should mark setContext as final in order to remove the ambiguity and fix the instances in Crunch core where we override setContext() instead of initialize(). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira