I am trying to understand kafka stream's Statestore
. I understood some basics of it. I looked into the code.
Here is the declaration of StateStore
:
public interface StateStore { }
One of the interfaces which extends StateStore
is KeyValueStore
.
Here is the declaration of KeyValueStore
:
public interface KeyValueStore<K, V> extends StateStore, ReadOnlyKeyValueStore<K, V> { }
Here is the declaration of ReadOnlyKeyValueStore
:
public interface ReadOnlyKeyValueStore<K, V> { }
My doubt is this:
public interface KeyValueStore<K, V> extends StateStore, ReadOnlyKeyValueStore<K, V> { }
How KeyValueStore
is allowing the following operations (taken from its java-doc_):
/**
KeyValueStore
is extending ReadOnlyKeyValueStore
. So how is it possible?
It's just an interface, there's no logic that explicitly limits the ability to write.
The only difference is the addition of the put and delete method(s). The get method is obtained through inheritance of the read-only store interface