2014-01-22 25 views
1

我有一個HBase查詢表,我存儲了一些信息。我有一個運行一些Pentaho KTR的MapReduce程序,並在MapReduce作業中捕獲輸出。從KTR輸出的某些字段中,我檢索一些密鑰並使用它們,我必須在HBase中查找一些值。我的情況是:如何高效查找HBase表

1. The rowkey is of format <Table Code>-<CRC>, ex- DDVC-XXX 

For each output of the KTRs:  

2. If no result is found for a particular key(which I get from the Pentaho KTRs), 
    then increment a column value which has the rowkey of format 
    <Table Code>-last, ex: DDVC-last 
3. Take this incremented value and put it in the HBase table with the specific key. 

所以,在這裏我做一個獲取,一個增量和看跌的操作,如果我不能找到一個rowkey的值。有人可以給我一些關於如何有效地做到這一點的建議,而不必再次將HBase重新打包。因爲我可以看到作業所需的大部分時間都是執行上面的算法,這種算法多次針對單行命中HBase。

在此先感謝。

回答

0

雖然架構設計可能值得一些關注,但您所描述的問題可能無法進一步提升性能。 Get,Increment和Put是獨立的操作,並且需要三個獨立的HBase調用。

+0

是的。我贊同你。但是有沒有什麼辦法可以在批處理中執行,而不是對每個密鑰執行Get,Incr和Put?或者我可以使用Observer協處理器來完成它,就像在postGet方法中一樣? – achyut

+0

啊!很好的問題 - 事實上我現在在投票);這很晚了,我會考慮這個.. – javadba