一、查询Hbase:
HBaseEntityRepositoryImpl client = new HBaseEntityRepositoryImpl(); // 从HBase中取出一条记录 Result rs = client.getOneRecord(HbaseTables.get('xxxxxxxxxxxx'),rowKeyInfo.toRowKey()); if (rs.raw().length == 0) return null;// Result:keyvalues=NONE for (KeyValue kv : rs.raw()) { if ("xxxxxx".equals(new String(kv.getFamily(), "utf-8"))) { String property = new String(kv.getQualifier(), "utf-8"); try { Method method = xxxinfo.getClass().getMethod("set" + property.substring(0, 1).toUpperCase()+ property.substring(1), String.class); method.invoke(xxxinfo, new String(kv.getValue(),"utf-8")); } catch (Exception ex) { ex.printStackTrace(); } } }
?