分享

hbase过滤器使用



SingleColumnValueFilter scvf = new SingleColumnValueFilter(Bytes.toBytes(colFamily), Bytes.toBytes(col), CompareFilter.CompareOp.GREATER, new LongComparator(10000L))

使用LongComparator后报下面的错误

Exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.hbase.DoNotRetryIOException: Failed after retry of OutOfOrderScannerNextException: was there a rpc timeout?
        at org.apache.hadoop.hbase.client.AbstractClientScanner$1.hasNext(AbstractClientScanner.java:97)
        at com.ai.bquery.common.cloud.HBaseQuery.scannerToList(HBaseQuery.java:274)
        at com.ai.bquery.common.cloud.HBaseQuery.queryByScan(HBaseQuery.java:250)
        at com.ai.bquery.common.cloud.HBaseQuery.queryByPrefix(HBaseQuery.java:167)
        at com.ai.bquery.common.cloud.HBaseQuery.queryByPrefix(HBaseQuery.java:62)
        at com.ai.bquery.cloud.HBaseQueryTest.main(HBaseQueryTest.java:32)
Caused by: org.apache.hadoop.hbase.DoNotRetryIOException: Failed after retry of OutOfOrderScannerNextException: was there a rpc timeout?
        at org.apache.hadoop.hbase.client.ClientScanner.loadCache(ClientScanner.java:466)
        at org.apache.hadoop.hbase.client.ClientScanner.next(ClientScanner.java:364)
        at org.apache.hadoop.hbase.client.AbstractClientScanner$1.hasNext(AbstractClientScanner.java:94)
        ... 5 more
Caused by: org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException: org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException: Expected nextCallSeq: 1 But the nextCallSeq got from client: 0; request=scanner_id: 30261 number_of_rows: 1000 close_scanner: false next_call_seq: 0 client_handles_partials: true client_handles_heartbeats: true track_scan_metrics: false renew: false
        at org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:2446)
        at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:33648)
        at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2171)
        at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:109)
        at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:185)
        at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:165)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.apache.hadoop.ipc.RemoteException.instantiateException(RemoteException.java:106)
        at org.apache.hadoop.ipc.RemoteException.unwrapRemoteException(RemoteException.java:95)
        at org.apache.hadoop.hbase.protobuf.ProtobufUtil.getRemoteException(ProtobufUtil.java:327)
        at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:263)
        at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:65)
        at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200)
        at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:381)
        at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:355)
        at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:126)
        at org.apache.hadoop.hbase.client.ResultBoundedCompletionService$QueueingFuture.run(ResultBoundedCompletionService.java:80)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.hadoop.hbase.ipc.RemoteWithExtrasException(org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException): org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException: Expected nextCallSeq: 1 But the nextCallSeq got from client: 0; request=scanner_id: 30261 number_of_rows: 1000 close_scanner: false next_call_seq: 0 client_handles_partials: true client_handles_heartbeats: true track_scan_metrics: false renew: false
        at org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:2446)
        at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:33648)
        at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2171)
        at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:109)
        at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:185)
        at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:165)

        at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1269)
        at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:227)
        at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:336)
        at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$BlockingStub.scan(ClientProtos.java:34094)
        at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:220)
        ... 9 more

已有(4)人评论

跳转到指定楼层
s060403072 发表于 2018-8-21 15:32:39
本帖最后由 s060403072 于 2018-8-21 15:34 编辑

SingleColumnValueFilter 支持以下比较器:

BinaryComparator
BinaryPrefixComparator
RegexStringComparator 。

对于长整型可能不支持
尝试修改为如下试试:
new LongComparator(500)
回复

使用道具 举报

一曲离殇 发表于 2018-8-21 17:04:42
s060403072 发表于 2018-8-21 15:32
SingleColumnValueFilter 支持以下比较器:

BinaryComparator


一样的效果,生成的scan信息是这样的
{"loadColumnFamiliesOnDemand":null,"filter":"FilterList AND (1/1): [SingleColumnValueFilter (F, FLOWDOWN, GREATER, \\x00\\x00\\x00\\x00\\x00\\x00\\x01\\xF4)]","startRow":"01015054590739","stopRow":"0101505459073:","batch":-1,"cacheBlocks":false,"totalColumns":1,"maxResultSize":-1,"families":{"F":["ALL"]},"caching":-1,"maxVersions":1,"timeRange":[0,9223372036854775807]}
回复

使用道具 举报

sstutu 发表于 2018-8-21 19:55:35
一曲离殇 发表于 2018-8-21 17:04
一样的效果,生成的scan信息是这样的
{"loadColumnFamiliesOnDemand":null,"filter":"FilterList AND ...

说明问题不在这。
回复

使用道具 举报

一曲离殇 发表于 2018-8-21 22:37:41
本帖最后由 一曲离殇 于 2018-8-21 22:41 编辑

求各位大神指点..........
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条