BytesWritable does not have a setter method for the byte[]

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

BytesWritable does not have a setter method for the byte[]

Andreas Juffinger

Why is there no set(byte[]) method in the BytesWritable class? As far as I
know each of the other Writeable classes do have a set method - is there a
deeper reason why the set method is not there ?

Andreas
Reply | Threaded
Open this post in threaded view
|

Re: BytesWritable does not have a setter method for the byte[]

Owen O'Malley-5

On Feb 5, 2007, at 11:44 PM, Andreas Juffinger wrote:

>
> Why is there no set(byte[]) method in the BytesWritable class? As  
> far as I
> know each of the other Writeable classes do have a set method - is  
> there a
> deeper reason why the set method is not there ?

*Laugh* I have such a method in a patch I'm working on. I went ahead  
and uploaded what I had as a patch in HADOOP-982.

-- Owen
Reply | Threaded
Open this post in threaded view
|

Re: BytesWritable does not have a setter method for the byte[]

Milind Bhandarkar
I have written a Buffer class in Hadoop record I/O. Buffer resembles  
BytesWritable. I have added a few methods to it that make it better  
(IMHO). They are set(byte[]), append(byte[], offset, length), append
(byte[]), and truncate(). In future BytesWritable could be generated  
by the record I/O translator from this DDL:

class BytesWritable {
   Buffer value;
}

- Milind

On Feb 6, 2007, at 12:39 AM, Owen O'Malley wrote:

>
> On Feb 5, 2007, at 11:44 PM, Andreas Juffinger wrote:
>
>>
>> Why is there no set(byte[]) method in the BytesWritable class? As  
>> far as I
>> know each of the other Writeable classes do have a set method - is  
>> there a
>> deeper reason why the set method is not there ?
>
> *Laugh* I have such a method in a patch I'm working on. I went  
> ahead and uploaded what I had as a patch in HADOOP-982.
>
> -- Owen
>
>

--
Milind Bhandarkar
(mailto:[hidden email])
(phone: 408-349-2136 W)