Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Many users of HBase (including ourselves) use different, more efficient encoding of values into byte arrays than converting them to String's first, then byte arrays. For example, it's common to use protobuf to encode an object into a byte array for storage in HBase.

Rather than have 2 copies of all the api methods (one for people storing just Strings, and one for arbitrary byte arrays), it's simpler to have a single call and let the caller use the Bytes.toBytes method if they want to store a String.



It looks like HBase developers were working hard to design the most verbose API possible ;)


That makes sense for the values, but the names of rows and columns are also passed as bytes. Wouldn't a convenience function that accepts strings, performs the Bytes.toBytes() conversion and calls the original method reduce code clutter?


The same thing applies to rows and columns. We don't use any simple strings for our row or column indexes. They are serialized objects.

Earlier versions of the API actually did have String based versions, and were changed to just byte arrays to reduce clutter.


Interesting, that makes sense then.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: