You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@hadoop.apache.org by Bo Sang <sa...@gmail.com> on 2011/03/22 17:19:12 UTC

How to insert some print codes into Hadoop?

Hi, guys:

I would like to do some minor modification of Hadoop (just to insert some
print codes into particular places). And I have the following questions:

1. It seems there are three parts of Hadoop: common, hdfs, mapred. And they
are packed as three independent jar packages. Could I only modify one part
(eg, common) and pack a new jar package without modifying the rest two.

2. I have try to import the folder hadoop-0.21.0/common into eclipse as a
project. But eclipse fails to recognize it as an existing project. But if I
import folder hadoop-0.21.0 as a existing project, it works. However, I only
want to modify common part. How could I only modify  common part and export
a new common jar package without modifying the rest two parts.

-- 
Best Regards!

Sincerely
Bo Sang

Re: How to insert some print codes into Hadoop?

Posted by Stephen Boesch <ja...@gmail.com>.
keep in mind for going that direction that aspectJ has limited support in
some IDE's (e.g. intellij). can complicate the development.

2011/3/23 Konstantin Boudnik <co...@apache.org>

> [Moving to common-user@, Bcc'ing general@]
>
> If you know where you need to have your print statements you can use
> AspectJ to do runtime injection of needed java code into desirable
> spots. You don't need to even touch the source code for that - just
> instrument (weave) the jar file
> --
>   Take care,
> Konstantin (Cos) Boudnik
>
> On Tue, Mar 22, 2011 at 09:19, Bo Sang <sa...@gmail.com> wrote:
> > Hi, guys:
> >
> > I would like to do some minor modification of Hadoop (just to insert some
> > print codes into particular places). And I have the following questions:
> >
> > 1. It seems there are three parts of Hadoop: common, hdfs, mapred. And
> they
> > are packed as three independent jar packages. Could I only modify one
> part
> > (eg, common) and pack a new jar package without modifying the rest two.
> >
> > 2. I have try to import the folder hadoop-0.21.0/common into eclipse as a
> > project. But eclipse fails to recognize it as an existing project. But if
> I
> > import folder hadoop-0.21.0 as a existing project, it works. However, I
> only
> > want to modify common part. How could I only modify  common part and
> export
> > a new common jar package without modifying the rest two parts.
> >
> > --
> > Best Regards!
> >
> > Sincerely
> > Bo Sang
> >
>

Re: How to insert some print codes into Hadoop?

Posted by Bo Sang <sa...@gmail.com>.
Thanks very much for your reply. But if I would like to modify Hadoop source
code, how could I achieve this goal?

On Wed, Mar 23, 2011 at 1:40 PM, Konstantin Boudnik <co...@apache.org> wrote:

> [Moving to common-user@, Bcc'ing general@]
>
> If you know where you need to have your print statements you can use
> AspectJ to do runtime injection of needed java code into desirable
> spots. You don't need to even touch the source code for that - just
> instrument (weave) the jar file
> --
>   Take care,
> Konstantin (Cos) Boudnik
>
> On Tue, Mar 22, 2011 at 09:19, Bo Sang <sa...@gmail.com> wrote:
> > Hi, guys:
> >
> > I would like to do some minor modification of Hadoop (just to insert some
> > print codes into particular places). And I have the following questions:
> >
> > 1. It seems there are three parts of Hadoop: common, hdfs, mapred. And
> they
> > are packed as three independent jar packages. Could I only modify one
> part
> > (eg, common) and pack a new jar package without modifying the rest two.
> >
> > 2. I have try to import the folder hadoop-0.21.0/common into eclipse as a
> > project. But eclipse fails to recognize it as an existing project. But if
> I
> > import folder hadoop-0.21.0 as a existing project, it works. However, I
> only
> > want to modify common part. How could I only modify  common part and
> export
> > a new common jar package without modifying the rest two parts.
> >
> > --
> > Best Regards!
> >
> > Sincerely
> > Bo Sang
> >
>



-- 
Best Regards!

Sincerely
Bo Sang

Re: How to insert some print codes into Hadoop?

Posted by Konstantin Boudnik <co...@apache.org>.
[Moving to common-user@, Bcc'ing general@]

If you know where you need to have your print statements you can use
AspectJ to do runtime injection of needed java code into desirable
spots. You don't need to even touch the source code for that - just
instrument (weave) the jar file
--
  Take care,
Konstantin (Cos) Boudnik

On Tue, Mar 22, 2011 at 09:19, Bo Sang <sa...@gmail.com> wrote:
> Hi, guys:
>
> I would like to do some minor modification of Hadoop (just to insert some
> print codes into particular places). And I have the following questions:
>
> 1. It seems there are three parts of Hadoop: common, hdfs, mapred. And they
> are packed as three independent jar packages. Could I only modify one part
> (eg, common) and pack a new jar package without modifying the rest two.
>
> 2. I have try to import the folder hadoop-0.21.0/common into eclipse as a
> project. But eclipse fails to recognize it as an existing project. But if I
> import folder hadoop-0.21.0 as a existing project, it works. However, I only
> want to modify common part. How could I only modify  common part and export
> a new common jar package without modifying the rest two parts.
>
> --
> Best Regards!
>
> Sincerely
> Bo Sang
>

Re: How to insert some print codes into Hadoop?

Posted by Konstantin Boudnik <co...@apache.org>.
[Moving to common-user@, Bcc'ing general@]

If you know where you need to have your print statements you can use
AspectJ to do runtime injection of needed java code into desirable
spots. You don't need to even touch the source code for that - just
instrument (weave) the jar file
--
  Take care,
Konstantin (Cos) Boudnik

On Tue, Mar 22, 2011 at 09:19, Bo Sang <sa...@gmail.com> wrote:
> Hi, guys:
>
> I would like to do some minor modification of Hadoop (just to insert some
> print codes into particular places). And I have the following questions:
>
> 1. It seems there are three parts of Hadoop: common, hdfs, mapred. And they
> are packed as three independent jar packages. Could I only modify one part
> (eg, common) and pack a new jar package without modifying the rest two.
>
> 2. I have try to import the folder hadoop-0.21.0/common into eclipse as a
> project. But eclipse fails to recognize it as an existing project. But if I
> import folder hadoop-0.21.0 as a existing project, it works. However, I only
> want to modify common part. How could I only modify  common part and export
> a new common jar package without modifying the rest two parts.
>
> --
> Best Regards!
>
> Sincerely
> Bo Sang
>