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

MetaReader#fullScan doesn't stop scanning when vistor returns false in 0.90 version

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.90.6
    • None
    • None
    • Reviewed

    Description

      In current 0.90 code,

       public static void fullScan(CatalogTracker catalogTracker,
            final Visitor visitor, final byte [] startrow)
        throws IOException {
          HRegionInterface metaServer =
            catalogTracker.waitForMetaServerConnectionDefault();
          Scan scan = new Scan();
          if (startrow != null) scan.setStartRow(startrow);
          scan.addFamily(HConstants.CATALOG_FAMILY);
          long scannerid = metaServer.openScanner(
              HRegionInfo.FIRST_META_REGIONINFO.getRegionName(), scan);
          try {
            Result data;
            while((data = metaServer.next(scannerid)) != null) {
              if (!data.isEmpty()) visitor.visit(data);
            }
          } finally {
            metaServer.close(scannerid);
          }
          return;
        }
      

      If visitor.visit(data) return false, the scan will not stop;
      However, it is not the same as the description of Visitor

      public interface Visitor {
          /**
           * Visit the catalog table row.
           * @param r A row from catalog table
           * @return True if we are to proceed scanning the table, else false if
           * we are to stop now.
           */
          public boolean visit(final Result r) throws IOException;
        }
      

      I think it is a miss, and trunk doesn't exist this hole.

      Attachments

        1. hbase-5020.patch
          0.7 kB
          Chunhui Shen

        Activity

          People

            zjushch Chunhui Shen
            zjushch Chunhui Shen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: