How to store primitive data types in hbase and retrieve -


How can I archive and retrieve the primitive data types via the HBS API? My job is to save random events to hbase, which contains unexpected data types that arise randomly and whenever I want, need to get them back? Can someone please help me please please, because I'm really new to hbase and this stuff.

In this way, you enter data in the HBase table:

  Configuration conf = HBaseConfiguration.create (); Eligible table = new HTable (conf, "TABLE_NAME"); Put P = Keep New (Linear); P.add (Bytes. Titles ("CF"), Bytes Toto ("C1"), Bytes Toto ("VALUE"); table.put (p);   

You do not have to worry about the type of data, however, you should keep in mind that whatever goes inside of Hbiz goes as an array of bytes . Therefore, when you bring back the data from the HBbb, you have to convert it back to the right type because you are getting the buyer every time. This can be done using different overloaded methods provided by the Byte class. By this way:

  bytes. String (byte []) bytes. Toflat (byte []) bytes. Lol (byte [])    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -