Friday 15 March 2013

HBase KeyValue showing encrypted value using Java Code Program -


I am trying to write a simple HbZ data manipulation in Java code

The code is as follows < / P>

  public static zero main (string [] args) {configuration hBconfig = HBaseConfiguration.create (); HBconfig.addResource (new path ("/ home / circar / hbase / conf / hbase-site.xml")); Try {html hTable = new HTable (hBconfig, "Example HBTable"); Result result = hTable.get (get new (bytes.tit ("ExampleRow1"))); & Lt; KeyValue & gt; KeyValList = result.list (); (Key value value: value: wallist) {System.out.println ("akey key:" + keyValue.getKeyString ()); System.out.println ("A KeyType:" + keyValue.getType ()); System.out.println ("a. Row:" + keyValue.getRow (.) ToString ()); System.out.println ("family of:" + keyValue.getFamily (). ToString ()); System.out.println ("A.Qualifier:" + key value. GATQUALIFIER (.) ToString ()); System.out.println ("a. Value:" + keyValue.getValue (.) ToString ()); System.out.println ("A total total length:" + keyValue.getTotalColumnLength ()); System.out.println ("A. Timestamp:" + keyValue.getTimestamp ()); SplitKeyValue splitKeyValue = keyValue.split (); System.out.println ("B.Kitip:" + splitKeyValue.getType ()); System.out.println ("B. Line:" + splitKeyValue.getRow (.) ToString ()); System.out.println ("b. Family:" + splitKeyValue.getFamily (). ToString ()); System.out.println ("B. Qualifier:" + SplitWelcomeQualifier (.) ToString ()); System.out.println ("b. Value:" + splitKeyValue.getValue (.) ToString ()); System.out.println ("B. Timestamp:" + splitKeyValue.getTimestamp ()); }} Hold (IOException e) {e.printStackTrace (); }}   

As a result is showing

  13/06/21 18:15:29 information zookeeper.ClientCnxn: socket connection / 127.0 local Hosted to Host .0.1: 2181, Beginning of 13/06/21 session 18:15:29 Information zookeeper.ClientCnxn: Session Installation / 127.0.0.1 Complete on server local host: 2181, sessionid = 0x13f66c41fc90003, Timeout via chat = 40000 one. Key: \ x00 \ x0BExampleRow1 \ x10CircarConsultingMapReduce \ x00 \ x00 \ x01? F \ x16m \ x0D \ x04 A key type: 4th row: [b @ 15718 f2a. Family: [B @ 126F827A Eligibility: [B @ 16dfa45 a. Value: [B @ 14 9 AB 9FA total length: 25 A timestamp: 1371807313165 b. Keytype: [B @ 289D2BB line: [B @ 6754D6B Family: [B @ 1 F2 CA2B Qualification: [B @ 1dc0e7a b. Value: [B @ 3A 9bb timestamp: [B @ 1c5ddc9A key: \ x00 \ x0BExampleRow1 \ x08 projectmoderode \ x00 \ x00 \ x01? F \ x16m \ x0D \ x04 a type: 4th row: [b @ 163f7a1a family: [b @ 16 9aa a qualifier: [b @ 173ec 72a value: [b @ 1a 85d 38a total clol langha : 17 A timestamps: 1371807313165 b. Ketip: [B 8046 F4B. Line: [B @ 1b273cc b. Family: [B @ d05c13b Qualification: [B @ 14d1d41b Value: [BbD7B2B Timestamp: [b @ 14df764   

but it is shown in the HBase shell as follows:

  ~ -desktop: ~ $ sudo HBase / Bin / hbase Shell HBase Shell; Help & lt; Back & gt; ' Enter the type of supported commands to type "exit " To leave Hubble Shell version 0.94.8, r1485407, Wed 22 May 20:53:13 UTC 2013 hbase (main): 001: 0> HBS (Main): 002: 0 * Table of Contents Example HBTible 1 row (s) 0.7540 second Hbiz (main): 003: 0> MapReduce, 0.1570 seconds in HBase, TimeStamp = 1371807313165, Value = MyProject 1 line (main): Scan 'exampleHbTable' row in column + cell ExampleRow1 column = CircarConsulting: MapReduce, Timestamp = 1371807313165, value = Hadoop ExampleRow1 column = Projects 004 : 0 & gt;   

Will someone please provide any idea to get a real readable value using Java code?

The Use bytes.stosting () The toasting of Java () will not work here.

  Example: System.out.println ("a.row:" + bytes.toString (keyValue.getRow ()));    

No comments:

Post a Comment