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

Removing MemStoreScanner and SnapshotScanner

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0-alpha-1
    • Scanners
    • None

    Description

      With CompactingMemstore becoming the new default, a store comprises multiple memory segments and not just 1-2. MemStoreScanner encapsulates the scanning of segments in the memory part of the store. SnapshotScanner is used to scan the snapshot segment upon flush to disk.
      Having the logic of scanners scattered in multiple classes (StoreScanner, SegmentScanner, MemStoreScanner, SnapshotScanner) makes maintainance and debugging challenging tasks, not always for a good reason.
      For example, MemStoreScanner has a KeyValueHeap (KVH). When creating the store scanner which also has a KVH, this makes a KVH inside a KVH. Reasoning about the correctness of the methods supported by the scanner (seek, next, hasNext, peek, etc.) is hard and debugging them is cumbersome.
      In addition, by removing the MemStoreScanner layer we allow store scanner to filter out each one of the memory scanners instead of either taking them all (in most cases) or discarding them all (rarely).
      SnapshotScanner is a simplified version of SegmentScanner as it is used only in a specific context. However it is an additional implementation of the same logic with no real advantage of improved performance.

      Therefore, I suggest removing both MemStoreScanner and SnapshotScanner. The code is adjusted to handle the list of segment scanners they encapsulate.
      This fits well with the current code since in most cases at some point a list of scanner is expected, so passing the actual list of segment scanners is more natural than wrapping a single (high level) scanner with Collections.singeltonList(...).

      Attachments

        1. HBASE-17655-V08.patch
          70 kB
          Eshcar Hillel
        2. HBASE-17655-V07.patch
          70 kB
          Eshcar Hillel
        3. HBASE-17655-V06.patch
          69 kB
          Eshcar Hillel
        4. HBASE-17655-V05.patch
          91 kB
          Eshcar Hillel
        5. HBASE-17655-V05.patch
          91 kB
          Eshcar Hillel
        6. HBASE-17655-V04.patch
          91 kB
          Eshcar Hillel
        7. HBASE-17655-V03.patch
          91 kB
          Eshcar Hillel
        8. HBASE-17655-V02.patch
          70 kB
          Eshcar Hillel
        9. HBASE-17655-V01.patch
          67 kB
          Eshcar Hillel

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            eshcar Eshcar Hillel
            eshcar Eshcar Hillel
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment