Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-18169 Coprocessor fix and cleanup before 2.0.0 release
  3. HBASE-19001

Remove the hooks in RegionObserver which are designed to construct a StoreScanner which is marked as IA.Private

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-alpha-4, 2.0.0
    • Coprocessors
    • None
    • Incompatible change, Reviewed
    • Hide
      These methods are removed:
      KeyValueScanner preStoreScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
            Store store, Scan scan, NavigableSet<byte[]> targetCols, KeyValueScanner s, long readPt)
            throws IOException;
      InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
            Store store, List<KeyValueScanner> scanners, InternalScanner s, long readPoint)
            throws IOException;
      InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
            Store store, List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs,
            InternalScanner s, CompactionLifeCycleTracker tracker, CompactionRequest request,
            long readPoint) throws IOException;

      For flush and compaction, CP users are expected to wrap the InternalScanner in preFlush/preCompact. And for normal region operation, just use preGetOp/preScannerOpen to modify the Get/Scan object.

      This method in Region interface is also removed as we do not need to use read point in CP hooks anymore:
      long getReadPoint(IsolationLevel isolationLevel);
      Show
      These methods are removed: KeyValueScanner preStoreScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,       Store store, Scan scan, NavigableSet<byte[]> targetCols, KeyValueScanner s, long readPt)       throws IOException; InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,       Store store, List<KeyValueScanner> scanners, InternalScanner s, long readPoint)       throws IOException; InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,       Store store, List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs,       InternalScanner s, CompactionLifeCycleTracker tracker, CompactionRequest request,       long readPoint) throws IOException; For flush and compaction, CP users are expected to wrap the InternalScanner in preFlush/preCompact. And for normal region operation, just use preGetOp/preScannerOpen to modify the Get/Scan object. This method in Region interface is also removed as we do not need to use read point in CP hooks anymore: long getReadPoint(IsolationLevel isolationLevel);

    Description

      There are three methods here

      KeyValueScanner preStoreScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
            Store store, Scan scan, NavigableSet<byte[]> targetCols, KeyValueScanner s, long readPt)
            throws IOException;
      
      InternalScanner preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
            Store store, List<KeyValueScanner> scanners, InternalScanner s, long readPoint)
            throws IOException;
      
      InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
            Store store, List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs,
            InternalScanner s, CompactionLifeCycleTracker tracker, CompactionRequest request,
            long readPoint) throws IOException;
      

      For the flush and compact ones, we've discussed many times, it is not safe to let user inject a Filter or even implement their own InternalScanner using the store file scanners, as our correctness highly depends on the complicated logic in SQM and StoreScanner. CP users are expected to wrap the original InternalScanner(it is a StoreScanner anyway) in preFlush/preCompact methods to do filtering or something else.

      For preStoreScannerOpen it even returns a KeyValueScanner which is marked as IA.Private... This is less hurt but still, we've decided to not expose StoreScanner to CP users so here this method is useless. CP users can use preGetOp and preScannerOpen method to modify the Get/Scan object passed in to inject into the scan operation.

      Attachments

        1. HBASE-19001-v2.patch
          92 kB
          Duo Zhang
        2. HBASE-19001-v1.patch
          89 kB
          Duo Zhang
        3. HBASE-19001.patch
          87 kB
          Duo Zhang

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: