hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Minor, Eric (NE)" <eric.mi...@classmates.com>
Subject Possibly unnecessary check in Result.getColumnLatest(byte[] family, byte[] qualifier)
Date Thu, 11 Dec 2014 21:20:02 GMT

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).
Eric Minor
On-site at Classmates.com
Software Consultant

333 Elliott Ave. West, Suite 500
Seattle, WA 98119
253.970.3724 mobile

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message