Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-4197

RegionServer expects all scanner to be subclasses of HRegion.RegionScanner

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.92.0
    • 0.92.0
    • Coprocessors
    • None
    • Incompatible change, Reviewed
    • RegionScanner is now an interface which extends InternalScanner.

    Description

      Returning just an InternalScanner from RegionObsever.

      {pre|post}

      OpenScanner leads to the following exception when using the scanner.

      java.io.IOException: InternalScanner implementation is expected to be HRegion.RegionScanner.
      at org.apache.hadoop.hbase.regionserver.HRegionServer.next(HRegionServer.java:2023)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Server.call(WritableRpcEngine.java:314)
      at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1225)

      The problem is in HRegionServer.next(...):

       
          InternalScanner s = this.scanners.get(scannerName);
      ...
            // Call coprocessor. Get region info from scanner.
            HRegion region = null;
            if (s instanceof HRegion.RegionScanner) {
              HRegion.RegionScanner rs = (HRegion.RegionScanner) s;
              region = getRegion(rs.getRegionName().getRegionName());
            } else {
              throw new IOException("InternalScanner implementation is expected " +
                  "to be HRegion.RegionScanner.");
            }
      

      Attachments

        1. ScannerTest.java
          2 kB
          Lars Hofhansl
        2. 4197-v2.txt
          20 kB
          Lars Hofhansl
        3. 4197-test.diff
          3 kB
          Lars Hofhansl
        4. 4197-bigger.txt
          18 kB
          Lars Hofhansl
        5. 4197.txt
          8 kB
          Lars Hofhansl

        Activity

          People

            larsh Lars Hofhansl
            larsh Lars Hofhansl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: