Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-8372

Remove deprecated RocksDB#compactRange API

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • 3.0.0
    • streams
    • None

    Description

      In upgrading Rocks from v5.15 to v5.18, several of the RocksDB#compactRange() methods were deprecated in favor of variations leveraging the new CompactRangeOptions object. However v5.18 left a gap in the API with no signature allowing you to pass in an options object without also passing it a start, end byte[] specifying a range to be compacted. Since we would like to compact the entire thing and not a subrange, while needing to specify several options, the deprecation warning was suppressed for now.

      In v6.0 this gap is closed as you can pass null in for start, end to specify that the entire range should be compacted.

      When upgrading Rocks to v6.0 or later, the deprecation suppressions should be removed from DualColumnFamilyAccessor#toggleDBForBulkLoading() (RocksDBTimestampedStore.java) and and SingleColumnFamilyAccessor#toggleDBForBulkLoading() (RocksDBStore.java) and the following replacement should be made:

       

      db.compactRange(columnFamily, true, 1, 0)

      -->

      db.compactRange(columnFamily, null, null, CompactRangeOptions);

       

      NOTE: CompactRangeOptions extend RocksObject and as such should be closed to avoid leaking memory!

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ableegoldman A. Sophie Blee-Goldman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: