Java 从hbase获取数据时出错

Java 从hbase获取数据时出错,java,hbase,Java,Hbase,我在一个HBase表中有一些特定数据,该表包含大量数据和1000个区域 当我从shell查询数据时,使用通过列名的普通扫描需要175秒。但与我在java代码中尝试使用前缀过滤器获取的内容相同,我得到了一个超时错误 有谁知道为什么会发生这种情况,以及我如何从基表中获取数据 请在下面找到我使用的代码 @Override public Scan getScanForRowRange(List rowKeys, List columnList) { try { List rowr

我在一个
HBase
表中有一些特定数据,该表包含大量数据和1000个区域

当我从shell查询数据时,使用通过列名的普通扫描需要175秒。但与我在java代码中尝试使用前缀过滤器获取的内容相同,我得到了一个超时错误

有谁知道为什么会发生这种情况,以及我如何从基表中获取数据

请在下面找到我使用的代码

@Override
public Scan getScanForRowRange(List rowKeys, List columnList) {
    try {
        List rowrangeList = new ArrayList<>();
        for (String rowKey : rowKeys) {
            byte[] startRow = Bytes.toBytes(rowKey);
            byte[] endRow = new byte[startRow.length + 1];
            System.arraycopy(startRow, 0, endRow, 0, startRow.length);
            endRow[startRow.length] = (byte) 255;
            RowRange rowRange = new RowRange(startRow, true, endRow, false);
            rowrangeList.add(rowRange);
        }
        logger.info("row range size" + rowrangeList.size());
        Scan scan = new Scan();
        for (String columnName : columnList) {
            if (columnName.contains(ForesightConstants.COLON)) {
                String cellValues[] = columnName.split(ForesightConstants.COLON);
                scan.addColumn(Bytes.toBytes(cellValues[ForesightConstants.ZERO]), Bytes.toBytes(cellValues[ForesightConstants.ONE]));
            }
        }
        scan.setFilter(new MultiRowRangeFilter(rowrangeList));
        scan.setCacheBlocks(true);
        scan.setCaching(10);
        return scan;
    } catch (IOException e) {
        logger.info("Exception Inside @Method getScanForRowRange }", Utils.getStackTrace(e));
    }
    return null;
}
@覆盖
公共扫描getScanForRowRange(列出行键,列出列列表){
试一试{
List rowrangeList=新建ArrayList();
用于(字符串行键:行键){
byte[]startRow=Bytes.toBytes(rowKey);
byte[]endRow=新字节[startRow.length+1];
System.arraycopy(startRow,0,endRow,0,startRow.length);
endRow[startRow.length]=(字节)255;
RowRange RowRange=新的RowRange(startRow、true、endRow、false);
rowrangeList.add(rowRange);
}
logger.info(“行范围大小”+行范围列表.size());
扫描=新扫描();
用于(字符串列名称:columnList){
if(columnName.contains(foresight constants.冒号)){
字符串cellValues[]=columnName.split(Foresight Constants.COLON);
scan.addColumn(Bytes.toBytes(cellValues[ForeightConstants.ZERO])、Bytes.toBytes(cellValues[ForeightConstants.ONE]);
}
}
setFilter(新的MultiRowRangeFilter(rowrangeList));
scan.setCacheBlocks(true);
扫描设置缓存(10);
返回扫描;
}捕获(IOE异常){
logger.info(“在@Method getScanForRowRange}中出现异常”,Utils.getStackTrace(e));
}
返回null;
}

请添加您的代码好吗?检查您的shell是否为属性hbase.client.scanner.timeout.period设置了更高的超时值,您可以尝试将此值从默认值60000增加到180000,并尝试java codemax我尝试过rowrange筛选器数据现在正在提供,但这需要很多时间才能提供。您能知道发生这种情况的原因吗