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 Michael Segel <mi...@hotmail.com> on 2010/05/04 16:50:54 UTC

Need a Jira?

Hi,

Came across something "ugly".

I'm using the latest Hadoop version in Cloudera's CH2 :Hadoop 0.20.1+169.68
(At least I think its the latest version in CH2)

Noticed that when I instantiate a JobClient() passing in a Configuration object, I have to cast it to the deprecated class (JobConf).

Is this something that should be updated, or is this fixed in the next Cloudera (CH3) release?

Thx

-Mike


 		 	   		  
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1

RE: Need a Jira?

Posted by Michael Segel <mi...@hotmail.com>.


> Date: Tue, 4 May 2010 11:03:48 -0400
> Subject: Re: Need a Jira?
> From: esammer@cloudera.com
> To: common-user@hadoop.apache.org

> The reason / problem here is because JobClient is from the old (0.18)
> API and thus has no understanding of Configuration. You can initialize
> a JobConf from a Configuration rather than casting it which avoids the
> cast.
> 
> JobConf conf = new JobConf(new Configuration())
> 
> This isn't a bug as much as it is confusion between the new and old
> APIs. As the new APIs become more feature complete (probably at or
> around 0.21) the recommendation will be to prefer those. There has
> been discussion around un-deprecating the old APIs.

Well that's why I asked about creating a Jira.
Here's the code ...
jc = new JobClient(new JobConf(conf) ); 

conf is actually an instance of Configuration which is what we are *supposed* to use. ;-)


Of course JobConf has an ugly 'strikeout' through it. And that's what I meant by "ugly". 

I wonder if there's a better interface to JobTracker than JobClient planned? (Not that I'm complaining. It does what I need...)

I would hope that JobClient gets refactored to know about Configuration.. :-)

Thx

-Mike

 		 	   		  
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2

Re: Need a Jira?

Posted by Eric Sammer <es...@cloudera.com>.
On Tue, May 4, 2010 at 10:50 AM, Michael Segel
<mi...@hotmail.com> wrote:
>
> Hi,
>
> Came across something "ugly".
>
> I'm using the latest Hadoop version in Cloudera's CH2 :Hadoop 0.20.1+169.68
> (At least I think its the latest version in CH2)
>
> Noticed that when I instantiate a JobClient() passing in a Configuration object, I have to cast it to the deprecated class (JobConf).
>
> Is this something that should be updated, or is this fixed in the next Cloudera (CH3) release?

The reason / problem here is because JobClient is from the old (0.18)
API and thus has no understanding of Configuration. You can initialize
a JobConf from a Configuration rather than casting it which avoids the
cast.

JobConf conf = new JobConf(new Configuration())

This isn't a bug as much as it is confusion between the new and old
APIs. As the new APIs become more feature complete (probably at or
around 0.21) the recommendation will be to prefer those. There has
been discussion around un-deprecating the old APIs.
-- 
Eric Sammer
phone: +1-917-287-2675
twitter: esammer
data: www.cloudera.com

Re: Need a Jira?

Posted by Todd Lipcon <to...@cloudera.com>.
On Tue, May 4, 2010 at 7:50 AM, Michael Segel <mi...@hotmail.com>wrote:

>
> Hi,
>
> Came across something "ugly".
>
> I'm using the latest Hadoop version in Cloudera's CH2 :Hadoop 0.20.1+169.68
> (At least I think its the latest version in CH2)
>
> Noticed that when I instantiate a JobClient() passing in a Configuration
> object, I have to cast it to the deprecated class (JobConf).
>
> Is this something that should be updated, or is this fixed in the next
> Cloudera (CH3) release?
>

The "new API" (ie those job-related classes that aren't deprecated) is
somewhat uncomplete in Hadoop 0.20 - this includes both the Cloudera
releases and the Apache releases. JobClient is part of the "old API" and
thus relies on the deprecated JobConf class.

I assume by "cast" you mean construct, right? You can't safely downcast a
Configuration to JobConf since the latter is a subclass of the former.

There has been talk (and I think the vote passed) of undeprecating the old
API in 0.20 for reasons like this.

-Todd

-- 
Todd Lipcon
Software Engineer, Cloudera