[英]PHP Hbase Thrift client returns array instead of TRowResult
我們正在使用Thrift客戶端從PHP訪問Hbase。 Hbase版本是hbase-0.90.4-cdh3u3。
我的問題(更像是一個疑問)是Thrift API應該為許多方法返回TRowResult
,例如: scannerGet
, getRowWithColumns
...而是返回帶有單個TRowResult
實例的數組。
有誰知道那是為什么? 這些方法(通常應該返回一行或不返回)是否返回多個TRowResult
實例? 我可以簡單地在包裝類中彈出這一行並返回它而不是返回數組嗎(如果有空數組,則返回null)?
.thrift文檔非常清楚應該返回什么:
/**
* Get the specified columns for the specified table and row at the latest
* timestamp. Returns an empty list if the row does not exist.
*
* @return TRowResult containing the row and map of columns to TCells
*/
list<TRowResult> getRowWithColumns(
[...]
/**
* Returns the scanner's current row value and advances to the next
* row in the table. When there are no more rows in the table, or a key
* greater-than-or-equal-to the scanner's specified stopRow is reached,
* an empty list is returned.
*
* @return a TRowResult containing the current row and a map of the columns to TCells.
*
* @throws IllegalArgument if ScannerID is invalid
*
* @throws NotFound when the scanner reaches the end
*/
list<TRowResult> scannerGet(
(盡管@throws NotFound
已過時)
謝謝!
有getRows()和ScannerGetList()方法,它們返回TRowResult對象的數組。 我使用了來自cdh3u4的hbase,不知道cese3u3中是否存在這些方法。 順便說一句,cdh4應該已經包含hbase 0.92並支持掃描過濾器;)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.