You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Shaun Elliott <ja...@gmail.com> on 2014/09/19 01:21:54 UTC

view decoded thrift in hbase shell?

I have a column which has thrift encoded data and would like to view it in
hbase shell.

I have this so far:

public class ThriftToString {
    private static final TDeserializer tDeSerializer = new TDeserializer(new
TCompactProtocol.Factory());

    public static String getStringFromThrift(byte[] value) {
            InventoryRecord inventoryRecord = new InventoryRecord();
            try {
                tDeSerializer.deserialize(inventoryRecord, value);
                return inventoryRecord.toString();
            } catch (TException e) {

            }        
        return null;
    }
}

I've figured out that I can then jar this up and add it to my
HBASE_CLASSPATH, which lets me import it in to jruby. But... how do I use it
in a get or a scan? I'm stuck. This seems like it should be relatively easy.



--
View this message in context: http://apache-hbase.679495.n3.nabble.com/view-decoded-thrift-in-hbase-shell-tp4064130.html
Sent from the HBase User mailing list archive at Nabble.com.