You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by Lukas Vlcek <lu...@gmail.com> on 2008/07/09 00:11:57 UTC

Job API question - ArrayList instead of List?

Hi,

Why the Job API is using ArrayList instead of List?

It is used in constructor:
public Job(JobConf jobConf, ArrayList<Job> dependingJobs)

and one public method:
public ArrayList<Job> getDependingJobs()

Is there any reason why it is referencing to implementation while it could
be replaced by interface?

Regards,
Lukas

-- 
http://blog.lukas-vlcek.com/

Re: Job API question - ArrayList instead of List?

Posted by Lukas Vlcek <lu...@gmail.com>.
Hi,

Thanks all for clarification. Now I understand there is a reason why the
things are the way they are.

May be it would be helpful if you add a small comment into Job API that it
will change in the future. Not only it would be useful hint for all
developers (so that they are aware of future API changes [*]) but it could
reduce dev mail list trafic because Hadoop-greenhorns like me will not raise
obvious questions. :-)

Regards,
Lukas

[*] - OK, I know, Hadoop is still in pre 1.0 API stage so changes don't have
to be announced in this case.

On Wed, Jul 9, 2008 at 9:11 PM, Tom White <to...@gmail.com> wrote:

> I opened https://issues.apache.org/jira/browse/HADOOP-3219 for this
> (I've just linked it to HADOOP-2268). I agree it would be nice to fix
> this. Perhaps at the same time as HADOOP-1230, so we make incompatible
> changes in one go?
>
> Tom
>
> On Wed, Jul 9, 2008 at 6:41 PM, Arun C Murthy <ac...@yahoo-inc.com> wrote:
> >
> > On Jul 9, 2008, at 12:30 AM, Lukas Vlcek wrote:
> >
> >> Hi,
> >>
> >> The patch for this should be pretty easy, but does it mean that you
> >> decided
> >> not to change the API in order to keep it compatible?
> >
> > Unfortunately, yes - we had to.
> >
> >> I like Doug's idea about depreciation of original methods (those
> exposing
> >> ArrayList into public API) and introducing equivalent methods with List
> >> interface.
> >>
> >
> > I think the deal fell through when we couldn't come up with agreeable
> > alteratives for get/set methods... *smile*
> >
> > Arun
> >
> >> Regards,
> >> Lukas
> >>
> >> On Wed, Jul 9, 2008 at 9:08 AM, Arun C Murthy <ac...@yahoo-inc.com>
> wrote:
> >>
> >>>
> >>> On Jul 8, 2008, at 3:11 PM, Lukas Vlcek wrote:
> >>>
> >>>  Hi,
> >>>>
> >>>> Why the Job API is using ArrayList instead of List?
> >>>>
> >>>> It is used in constructor:
> >>>> public Job(JobConf jobConf, ArrayList<Job> dependingJobs)
> >>>>
> >>>> and one public method:
> >>>> public ArrayList<Job> getDependingJobs()
> >>>>
> >>>> Is there any reason why it is referencing to implementation while it
> >>>> could
> >>>> be replaced by interface?
> >>>>
> >>>>
> >>> Originally an oversight, we did file
> >>> http://issues.apache.org/jira/browse/HADOOP-2268
> >>> but didn't change it to keep it compatible...
> >>>
> >>> Arun
> >>>
> >>
> >>
> >>
> >> --
> >> http://blog.lukas-vlcek.com/
> >
> >
>



-- 
http://blog.lukas-vlcek.com/

Re: Job API question - ArrayList instead of List?

Posted by Tom White <to...@gmail.com>.
I opened https://issues.apache.org/jira/browse/HADOOP-3219 for this
(I've just linked it to HADOOP-2268). I agree it would be nice to fix
this. Perhaps at the same time as HADOOP-1230, so we make incompatible
changes in one go?

Tom

On Wed, Jul 9, 2008 at 6:41 PM, Arun C Murthy <ac...@yahoo-inc.com> wrote:
>
> On Jul 9, 2008, at 12:30 AM, Lukas Vlcek wrote:
>
>> Hi,
>>
>> The patch for this should be pretty easy, but does it mean that you
>> decided
>> not to change the API in order to keep it compatible?
>
> Unfortunately, yes - we had to.
>
>> I like Doug's idea about depreciation of original methods (those exposing
>> ArrayList into public API) and introducing equivalent methods with List
>> interface.
>>
>
> I think the deal fell through when we couldn't come up with agreeable
> alteratives for get/set methods... *smile*
>
> Arun
>
>> Regards,
>> Lukas
>>
>> On Wed, Jul 9, 2008 at 9:08 AM, Arun C Murthy <ac...@yahoo-inc.com> wrote:
>>
>>>
>>> On Jul 8, 2008, at 3:11 PM, Lukas Vlcek wrote:
>>>
>>>  Hi,
>>>>
>>>> Why the Job API is using ArrayList instead of List?
>>>>
>>>> It is used in constructor:
>>>> public Job(JobConf jobConf, ArrayList<Job> dependingJobs)
>>>>
>>>> and one public method:
>>>> public ArrayList<Job> getDependingJobs()
>>>>
>>>> Is there any reason why it is referencing to implementation while it
>>>> could
>>>> be replaced by interface?
>>>>
>>>>
>>> Originally an oversight, we did file
>>> http://issues.apache.org/jira/browse/HADOOP-2268
>>> but didn't change it to keep it compatible...
>>>
>>> Arun
>>>
>>
>>
>>
>> --
>> http://blog.lukas-vlcek.com/
>
>

Re: Job API question - ArrayList instead of List?

Posted by Arun C Murthy <ac...@yahoo-inc.com>.
On Jul 9, 2008, at 12:30 AM, Lukas Vlcek wrote:

> Hi,
>
> The patch for this should be pretty easy, but does it mean that you  
> decided
> not to change the API in order to keep it compatible?

Unfortunately, yes - we had to.

> I like Doug's idea about depreciation of original methods (those  
> exposing
> ArrayList into public API) and introducing equivalent methods with  
> List
> interface.
>

I think the deal fell through when we couldn't come up with agreeable  
alteratives for get/set methods... *smile*

Arun

> Regards,
> Lukas
>
> On Wed, Jul 9, 2008 at 9:08 AM, Arun C Murthy <ac...@yahoo-inc.com>  
> wrote:
>
>>
>> On Jul 8, 2008, at 3:11 PM, Lukas Vlcek wrote:
>>
>>  Hi,
>>>
>>> Why the Job API is using ArrayList instead of List?
>>>
>>> It is used in constructor:
>>> public Job(JobConf jobConf, ArrayList<Job> dependingJobs)
>>>
>>> and one public method:
>>> public ArrayList<Job> getDependingJobs()
>>>
>>> Is there any reason why it is referencing to implementation while  
>>> it could
>>> be replaced by interface?
>>>
>>>
>> Originally an oversight, we did file http://issues.apache.org/jira/ 
>> browse/HADOOP-2268
>> but didn't change it to keep it compatible...
>>
>> Arun
>>
>
>
>
> -- 
> http://blog.lukas-vlcek.com/


Re: Job API question - ArrayList instead of List?

Posted by Lukas Vlcek <lu...@gmail.com>.
Hi,

The patch for this should be pretty easy, but does it mean that you decided
not to change the API in order to keep it compatible?
I like Doug's idea about depreciation of original methods (those exposing
ArrayList into public API) and introducing equivalent methods with List
interface.

Regards,
Lukas

On Wed, Jul 9, 2008 at 9:08 AM, Arun C Murthy <ac...@yahoo-inc.com> wrote:

>
> On Jul 8, 2008, at 3:11 PM, Lukas Vlcek wrote:
>
>  Hi,
>>
>> Why the Job API is using ArrayList instead of List?
>>
>> It is used in constructor:
>> public Job(JobConf jobConf, ArrayList<Job> dependingJobs)
>>
>> and one public method:
>> public ArrayList<Job> getDependingJobs()
>>
>> Is there any reason why it is referencing to implementation while it could
>> be replaced by interface?
>>
>>
> Originally an oversight, we did file http://issues.apache.org/jira/browse/HADOOP-2268
> but didn't change it to keep it compatible...
>
> Arun
>



-- 
http://blog.lukas-vlcek.com/

Re: Job API question - ArrayList instead of List?

Posted by Arun C Murthy <ac...@yahoo-inc.com>.
On Jul 8, 2008, at 3:11 PM, Lukas Vlcek wrote:

> Hi,
>
> Why the Job API is using ArrayList instead of List?
>
> It is used in constructor:
> public Job(JobConf jobConf, ArrayList<Job> dependingJobs)
>
> and one public method:
> public ArrayList<Job> getDependingJobs()
>
> Is there any reason why it is referencing to implementation while  
> it could
> be replaced by interface?
>

Originally an oversight, we did file http://issues.apache.org/jira/ 
browse/HADOOP-2268 but didn't change it to keep it compatible...

Arun

Re: Job API question - ArrayList instead of List?

Posted by Ted Dunning <te...@gmail.com>.
It should specify an interface.

On Tue, Jul 8, 2008 at 3:11 PM, Lukas Vlcek <lu...@gmail.com> wrote:

> Hi,
>
> Why the Job API is using ArrayList instead of List?
>
> It is used in constructor:
> public Job(JobConf jobConf, ArrayList<Job> dependingJobs)
>
> and one public method:
> public ArrayList<Job> getDependingJobs()
>
> Is there any reason why it is referencing to implementation while it could
> be replaced by interface?
>
> Regards,
> Lukas
>
> --
> http://blog.lukas-vlcek.com/
>



-- 
ted