部分文章内容为公开资料查询整理,原文出处可能未标注,如有侵权,请联系我,谢谢。邮箱地址:gnivor@163.com ►►►需要气球么?请点击我吧!

HBase笔记--编程实战

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();
        }
    }
View Code

 

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

 

posted @ 2015-12-07 04:17  流了个火  阅读(344)  评论(0编辑  收藏  举报
►►►需要气球么?请点击我吧!►►►
View My Stats