hbase serverless 查询报错: Unsupport PageFilter-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

hbase serverless 查询报错: Unsupport PageFilter

sybn 2020-04-09 14:05:14 274

相同代码, 使用 hbase-client 连接自建hbase正常, 使用 alihbase-client 2.0.8 连接 hbase serverless 查询报错.

Caused by: java.io.IOException: TIOError(message:Unsupport filter org.apache.hadoop.hbase.filter.PageFilter)
	at com.alibaba.hbase.client.AliHBaseAPIProxyThriftImpl$Scanner.next(AliHBaseAPIProxyThriftImpl.java:637)
	at org.apache.hadoop.hbase.client.ResultScanner$1.hasNext(ResultScanner.java:53)
	... 25 more
Caused by: TIOError(message:Unsupport filter org.apache.hadoop.hbase.filter.PageFilter)
	at com.alibaba.hbase.thrift2.generated.THBaseService$getScannerResults_result$getScannerResults_resultStandardScheme.read(THBaseService.java:25413)
	at com.alibaba.hbase.thrift2.generated.THBaseService$getScannerResults_result$getScannerResults_resultStandardScheme.read(THBaseService.java:25380)
	at com.alibaba.hbase.thrift2.generated.THBaseService$getScannerResults_result.read(THBaseService.java:25322)
	at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:88)
	at com.alibaba.hbase.thrift2.generated.THBaseService$Client.recv_getScannerResults(THBaseService.java:1057)
	at com.alibaba.hbase.thrift2.generated.THBaseService$Client.getScannerResults(THBaseService.java:1042)
	at com.alibaba.hbase.client.AliHBaseAPIProxyThriftImpl$Scanner.next(AliHBaseAPIProxyThriftImpl.java:617)
	... 26 more
Serverless 分布式数据库 Hbase
分享到
取消 提交回答
全部回答(2)
  • 保持可爱mmm
    2020-04-15 22:54:42

    PageFilter的实现逻辑。

    public class PageFilter extends FilterBase {
      private long pageSize = Long.MAX_VALUE;
      private int rowsAccepted = 0;
     
      /**
       * Constructor that takes a maximum page size.
       *
       * @param pageSize Maximum result size.
       */
      public PageFilter(final long pageSize) {
        Preconditions.checkArgument(pageSize >= 0, "must be positive %s", pageSize);
        this.pageSize = pageSize;
      }
     
      public long getPageSize() {
        return pageSize;
      }
     
      @Override
      public ReturnCode filterKeyValue(Cell ignored) throws IOException {
        return ReturnCode.INCLUDE;
      }
     
      public boolean filterAllRemaining() {
        return this.rowsAccepted >= this.pageSize;
      }
     
      public boolean filterRow() {
        this.rowsAccepted++;
        return this.rowsAccepted > this.pageSize;
      }
      
    }
    

    其实很简单,内部有一个计数器,每次调用filterRow的时候,计数器都会+1,如果计数器值大于pageSize,filterrow就会返回true,那之后的行就会被过滤掉。

    0 0
  • huc_逆天
    2020-04-15 22:49:07

    版本问题了、。

    0 0
添加回答
数据库
使用钉钉扫一扫加入圈子
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

推荐文章
相似问题
推荐课程