Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F26F1CE0C for ; Mon, 4 Nov 2013 04:53:54 +0000 (UTC) Received: (qmail 18948 invoked by uid 500); 4 Nov 2013 04:53:47 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 18573 invoked by uid 500); 4 Nov 2013 04:53:42 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 18562 invoked by uid 99); 4 Nov 2013 04:53:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Nov 2013 04:53:41 +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 ozawa.tsuyoshi@gmail.com designates 209.85.212.182 as permitted sender) Received: from [209.85.212.182] (HELO mail-wi0-f182.google.com) (209.85.212.182) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Nov 2013 04:53:33 +0000 Received: by mail-wi0-f182.google.com with SMTP id ez12so4228wid.15 for ; Sun, 03 Nov 2013 20:53:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=DLD9dQg4KzsvZJFqDO8ncedH0zL3nCboszD9uOAEiQw=; b=Z8pbAc5XPU9igWnjCKik4pIw2/mc+9WrKmCkp36n93ixhR5QBB8lhWaCzY91lUOQtm iUMdFS1p1G2b9D/3Xdc3XNLvgvh0YMDDNsbz59U9YQ1sGjeBMm3asOpuxs2aFeHU3H6T /f8Djo2tJTh9WUO4f7Yy548rgC9sOrNSxzfJR79aKz6vNpr03Nlrzs4GAYwovgGo7X4N ti7aikGw03YC2din5mC43CId1nMWGoT4MamPmNTnhPcvYJlWkgsJq9CljdaWNyQXg5mX dfKg33c/wtkP4bMFnW6x6/hGwSTaGIPvsd4Pl3KUzXM6Oy3cZo2VyknxUC0XC4LUuT2v t+lg== MIME-Version: 1.0 X-Received: by 10.180.37.227 with SMTP id b3mr10584661wik.24.1383540793204; Sun, 03 Nov 2013 20:53:13 -0800 (PST) Received: by 10.216.93.68 with HTTP; Sun, 3 Nov 2013 20:53:13 -0800 (PST) In-Reply-To: References: <869970D71E26D7498BDAC4E1CA92226B86D64FD3@MBX021-E3-NJ-2.exch021.domain.local> Date: Sun, 3 Nov 2013 23:53:13 -0500 Message-ID: Subject: Re: Hadoop 2.x with Eclipse From: Tsuyoshi OZAWA To: "user@hadoop.apache.org" Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Instead of Ted's approach, it's also useful to use surefire plugin when you debug tests. mvn test -Dmaven.surefire.debug -Dtest=TestClassName This commands accept debugger's attach on 5005 port by default, so you can attach via eclipse's debugger. Then the test runs and you can use debugger. I think the source code is needed to be compiled in your local environment instead of just downloading it from hadoop's release. Thanks, Tsuyoshi On Sun, Nov 3, 2013 at 11:22 PM, Karim Awara wrote: > Hi guys, > > Can I just install the HDFS project and debug it? (assuming I am running a > command through the command line). If so, which project should I > download (hadoop project that has hdfs)? > > -- > Best Regards, > Karim Ahmed Awara > > > On Sun, Oct 6, 2013 at 5:40 PM, Ted Yu wrote: >> >> Karim: >> If you want to debug unit tests, using Eclipse is a viable approach. >> Here is what I did the past week debugging certain part of hadoop >> (JobSubmitter in particular) through an HBase unit test. >> >> Run 'mvn install -DskipTests' to install hadoop locally >> Open the class you want to debug and place breakpoint at proper location >> Open unit test which depends on the class above and select Debug As -> >> JUnit Test >> When breakpoint hits, associate the sources.jar file in local maven repo >> with the class. In my case, the sources jar file is located under >> ~/.m2/repository/org/apache/hadoop/hadoop-mapreduce-client-core/2.1.2-SNAPSHOT >> >> You should be able to step through hadoop code as usual at this point. >> >> Cheers >> >> >> On Sun, Oct 6, 2013 at 6:14 AM, John Lilley >> wrote: >>> >>> Karim, >>> >>> >>> >>> I am not an experienced Hadoop programmer, but what I found was that >>> building and debugging Hadoop under Eclipse was very difficult, and I was >>> never to make it work correctly. I suggest using the well documented >>> command-line Maven build, installing Hadoop from that build, and running it >>> normally. Once you have that working, run your namemode or datanode daemon >>> so as to wait for a remote debugger attach before starting. You should also >>> get comfortable with log4j, the logging framework used by Hadoop, as those >>> log files are often your best friend when trying to debug a collection of >>> services. >>> >>> >>> >>> john >>> >>> >>> >>> From: Karim Awara [mailto:karim.awara@kaust.edu.sa] >>> Sent: Sunday, October 06, 2013 5:41 AM >>> To: user >>> Subject: Hadoop 2.x with Eclipse >>> >>> >>> >>> Hi, >>> >>> I followed the instructions on how to import hadoop files to Eclipse (I >>> am using hadoop 2.1 beta). >>> >>> Currently on my machine, I have hadoop 2.1 installed.. and its source >>> code is imported on Eclipse. What I can't grasp is how to proceed from >>> there? >>> >>> I want to modify HDFS code (blockplacement strategy).. Now building hdfs >>> project via generates errors to me (unresolved types in hadoop common). and >>> if i built successfully, how to test my modified code? >>> >>> >>> -- >>> Best Regards, >>> Karim Ahmed Awara >>> >>> >>> >>> ________________________________ >>> >>> This message and its contents, including attachments are intended solely >>> for the original recipient. If you are not the intended recipient or have >>> received this message in error, please notify me immediately and delete this >>> message from your computer system. Any unauthorized use or distribution is >>> prohibited. Please consider the environment before printing this email. >> >> > > > ________________________________ > This message and its contents, including attachments are intended solely for > the original recipient. If you are not the intended recipient or have > received this message in error, please notify me immediately and delete this > message from your computer system. Any unauthorized use or distribution is > prohibited. Please consider the environment before printing this email. -- - Tsuyoshi