繁体   English   中英

PHP Hbase Thrift客户端返回数组而不是TRowResult

[英]PHP Hbase Thrift client returns array instead of TRowResult

我们正在使用Thrift客户端从PHP访问Hbase。 Hbase版本是hbase-0.90.4-cdh3u3。

我的问题(更像是一个疑问)是Thrift API应该为许多方法返回TRowResult ,例如: scannerGetgetRowWithColumns ...而是返回带有单个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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM