99re热这里只有精品视频,7777色鬼xxxx欧美色妇,国产成人精品一区二三区在线观看,内射爽无广熟女亚洲,精品人妻av一区二区三区

HBase性能調(diào)整:一般模式

2018-09-25 15:07 更新

HBase一般模式

常量

當(dāng)人們開始使用HBase時(shí),他們傾向于編寫如下所示的代碼:

Get get = new Get(rowkey);
Result r = table.get(get);
byte[] b = r.getValue(Bytes.toBytes("cf"), Bytes.toBytes("attr"));  // returns current version of value

但是特別是當(dāng)內(nèi)部循環(huán)(和MapReduce作業(yè))時(shí),將columnFamily和column-names重復(fù)轉(zhuǎn)換為字節(jié)數(shù)組的成本非常高。最好對(duì)字節(jié)數(shù)組使用常量,如下所示:

public static final byte[] CF = "cf".getBytes();
public static final byte[] ATTR = "attr".getBytes();
...
Get get = new Get(rowkey);
Result r = table.get(get);
byte[] b = r.getValue(CF, ATTR);  // returns current version of value
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)