Return-Path: Delivered-To: apmail-hadoop-general-archive@minotaur.apache.org Received: (qmail 19670 invoked from network); 14 Apr 2010 17:55:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Apr 2010 17:55:53 -0000 Received: (qmail 79982 invoked by uid 500); 14 Apr 2010 17:55:52 -0000 Delivered-To: apmail-hadoop-general-archive@hadoop.apache.org Received: (qmail 79876 invoked by uid 500); 14 Apr 2010 17:55:52 -0000 Mailing-List: contact general-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@hadoop.apache.org Delivered-To: mailing list general@hadoop.apache.org Received: (qmail 79867 invoked by uid 99); 14 Apr 2010 17:55:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Apr 2010 17:55:52 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of invisiblesun@mac.com designates 17.148.16.105 as permitted sender) Received: from [17.148.16.105] (HELO asmtpout030.mac.com) (17.148.16.105) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Apr 2010 17:55:46 +0000 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from [172.27.35.143] (c-67-169-39-169.hsd1.ca.comcast.net [67.169.39.169]) by asmtp030.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L0V0055OOG0GK60@asmtp030.mac.com> for general@hadoop.apache.org; Wed, 14 Apr 2010 10:55:14 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-1004140192 Subject: Re: Custom Class Loader for Hadoop M/R jobs? From: Julia Smith In-reply-to: Date: Wed, 14 Apr 2010 10:55:11 -0700 Message-id: <19CC33EF-FA84-46CB-B61D-385CB92688A5@mac.com> References: To: general@hadoop.apache.org X-Mailer: Apple Mail (2.1078) This might be of use to you, as I had a related problem years ago: http://www.developertutorials.com/tutorials/java/simplify-application-delivery-one-jar-050422/page5.html The trick is a one-jar solution allows you to embed jar files and load classes from them. Rolling up all your jar variants in a single jar and then selectively loading the desired version might provide you a useful solution. The source is there, so you could start with a working classloader and perhaps apply a few tweaks. On Apr 14, 2010, at 10:33 AM, Segel, Mike wrote: > Scott, > > While that may work for a quick fix. Its not a good long term solution and you then run in to a problem where you upgrade your hadoop release and the removed jar is replaced or if you replace the jar, it possible to get overwritten. > > In this specific instance, the Jackson libraries are not that important and they can be replaced. > But that doesn't mean that this issue won't come up again and its something you can't easily pop out and replace. > > This is why I'm looking at custom class loading and trying to understand what can be accomplished with the methods in the Configuration class. > > Thx > > -Mike > > > -----Original Message----- > From: Scott Carey [mailto:scott@richrelevance.com] > Sent: Wednesday, April 14, 2010 12:02 PM > To: general@hadoop.apache.org > Subject: Re: Custom Class Loader for Hadoop M/R jobs? > > Depending on what the dependency is, you might be able to just remove it from hadoop's lib directory on your cluster. > > For me, Hadoop's later versions has jackson-1.0.1 in its lib directory and that breaks usage of Avro in a M/R job among other things. However, the feature that uses this library is unimportant to me (configuration dump in JSON format) so I just removed the jar. > > -Scott > > On Apr 14, 2010, at 6:39 AM, Segel, Mike wrote: > >> Hi, >> >> Ok, here's a bit of a bizarre issue... >> >> How do you handle class collisions between Hadoop and your m/r job which calls other 3rd party classes. >> >> An example: Hadoop has an older version of an open source jar in its /lib directory. You're interfacing with a 3rd party OS tool that uses a later release of the same jar. >> >> You can modify the classpath, and that might work. But the better way is to create a Custom Class Loader. (Non-trivial) >> >> Looking at the Configuration class, it looks like there are a couple of methods that deal with loading a class in to the configuration so that the m/r jobs can have access to them on each node. >> >> Is this the correct intended use, or am I missing something? >> Has anyone done something like this? >> >> Thx >> >> -Mike >> >> Michael Segel >> Architect, R&D >> NAVTEQ >> 425 West Randolph Street >> Chicago, IL 60606 >> (T) +1 312-780-3432 >> (C) +1 312-952-8175 >> www.navteq.com >> >> >> >> The information contained in this communication may be CONFIDENTIAL and is intended only for the use of the recipient(s) named above. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please notify the sender and delete/destroy the original message and any copy of it from your computer or paper files. > > > > The information contained in this communication may be CONFIDENTIAL and is intended only for the use of the recipient(s) named above. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please notify the sender and delete/destroy the original message and any copy of it from your computer or paper files.