Wednesday, February 12, 2014

Thrift Notes on Default values

I have been using Apache Thrift at production for close to 2 years now and something that we did not know for a long time was how to assign default values to thrift's collection types like map, list, set.

It so seems that Thrift IDL default value assignments can be JSON style values.



Saturday, January 4, 2014

VendorID for Karbonn Mobiles

Karbonn A27+ has the following (for connecting Android Mobile in Ubuntu systems)  rules file defined on /etc/udev/rules.d/51-android.rules

SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="ashwanth"

For some unknown reason, when connected lsusb gives "High Tech Computer Corp."

PS: This is a self note. 

First Take at Android with Processing + Ketai

I have been using Android and iOS equally for more than 4 years now. It took me this long to actually start android development. I spent last 2 days with Processing and their Android Mode, along with Ketai Library.

I had a glance through the "Rapid Android Development" book, and started using Ketai library. I wanted to add a button and display a hello world which I was not able to do so. Realized Ketai though a wonderful library, was still missing some essential pieces which was required for actually developing apps through Processing for Android.

I sat down and started hacking on the Ketai code + Android SDK and was finally able to write couple of classes, to add Button + Custom View / Layout support. I know this is not a lot, but certainly enough to keep me motivated on continuing my adventure with Processing + Android. 

Thursday, March 14, 2013

HRegionInfo was null or empty in .META.

I was bulking importing data into HBase today, and stumbled upon the error (error.log)


I wrote the MetaInfo.rb, and got the syslog on the console along with rest of the region names. I had to delete all those entires by hand from '.META.' and it was all fine. 

Monday, March 11, 2013

HFileInputFormat for Bulk repair of HBase

Today something interesting happened to our HBase cluster, of around 1600 regions we currently hold some odd 400+ regions got their STARTKEY as '' (Empty Start Keys). We tired to do an Offline Meta Repair, but that kept failing saying "Multiple regions have the same startkey:".

Quick (Dirty) Fix
  1. Move those regions out of the /hbase/
  2. Now run offline meta repair on the existing data (this is optional, as in our case if your .META. table is screwed you might need to run this, else you might need to find and remove the entries out of .META. manually. I did not try this so, I am not going to dwell on this further) 
Now, write a simple MR job to process all those regions on a CF basis (per-CF) to export them as SequenceFiles and import them back again using the regular HBase Import (org.apache.hadoop.hbase.mapreduce.Import).

When writing the MR job, one thing you might need which is not available of the shelf is the HFileInputFormat. I found a scala version of it, which I ported to Java.


Also, I made some changes to the scala version to be usable on HBase 0.94.2 (tested version)


DISCLAIMER: The above solution was tested with HBase 0.94.2 and Hadoop 1.1.1 setup.