学习日志——hbase学习(最大版本查询)

  















@Test   public  void  test4 (), throws 例外   {   Configuration  config =, HBaseConfiguration.create ();,,   config.set (“hbase.zookeeper.quorum”,,“hadoop1、hadoop2 hadoop3”);   HTable  HTable =, new  HTable(配置,“t_xuanxuan”);   Get  Get =, new 得到(“29129101029”_1444038378601 .getBytes ());   ,,,,,,,,,,,,,,,get.setMaxVersions ();   ,,,,,,,,,,,,,,,//这里设置的是2   ,,,,,,,,,,,,,,,Result  Result =, hTable.get(得到);   ,,,,,,,,,,,,,,,System.out.println (result.size ());   ,,,,,,,,,,,,,,,List, list =, result.list (),,   ,,,,,,,,,,,,,,,,(final  KeyValue  v:列表){   ,,,,,,,,,,,,,,,,System.out.println (v值:,“+,+,”str:大敌;“+ Bytes.toString (v.getValue ()));   ,,,,,,,,,,,,,,,}   }

结果的个数会是2,因为把其隐藏起来了,所以在hbase命令行中也查询不到,只有这样查。

学习日志——hbase学习(最大版本查询)