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 D57C21982A for ; Tue, 19 Apr 2016 18:17:35 +0000 (UTC) Received: (qmail 52982 invoked by uid 500); 19 Apr 2016 18:17:32 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 52881 invoked by uid 500); 19 Apr 2016 18:17:31 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 52871 invoked by uid 99); 19 Apr 2016 18:17:31 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Apr 2016 18:17:31 +0000 Received: from mail-ob0-f173.google.com (mail-ob0-f173.google.com [209.85.214.173]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id AE7281A012C for ; Tue, 19 Apr 2016 18:17:31 +0000 (UTC) Received: by mail-ob0-f173.google.com with SMTP id n10so17074605obb.2 for ; Tue, 19 Apr 2016 11:17:31 -0700 (PDT) X-Gm-Message-State: AOPr4FUeur880/jyVMVZRrhT/YeGhW4Ce5RBVXJGTrfICRBj8soRB8OyyiUaksRt9R0OQPvRDDOc93kU/scpTQ== MIME-Version: 1.0 X-Received: by 10.182.248.199 with SMTP id yo7mr1855044obc.73.1461089851048; Tue, 19 Apr 2016 11:17:31 -0700 (PDT) Received: by 10.202.77.135 with HTTP; Tue, 19 Apr 2016 11:17:30 -0700 (PDT) In-Reply-To: References: Date: Tue, 19 Apr 2016 23:47:30 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Fwd: Eclipse debug HDFS server side code From: Vinayakumar B To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=001a11c2555a8e937c0530da7d77 --001a11c2555a8e937c0530da7d77 Content-Type: text/plain; charset=UTF-8 -Vinay ---------- Forwarded message ---------- From: Vinayakumar B Date: Tue, Apr 19, 2016 at 11:47 PM Subject: Re: Eclipse debug HDFS server side code To: Kun Ren 1. Since you are debugging remote code, you can't change the code dynamically during debugging. If you want to change, put the compiled code in remote process, and restart, reconnect and debug again. 2. All the console messages will be printed on the console of remote process, not in eclipse. 3. Though you cannot change the code, but you can change/inspect the value of value of an variable in 'display' window. You can explore more related to these. -Vinay On Tue, Apr 19, 2016 at 11:42 PM, Kun Ren wrote: > Hi Vinay, > > Thanks a lot, it works:) > > I have another question: > 1. When I add the following lines into the public boolean mkdirs(String > src, FsPermission masked, boolean createParent) in the > NameNodeRpcServer.java, > > LOG.warn("NameNodeRpcServer.java:mkdirs, log level=warn"); > System.out.println("In NameNodeRpcServer.java:mkdirs, before do > actual work"); > > But I can not see any output either from my terminal or Eclipse console > when I step-by-step debug this function, do you know why? > > 2. When I debug the client side code, for example FsShell, the default > log level is INFO, I changed the level to DEBUG using the > http://localhost:50070/logLevel, however, it still can not print out > LOG.debug(), but I can see LOG.info(), I don't know why it can not print > out debug information even I set the log level to DEBUG. > > > Thanks a lot for your help, > > > > > > On Tue, Apr 19, 2016 at 12:21 PM, Vinayakumar B > wrote: > >> Hi Kun Ren, >> >> You can follow the below steps. >> 1. configure HADOOP_NAMENODE_OPTS="-Xdebug >> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=3988" in >> hadoop-env.sh >> 2. Start Namenode >> 3. Now Namenode will start debug port in 3988. >> 4. Configure Remote debug application to connect to :3988 >> in eclipse >> 5. Now add a breakpoint in NameNodeRpcServer.java's any method you want >> to debug. NameNodeRpcServer.java is the gateway between NameNode and IPC >> Server Layer. >> 6. Now you can do step-by-step execution to observe the detailed >> executions. >> >> Happy Debugging ;) >> >> -Vinay >> >> On Tue, Apr 19, 2016 at 8:46 PM, Kun Ren wrote: >> >>> Hi All, >>> >>> Currently I used eclipse to compile/debug the source code, and I >>> configured the "remote Java application" to debug the source code in >>> eclipse, for example, I can debug the client side code when I run the >>> command "./bin/hdfs dfs -mkdir test", it goes through "FsShell---> >>> DistributedFileSystem---->DFSClient ....->send request to the server side. >>> Then it finish debugging, but I can not see how the server side handle the >>> request. >>> >>> >>> However, I want to debug and see how the server side(HDFS) handle the >>> request? Do you know how I can do this? Thanks so much. Also when I try to >>> add some debug information(such as print out something), but I can not see >>> anything printed out in eclipse, I don't know why. Thanks again. >>> >>> Best, >>> Kun >>> >> >> > --001a11c2555a8e937c0530da7d77 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

-Vinay<= /span>

---------- Forwarded message ----------
F= rom: Vinayakumar B <= vinayakumarb@apache.org><= /span>
Date: Tue, Apr 19, 2016 at 11:47 PM
Subject: Re: Eclipse debug= HDFS server side code
To: Kun Ren <ren.hdfs@gmail.com>


1. Since you ar= e debugging remote code, you can't change the code dynamically during d= ebugging. If you want to change, put the compiled code in remote process, a= nd restart, reconnect and debug again.
2. All the console messages will= be printed on the console of remote process, not in eclipse.
3. = Though you cannot change the code, but you can change/inspect the value of = value of an variable in 'display' window.=C2=A0

You can explore more related to these.

-Vinay

On Tue, Apr 19, 2016 at 11:42 PM, Kun Ren <ren.hdfs@gmail.com> wrote:
Hi Vinay,

Thanks a l= ot, it works:)

