I mentioned the method accepting int because of the example in your first email. I verified in Eclipse that Bytes.toBytes(982222) would end up in that method.
I understand in your application data is typed as long. However that is not shown in your previous example. On Sat, Feb 17, 2018 at 9:00 PM, Ted Yu <yuzhih...@gmail.com> wrote: > It seems there are 3 components in the row key. > Assuming the 2nd and 3rd are integers, you can take a look at the > following method of Bytes: > > public static byte[] toBytes(int val) { > > which returns 4 byte long byte array. > You can use this knowledge to decode each component of the row key. > > FYI > > On Sat, Feb 17, 2018 at 8:44 PM, kitex101 <sugandha.ama...@gmail.com> > wrote: > >> I have key in following format: >> >> byte[] rowKey = >> =Bytes.add(Bytes.toBytes("3"),Bytes.toBytes(982222),Bytes.toBytes(1211)); >> >> It is stored as byte array. >> >> How to decode it when using java? >> >> Bytes.toString(CellUtil.cloneRow(cell)) >> >> results in a�~�� >> >> >> >> >> -- >> Sent from: http://apache-hbase.679495.n3.nabble.com/HBase-User-f4020416 >> .html >> > >