Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-24888 API cleanup for 3.0.0
  3. HBASE-28729

Change the generic type of List in InternalScanner.next

    XMLWordPrintableJSON

Details

    • Incompatible change, Reviewed
    • Hide
      Change InternalScanner.next method to accept List<? super ExtendedCell> rather than List<Cell>, so we do not need to cast everywhere in the code.

      This is a breaking change for coprocessor users, especially that if you implement your own InternalScanner. In general, we can make sure that all the elements in the return List are ExtendedCells, thus Cells, so you are free to cast them to Cells when you want to intercept the results. And all Cells created via CellBuilder are all ExtendedCells, so you are free to cast them to ExtendedCells before adding to the List, or you can cast the List to List<Cell> or even List to add Cells to it.
      Show
      Change InternalScanner.next method to accept List<? super ExtendedCell> rather than List<Cell>, so we do not need to cast everywhere in the code. This is a breaking change for coprocessor users, especially that if you implement your own InternalScanner. In general, we can make sure that all the elements in the return List are ExtendedCells, thus Cells, so you are free to cast them to Cells when you want to intercept the results. And all Cells created via CellBuilder are all ExtendedCells, so you are free to cast them to ExtendedCells before adding to the List, or you can cast the List to List<Cell> or even List to add Cells to it.

    Description

      Plan to change it from List<Cell> to List<? super ExtendedCell>, so we could pass both List<Cell> and List<ExtendedCell> to it, or even List<RawCell> for coprocessors.

      This could save a lot of casting in our main code.

      This is an incompatible change for coprocessors, so it will only go into branch-3+, and will be marked as incompatible change.

      Attachments

        Issue Links

          Activity

            People

              zhangduo Duo Zhang
              zhangduo Duo Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: