You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by 陈竞 <cj...@gmail.com> on 2011/12/08 06:50:41 UTC

how to read hadoop source code efficiently

hi, i am reading hadoop-0.23 source code, mainly focusing on hadoop yarn.
However i have some problems in reading the source code.
There is no Debugging tools for hadoop, so i can't track the code execution
flow. Therefore i can't understand the code quickly since there are lots of
overwirte,
interface and inheritance. So can anyone give some good suggestions or
share your method? I am really appreciate it. Thankyou



-- 
陈竞,中科院计算技术研究所,高性能计算机中心
Jing Chen HPCC.ICT.AC China

Re: how to read hadoop source code efficiently

Posted by Praveen Sripati <pr...@gmail.com>.
Harsh,

Are you mentioning about the 0.23 or pre-0.23 release? The OP was about
0.23 release. Were you able to start some daemons in Eclipse and submit a
job?

Some time back I posted a query [1] about setting 0.23 in Eclipse and the
response was that no one might have tried it. I gave it up after trying it
for sometime.

Could you post some quick instructions for 0.23 and pre-0.23 release? The
Apache documentations stops at just importing the projects into Eclipse.

Anyway, I will give it another shot.

[1] - http://goo.gl/I0eKz

Regards,
Praveen

2011/12/8 Harsh J <ha...@cloudera.com>

> You can run daemons from within Eclipse in debugging mode -- you only need
> to launch the right main class (NameNode, DataNode, etc. for example). This
> is a feature of Eclipse. But distributed programming is best debugged with
> proper logging, if you can't afford running all the daemons and the clients
> from within Eclipse itself - in debug run configurations.
>
> On 08-Dec-2011, at 11:55 AM, 陈竞 wrote:
>
> > my problem is that there are many definitions of one function, i can't
> get
> > which function it really use even in eclipse , since there are many
> > overwrite, so i want to track it. is there some tools like gdb in java
> for
> > runing hadoop?
> >
> > 在 2011年12月8日 下午1:59,wang xin <wa...@gmail.com>写道:
> >
> >> Hi,Jing,
> >>       you can run "ant eclipse-files" at command line.And then you can
> >> import it to your eclipse.
> >> I think you can read the code from JobTracker and TaskTracker .you can
> >> find the main() function in these class.
> >>
> >> 在 2011-12-8,下午1:50, 陈竞 写道:
> >>
> >>> hi, i am reading hadoop-0.23 source code, mainly focusing on hadoop
> yarn.
> >>> However i have some problems in reading the source code.
> >>> There is no Debugging tools for hadoop, so i can't track the code
> >> execution
> >>> flow. Therefore i can't understand the code quickly since there are
> lots
> >> of
> >>> overwirte,
> >>> interface and inheritance. So can anyone give some good suggestions or
> >>> share your method? I am really appreciate it. Thankyou
> >>>
> >>>
> >>>
> >>> --
> >>> 陈竞,中科院计算技术研究所,高性能计算机中心
> >>> Jing Chen HPCC.ICT.AC China
> >>
> >>
> >
> >
> > --
> > 陈竞,中科院计算技术研究所,高性能计算机中心
> > Jing Chen HPCC.ICT.AC China
>
>

Re: how to read hadoop source code efficiently

Posted by Harsh J <ha...@cloudera.com>.
You can run daemons from within Eclipse in debugging mode -- you only need to launch the right main class (NameNode, DataNode, etc. for example). This is a feature of Eclipse. But distributed programming is best debugged with proper logging, if you can't afford running all the daemons and the clients from within Eclipse itself - in debug run configurations.

On 08-Dec-2011, at 11:55 AM, 陈竞 wrote:

> my problem is that there are many definitions of one function, i can't get
> which function it really use even in eclipse , since there are many
> overwrite, so i want to track it. is there some tools like gdb in java for
> runing hadoop?
> 
> 在 2011年12月8日 下午1:59,wang xin <wa...@gmail.com>写道:
> 
>> Hi,Jing,
>>       you can run "ant eclipse-files" at command line.And then you can
>> import it to your eclipse.
>> I think you can read the code from JobTracker and TaskTracker .you can
>> find the main() function in these class.
>> 
>> 在 2011-12-8,下午1:50, 陈竞 写道:
>> 
>>> hi, i am reading hadoop-0.23 source code, mainly focusing on hadoop yarn.
>>> However i have some problems in reading the source code.
>>> There is no Debugging tools for hadoop, so i can't track the code
>> execution
>>> flow. Therefore i can't understand the code quickly since there are lots
>> of
>>> overwirte,
>>> interface and inheritance. So can anyone give some good suggestions or
>>> share your method? I am really appreciate it. Thankyou
>>> 
>>> 
>>> 
>>> --
>>> 陈竞,中科院计算技术研究所,高性能计算机中心
>>> Jing Chen HPCC.ICT.AC China
>> 
>> 
> 
> 
> -- 
> 陈竞,中科院计算技术研究所,高性能计算机中心
> Jing Chen HPCC.ICT.AC China


Re: how to read hadoop source code efficiently

Posted by 陈竞 <cj...@gmail.com>.
my problem is that there are many definitions of one function, i can't get
which function it really use even in eclipse , since there are many
overwrite, so i want to track it. is there some tools like gdb in java for
runing hadoop?

在 2011年12月8日 下午1:59,wang xin <wa...@gmail.com>写道:

> Hi,Jing,
>        you can run "ant eclipse-files" at command line.And then you can
> import it to your eclipse.
> I think you can read the code from JobTracker and TaskTracker .you can
> find the main() function in these class.
>
> 在 2011-12-8,下午1:50, 陈竞 写道:
>
> > hi, i am reading hadoop-0.23 source code, mainly focusing on hadoop yarn.
> > However i have some problems in reading the source code.
> > There is no Debugging tools for hadoop, so i can't track the code
> execution
> > flow. Therefore i can't understand the code quickly since there are lots
> of
> > overwirte,
> > interface and inheritance. So can anyone give some good suggestions or
> > share your method? I am really appreciate it. Thankyou
> >
> >
> >
> > --
> > 陈竞,中科院计算技术研究所,高性能计算机中心
> > Jing Chen HPCC.ICT.AC China
>
>


-- 
陈竞,中科院计算技术研究所,高性能计算机中心
Jing Chen HPCC.ICT.AC China

Re: how to read hadoop source code efficiently

Posted by wang xin <wa...@gmail.com>.
Hi,Jing,
	you can run "ant eclipse-files" at command line.And then you can import it to your eclipse.
I think you can read the code from JobTracker and TaskTracker .you can find the main() function in these class.

在 2011-12-8,下午1:50, 陈竞 写道:

> hi, i am reading hadoop-0.23 source code, mainly focusing on hadoop yarn.
> However i have some problems in reading the source code.
> There is no Debugging tools for hadoop, so i can't track the code execution
> flow. Therefore i can't understand the code quickly since there are lots of
> overwirte,
> interface and inheritance. So can anyone give some good suggestions or
> share your method? I am really appreciate it. Thankyou
> 
> 
> 
> -- 
> 陈竞,中科院计算技术研究所,高性能计算机中心
> Jing Chen HPCC.ICT.AC China