You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by "Minor, Eric (NE)" <er...@classmates.com> on 2014/12/11 22:20:02 UTC
Possibly unnecessary check in Result.getColumnLatest(byte[] family,
byte[] qualifier)
Anil,
I agree with you that the check you refer to is problematic. In fact, it seems to be a cover for faulty behavior from the binarySearch() method which baffled me for about 6 hours last night. In short, when testing my mapper in MrUnit, the binarySearch() method does not return the proper index in most cases. The same mapper works fine on the actual cluster. It almost seems like someone put that secondary check in there because they didn't trust the output of the binarySearch() method. I would suppose they saw it operating in a faulty manner and decided it would be better to return null than to return the wrong KV.
It is bad code.
I have kludged up my code to overcome it by re-implementing getValue(), getColumnLatest(), and binarySearch() (as a simple linear search, not caring about performance in my unit test).
_________________
Dev9
Eric Minor
On-site at Classmates.com
Software Consultant
CLASSMATES
333 Elliott Ave. West, Suite 500
Seattle, WA 98119
253.970.3724 mobile
Re: Possibly unnecessary check in Result.getColumnLatest(byte[]
family, byte[] qualifier)
Posted by Stack <st...@duboce.net>.
Hello Eric:
Do you have some sample data that has the binarySearch go off the rails so
we can try and figure how it is broke?
Thanks,
St.Ack
On Thu, Dec 11, 2014 at 1:20 PM, Minor, Eric (NE) <eric.minor@classmates.com
> wrote:
> Anil,
>
> I agree with you that the check you refer to is problematic. In fact, it
> seems to be a cover for faulty behavior from the binarySearch() method
> which baffled me for about 6 hours last night. In short, when testing my
> mapper in MrUnit, the binarySearch() method does not return the proper
> index in most cases. The same mapper works fine on the actual cluster. It
> almost seems like someone put that secondary check in there because they
> didn't trust the output of the binarySearch() method. I would suppose they
> saw it operating in a faulty manner and decided it would be better to
> return null than to return the wrong KV.
>
> It is bad code.
>
> I have kludged up my code to overcome it by re-implementing getValue(),
> getColumnLatest(), and binarySearch() (as a simple linear search, not
> caring about performance in my unit test).
> _________________
> Dev9
> Eric Minor
> On-site at Classmates.com
> Software Consultant
>
> CLASSMATES
> 333 Elliott Ave. West, Suite 500
> Seattle, WA 98119
> 253.970.3724 mobile
>
>