hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 张铎(Duo Zhang) <palomino...@gmail.com>
Subject Re: Some problem about RegionScanner In coprocessor
Date Sun, 10 Dec 2017 10:26:00 GMT
You need to clear the values every time before you call rs.next otherwise
the list will become larger and larger.

2017-12-10 15:05 GMT+08:00 Yang Zhang <zhang.yang.dm@gmail.com>:

> 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)){
>             totalNum++;
>         }
>     } catch (IOException e) {
>         e.printStackTrace();
>     }
>     long end = System.currentTimeMillis();
>     logger.error("==== TestScanAllRegion Cost :"+(end-start)+"
> RegionNum :"+totalNum);
> }
>

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