hbase利用协处理器Coprocessor统计行数,抛出Caused by: org.apache.hadoop.hbase.ipc.CallTimeoutException

抛出异常信息如下所示:

at org.apache.hadoop.hbase.client.RpcRetryingCallerImpl.callWithRetries(RpcRetryingCallerImpl.java:145)
    at org.apache.hadoop.hbase.client.RegionCoprocessorRpcChannel.callExecService(RegionCoprocessorRpcChannel.java:91)
    at org.apache.hadoop.hbase.client.SyncCoprocessorRpcChannel.callMethod(SyncCoprocessorRpcChannel.java:52)
    at org.apache.hadoop.hbase.protobuf.generated.AggregateProtos$AggregateService$Stub.getRowNum(AggregateProtos.java:2113)
    at org.apache.hadoop.hbase.client.coprocessor.AggregationClient$3.call(AggregationClient.java:357)
    at org.apache.hadoop.hbase.client.coprocessor.AggregationClient$3.call(AggregationClient.java:351)
    at org.apache.hadoop.hbase.client.HTable$12.call(HTable.java:1012)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Call to dataserver1/192.168.21.29:16020 failed on local exception: org.apache.hadoop.hbase.ipc.CallTimeoutException: Call id=482, waitTime=60002, rpcTimeout=60000
    at org.apache.hadoop.hbase.ipc.IPCUtil.wrapException(IPCUtil.java:185)
    at org.apache.hadoop.hbase.ipc.AbstractRpcClient.onCallFinished(AbstractRpcClient.java:390)
    at org.apache.hadoop.hbase.ipc.AbstractRpcClient.access$100(AbstractRpcClient.java:95)
    at org.apache.hadoop.hbase.ipc.AbstractRpcClient$3.run(AbstractRpcClient.java:410)
    at org.apache.hadoop.hbase.ipc.AbstractRpcClient$3.run(AbstractRpcClient.java:406)
    at org.apache.hadoop.hbase.ipc.Call.setTimeout(Call.java:96)
    at org.apache.hadoop.hbase.ipc.RpcConnection$1.run(RpcConnection.java:199)
    at org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:663)
    at org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:738)
    at org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:466)
    ... 1 more
Caused by: org.apache.hadoop.hbase.ipc.CallTimeoutException: Call id=482, waitTime=60002, rpcTimeout=60000
    at org.apache.hadoop.hbase.ipc.RpcConnection$1.run(RpcConnection.java:200)
    ... 4 more

    at org.apache.hadoop.hbase.client.coprocessor.AggregationClient$3.call(AggregationClient.java:360)
    at org.apache.hadoop.hbase.client.coprocessor.AggregationClient$3.call(AggregationClient.java:351)
    at org.apache.hadoop.hbase.client.HTable$12.call(HTable.java:1012)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)

原因:CallTimeoutException     由于超时导致操作失败  
解决方式:调整超时时间间隔,提交RPC通信时长以及设置scan缓存的时间

方式1:可以直接在配置文件中hbase-site.xml中添加配置文件:


   hbase.rpc.timeout
  600000   //时间间隔


   hbase.client.scanner.timeout.period
  600000   //scan缓存时间

方式2:

在程序中补充配置文件信息:

        //提高RPC通信时长
        config.setLong("hbase.rpc.timeout", 6000000);
        //设置Scan缓存
        config.setLong("hbase.client.scanner.caching", 100000);

 

你可能感兴趣的:(hbase)