Thanks for clarification, Lars and Ram.
As per Lars comment it seems like this change is meant for long term
strategy where a Row is not backed by a single Byte[].
At present that's the not the case. Hence, i felt that it was less
intuitive.
In long term the new API would make more sense when calling
cell.getFamilyarray() would only provide byte[] from Family.

Thanks,
Anil Gupta


On Mon, Aug 4, 2014 at 11:53 PM, lars hofhansl <la...@apache.org> wrote:

> Hi Anil,
>
> the point of getFamilyArray() is that it may return the entire buffer, but
> it does not *have* to.
> Everybody should use the new API, so that we can eventually have KeyValues
> (Cells) that do not have be backed by a single byte[].
> (i.e. we can have KeyValues backed by separate row, family, column, value
> arrays)
>
>
> -- Lars
>
>
>
> ________________________________
>  From: anil gupta <anilgupt...@gmail.com>
> To: "user@hbase.apache.org" <user@hbase.apache.org>
> Sent: Monday, August 4, 2014 9:56 PM
> Subject: Re: What is replacement of kv.getBuffer() in HBase0.98?
>
>
> Hi Ted,
>
> This will return entire backing bytes array just like keyValue.getBuffer()?
> By the documentation i thought its returning some file name :
> byte[] *getFamilyArray
> <
> https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/Cell.html#getFamilyArray%28%29
> >*
> ()
> Contiguous bytes composed of legal HDFS filename characters which may start
> at any index in the containing array.
>
> IMHO, this method name is not as intuitive as "getBuffer".
>
> Thanks,
> Anil
>
>
>
> On Mon, Aug 4, 2014 at 9:32 PM, Ted Yu <yuzhih...@gmail.com> wrote:
>
> > Take a look at this method in Cell:
> >
> >   byte[] getFamilyArray();
> >
> > Cheers
> >
> >
> > On Mon, Aug 4, 2014 at 9:26 PM, anil gupta <anilgupt...@gmail.com>
> wrote:
> >
> > > I have been using KeyValues.getBuffer() very heavily in my HBase0.94
> > code.
> > > This method is not present in 0.98. What is the equivalent of
> > > KeyValues.getBuffer() in Cell?
> > > I am trying to avoid doing ArrayCopy of CF just for doing comparison.
> > >
> > > What would be equivalent for this code in 0.98?
> > > Bytes.equals(columnFamily, 0, columnFamily.length,
> keyvalue.getBuffer(),
> > > keyvalue.getFamilyOffset(),
> > >                                 keyvalue.getFamilyLength())))
> > >
> > > Maybe this?
> > > Bytes.equals(columnFamily, 0, columnFamily.length, cell.getBuffer(),
> > > cell.getFamilyOffset(),
> > >                                 cell.getFamilyLength())))
> > >
> > > --
> > > Thanks & Regards,
> > > Anil Gupta
>
>
>
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Anil Gupta
>



-- 
Thanks & Regards,
Anil Gupta

Reply via email to