bl双性强迫侵犯h_国产在线观看人成激情视频_蜜芽188_被诱拐的少孩全彩啪啪漫画

java連接hbase

package com.weshare.bigdata;

創(chuàng)新互聯(lián)建站專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于成都做網(wǎng)站、網(wǎng)站制作、成都外貿(mào)網(wǎng)站建設(shè)、烏爾禾網(wǎng)絡(luò)推廣、小程序設(shè)計(jì)、烏爾禾網(wǎng)絡(luò)營銷、烏爾禾企業(yè)策劃、烏爾禾品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎(jiǎng);創(chuàng)新互聯(lián)建站為所有大學(xué)生創(chuàng)業(yè)者提供烏爾禾建站搭建服務(wù),24小時(shí)服務(wù)熱線:028-86922220,官方網(wǎng)址:vcdvsql.cn

import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.*;
import org.apache.hadoop.hbase.util.Bytes;

public class hbaseLink {
static org.apache.hadoop.conf.Configuration configuration=null;
private org.apache.hadoop.hbase.client.Connection connection=null;
private Table table=null;

public void init() throws Exception{
    configuration=HBaseConfiguration.create();
    configuration.set("hbase.zookeeper.quorum", "

// try {
// table = connection.getTable(TableName.valueOf("hbase表名"));
// ResultScanner rs = table.getScanner(new Scan());
// int num=0;
// for (Result r : rs) {
// Byte b= r.getRow(scan);
// System.out.println("獲得到rowkey:" + new String(r.getRow()));
// num++;
//
// }System.out.print(num);
// }catch(Exception e){
// e.printStackTrace();
// }
}
public void queryall(String tableName) throws Exception{
table = connection.getTable(TableName.valueOf(tableName));
ResultScanner rs = table.getScanner(new Scan());
int num=0;
for (Result r : rs) {
//System.out.println("獲得到rowkey:" + new String(r.getRow()));
num++;

        }
        System.out.print(num);
}
public void checkColName(String tableName,String rowkey,String exceptedColName) throws Exception{
    table = connection.getTable(TableName.valueOf(tableName));//建立hbase表鏈接
    Get scan = new Get(rowkey.getBytes());//獲取rokey,將其轉(zhuǎn)義成byte字節(jié)
    Result r=table.get(scan);//使用轉(zhuǎn)義的rowkey查詢表,將其查詢結(jié)果返回給Result
    System.out.println("1");
    if(r.rawCells().equals("")||r.rawCells()==null||r.rawCells().length==0){
        System.out.println("3");
    }
    for (Cell keyValue : r.rawCells()) {
        System.out.println("2");
        String colName = Bytes.toString(keyValue.getQualifierArray(),keyValue.getQualifierOffset(),keyValue.getQualifierLength());
        if(!colName.equals(exceptedColName)){
            System.out.println("校驗(yàn)成功,不存在colName:"+exceptedColName+",實(shí)際colName:" + colName);
        }else if(colName.isEmpty()){
            System.out.println("校驗(yàn)成功,查詢無colName");
        }else{
            System.out.println("校驗(yàn)失敗");
        }
        System.out.println("12:"+keyValue.getFamilyLength());

    }

// Get coln=scan.addFamily(rowkey.getBytes());
// NavigableMap nm=scan.getFamilyMap(rowkey.getBytes());
// System.out.println(coln.toString());

}
public static void main(String[] args) throws Exception{
    hbaseLink hl=new hbaseLink();
    hl.init();
    hl.queryall("tablename");

// hl.checkColName("table","rowkey","column");
}
}

文章題目:java連接hbase
當(dāng)前URL:http://vcdvsql.cn/article6/iigcig.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站制作全網(wǎng)營銷推廣搜索引擎優(yōu)化用戶體驗(yàn)域名注冊(cè)網(wǎng)站導(dǎo)航

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)