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 E0902DD0E for ; Tue, 19 Jun 2012 21:20:32 +0000 (UTC) Received: (qmail 13852 invoked by uid 500); 19 Jun 2012 21:20:32 -0000 Delivered-To: apmail-incubator-crunch-dev-archive@incubator.apache.org Received: (qmail 13827 invoked by uid 500); 19 Jun 2012 21:20:32 -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 13817 invoked by uid 99); 19 Jun 2012 21:20:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jun 2012 21:20:32 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jwills@cloudera.com designates 209.85.213.175 as permitted sender) Received: from [209.85.213.175] (HELO mail-yx0-f175.google.com) (209.85.213.175) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jun 2012 21:20:27 +0000 Received: by yenl13 with SMTP id l13so4838077yen.6 for ; Tue, 19 Jun 2012 14:20:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=vUClR4SD1PD3+57h6P2jf7XiVLWNGa0vwuQCOWT2T50=; b=arTmLXvT7Px8ExKUZxmFrM4L06ELdLOnKj34Y5wtJfit/gO3nwNzNRVK5ofiPZNE2J NyyFNoxlNVrFUWPk/TbjhOrVWyonAjWyvRDgJLAxflt9Q5yFJAbE09FfkCs0Km2giitp /XnwySTn8a6qT6ggvu2k8x+PnUFpU9I/uFkQa9CWAwDOiWO11JmXHi2ZD1LfCpzD7qLN a6+YGDkpsYWkNxKWkLkTyhcFmgceWsNB+5KDOIJ/gRux5/9F9O5W7Fwi7r9Kev9EqKOx 6vfBbbhD0RsKYMOm10Lhf3nHBfFDGIOksM9TWVtyIi/HfJjXX/luUYphOzsi9dEJAp86 4JzA== Received: by 10.60.19.67 with SMTP id c3mr21311763oee.2.1340140806274; Tue, 19 Jun 2012 14:20:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.75.39 with HTTP; Tue, 19 Jun 2012 14:19:46 -0700 (PDT) In-Reply-To: References: From: Josh Wills Date: Tue, 19 Jun 2012 14:19:46 -0700 Message-ID: Subject: Re: Compiler warnings in Crunch To: crunch-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkmp06pGVSogMANB6ykkFpso46VRmg9x36eJNWUqGDLeft7hW8KpZYcz5EcLAJ5+7jOKpYP On Tue, Jun 19, 2012 at 1:56 PM, Tom White wrote: > On Mon, Jun 18, 2012 at 6:42 PM, Robert Chu wrote: >> +1 to fixing compiler warnings. I would prefer proper usage of the wildcard >> type to just suppressing the warnings. > > +1 Suppressing generics warnings should be the means of last resort, > and should be done at the smallest possible scope. > > Regarding the serialization warnings, I think it's better not to add > serial UIDs everywhere since they add clutter. You can turn off the > warnings in Eclipse instead - would that acceptable? I'm okay with that-- is it a setting we can add to the config settings Gabriel just checked in? > > Cheers, > Tom > >> >> Robert >> >> On Mon, Jun 18, 2012 at 7:57 AM, Josh Wills wrote: >> >>> On Mon, Jun 18, 2012 at 6:24 AM, Gabriel Reid >>> wrote: >>> > As prep for some other development I was going to do in Crunch, I was >>> > considering cleaning up some (or all) of the compiler warnings that >>> > are currently occurring (they make the right-side search ribbon in >>> > Eclipse almost unusable right now). >>> > >>> > A significant portion of the compiler warnings are raw type generics >>> > warnings, i.e. "xxx is a raw type. References to xxx should be >>> > parameterized", where we're doing general operations with PCollections >>> > and similar objects without knowing anything about their generic >>> > types. >>> >>> There are also the warnings about not adding serialization UIDs to the >>> built-in DoFns, which irritate me and are useless in the context of >>> Crunch. Happy to volunteer to go around and add UID = 1; code all over >>> the place if there are no objections. >>> >>> > >>> > We could add wildcards (i.e. PCollection) to each of these generic >>> > objects in the methods where the warnings are occurring -- this would >>> > be my preferred thing to do. On the other hand, I think that adding >>> > wildcards make the code more difficult to read, while having any kind >>> > of real added value. >>> > >>> > The other option we could take (less preferable to me) is to use >>> > @SuppressWarnings("rawtypes") on some or all of the affected methods >>> > -- it'll leave the code in a more readable state, but I'm not that >>> > wild about just suppressing warnings. >>> >>> I'm a 0 on the approach here-- I always have a hard time getting the >>> stuff to compile when I'm casting the result, which is what often >>> happens in Writables.java and Avros.java, but I agree that a working >>> version of the wildcards is preferable to suppress warnings. We might >>> say that we prefer but add in SuppressWarnings when there is no >>> other option for what we're trying to do. >>> >>> > >>> > Anyone else care to weigh in on this? >>> > >>> > - Gabriel >>> >>> >>> >>> -- >>> Director of Data Science >>> Cloudera >>> Twitter: @josh_wills >>> -- Director of Data Science Cloudera Twitter: @josh_wills