hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yang Zhang <zhang.yang...@gmail.com>
Subject Some problem about RegionScanner In coprocessor
Date Sun, 10 Dec 2017 07:05:29 GMT
Hello everyone

         I am using coprocessor in HBase. When I try to Scan a Region using
RegionScanner , It will takes a long time. Even 100 times longer than Scan
from HBase shell. So I believe there must be something wrong.

        What's more, HBase will also give no response when I try to disable
this table and try to delete.

        My HBase version is 0.98.4,,Table row number is 500000,all data is
in one region.I do this in preScannerOpen hooks.

        My code is below,Anybody can help? Thanks very much!

private void testScan(String regionInfo, RegionCoprocessorEnvironment
env,RegionScanner regionScanner){
    IndexTree indexTree = new JavaTreeMap(new Node());
    regionIndexMap.put(regionInfo, indexTree);
    Scan scan = new Scan();
    scan.setFilter(new FirstKeyOnlyFilter());

    long totalNum = 0;
    long start = System.currentTimeMillis();

    try {
        RegionScanner rs = env.getRegion().getScanner(scan);
        List<Cell> values = new LinkedList<>();
        while (rs.next(values)){
    } catch (IOException e) {
    long end = System.currentTimeMillis();
    logger.error("==== TestScanAllRegion Cost :"+(end-start)+"
RegionNum :"+totalNum);

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message