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

Streams store cleanup: inline byte-store generic parameters

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.3.0
    • streams
    • None

    Description

      Currently, the fundamental layer of stores in Streams is the "bytes store".

      The easiest way to identify this is in `org.apache.kafka.streams.state.Stores`, all the `StoreBuilder`s require a `XXBytesStoreSupplier`. 

      We provide several implementations of these bytes stores, typically an in-memory one and a persistent one (aka RocksDB).

      Inside these bytes stores, the key is always `Bytes` and the value is always `byte[]` (serialization happens at a higher level). However, the store implementations are generically typed, just `K` and `V`.

      This is good for flexibility, but it makes the code a little harder to understand. I think that we used to do serialization at a lower level, so the generics are a hold-over from that.

      It would simplify the code if we just inlined the actual k/v types and maybe even renamed the classes from (e.g.) `InMemoryKeyValueStore<K,V>` to `InMemoryKeyValueBytesStore`, and so forth.

       

      Attachments

        Activity

          People

            ableegoldman A. Sophie Blee-Goldman
            vvcephei John Roesler
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: