'Obtain HBase rowkey/ index size in bytes

According to this post, and the Google BigTable reference here, I reckon that the maximum size of the rowkey is 4 kilobyte. Nevertheless, my question is, is there a way to obtain the rowkey size, either programmatically or through HBase shell? For example, suppose I have the following two row-keys (i) 'machine001' and (ii) 'imgID1'. How can I obtain the bytes that is used to store these rowkeys?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source