I have another question:
1. When I add= the following lines into the public boolean mkdirs(String src, FsPermissio= n masked, boolean createParent)=C2=A0 in the NameNodeRpcServer.java,
=C2=A0=C2=A0=C2=A0 =C2=A0 LOG.warn("NameNodeRpcServer.java:mkdi= rs, log level=3Dwarn");
=C2=A0=C2=A0=C2=A0 =C2=A0 System.out.printl= n("In NameNodeRpcServer.java:mkdirs, before do actual work");
=
But I can not see any output either from my terminal or Eclipse c= onsole when I step-by-step debug this function, do you know why?

2.=C2=A0 When I debug the client side code, for example FsShell, the def= ault log level is INFO, I changed the level to DEBUG using the http://localhost:50070/lo= gLevel, however, it still can not print out LOG.debug(), but I can see = LOG.info(),=C2=A0 I don't know why it can not print out debug informati= on even I set the log level to DEBUG.


Thanks a lot for yo= ur help,




<= /div>

On Tue, Apr 19, 2016 at 12:21 PM, V= inayakumar B <vinayakumarb@apache.org> wrote:
Hi Kun Ren,

Y= ou can follow the below steps.
1. configure HADOOP_NAMENODE_OPTS=3D&qu= ot;-Xdebug -Xrunjdwp:transport=3Ddt_socket,server=3Dy,suspend=3Dn,address= =3D3988" in hadoop-env.sh
2. Start Namenode
3. Now Namen= ode will start debug port in 3988.
4. Configure Remote debug appl= ication to connect to <namenode_host>:3988 in eclipse
5. No= w add a breakpoint in NameNodeRpcServer.java's any method you want to d= ebug. NameNodeRpcServer.java is the gateway between NameNode and IPC Server= Layer.
6. Now you can do step-by-step execution to observe the d= etailed executions.

Happy Debugging ;)

-Vinay

On Tue, Apr 19, 2016 at 8:46 PM, Kun Ren <= ren.hdfs@gmail.com> wrote:
Hi All,

Currently I used eclipse to=20 compile/debug the source code, and I configured the "remote Java=20 application" to debug the source code in eclipse, for example, I can= =20 debug the=C2=A0 client side code when I run the command "./bin/hdfs df= s=20 -mkdir test", it goes through "FsShell--->=20 DistributedFileSystem---->DFSClient ....->send request to the server side. Then it finish debugging, but I can not see how the server side handle the request.


However, I want to debug and=20 see how the server side(HDFS) handle the request? Do you know how I can=20 do this?=C2=A0 Thanks so much. Also when I try to add some debug=20 information(such as print out something), but I can not see anything=20 printed out in eclipse, I don't know why. Thanks again.

Be= st,
Kun




--001a11c2555a8e937c0530da7d77--