HBase笔记--编程实战

时间:2023-10-07 15:57:02

HBase总结:http://blog.csdn.net/lifuxiangcaohui/article/details/39997205  (very good)

Spark使用Java读取hbase: http://my.oschina.net/132722/blog/196350

HBase dao:http://www.xuebuyuan.com/2047942.html

HBase Scan类用法: http://www.cnblogs.com/linjiqin/archive/2013/06/05/3118921.html

HBase Qualifier 和 Family的区别:http://blog.csdn.net/wkwanglei/article/details/43988109

Java操作HBase:http://www.cnblogs.com/ylqmf/archive/2012/02/18/2357537.html
HBase基本操作详解:http://blog.csdn.net/linlinv3/article/details/45393471

public static void QueryByCondition2(String tableName) {
System.out.println("QueryByCondition2");
try {
HTable table = new HTable(configuration, tableName);
Filter filter = new SingleColumnValueFilter(
Bytes.toBytes("column1"), null, CompareOp.EQUAL,
Bytes.toBytes("aaa")); // 当列column1的值为aaa时进行查询
Scan s = new Scan();
s.setFilter(filter);
ResultScanner rs = table.getScanner(s);
for (Result r : rs) {
System.out.println("获得到rowkey:" + new String(r.getRow()));
for(Cell cell : r.rawCells()){
System.out.println("cell列:"+new String(CellUtil.cloneFamily(cell))
+ "====cell值:"+new String(CellUtil.cloneValue(cell)));
}
for (KeyValue keyValue : r.raw()) {
System.out.println("列:" + new String(keyValue.getFamily())
+ "====值:" + new String(keyValue.getValue()));
}
}
} catch (Exception e) {
e.printStackTrace();
}
}

Hive和HBase区别:http://www.cnblogs.com/justinzhang/p/4273470.html