KeyValueStore 如何允许写入操作(Kafka Streams)
How KeyValueStore allows write operations (Kafka Streams)
我正在尝试了解 kafka 流的 Statestore
。我了解它的一些基础知识。我查看了代码。
这里是StateStore
的声明:
public interface StateStore { }
扩展 StateStore
的接口之一是 KeyValueStore
。
这里是KeyValueStore
的声明:
public interface KeyValueStore<K, V> extends StateStore, ReadOnlyKeyValueStore<K, V> { }
这里是ReadOnlyKeyValueStore
的声明:
public interface ReadOnlyKeyValueStore<K, V> { }
我的疑问是:
public interface KeyValueStore<K, V> extends StateStore, ReadOnlyKeyValueStore<K, V> { }
KeyValueStore
如何允许以下操作(取自其 java-doc_):
/**
* A key-value store that supports put/get/delete and range queries.
*
* @param The key type
* @param The value type
*/
KeyValueStore
正在扩展 ReadOnlyKeyValueStore
。那怎么可能呢?
谁能帮忙理解一下?
只是一个接口,没有明确限制写入能力的逻辑
唯一的区别是添加了 put 和 delete 方法。 get方法是通过只读store接口的继承得到的
我正在尝试了解 kafka 流的 Statestore
。我了解它的一些基础知识。我查看了代码。
这里是StateStore
的声明:
public interface StateStore { }
扩展 StateStore
的接口之一是 KeyValueStore
。
这里是KeyValueStore
的声明:
public interface KeyValueStore<K, V> extends StateStore, ReadOnlyKeyValueStore<K, V> { }
这里是ReadOnlyKeyValueStore
的声明:
public interface ReadOnlyKeyValueStore<K, V> { }
我的疑问是:
public interface KeyValueStore<K, V> extends StateStore, ReadOnlyKeyValueStore<K, V> { }
KeyValueStore
如何允许以下操作(取自其 java-doc_):
/** * A key-value store that supports put/get/delete and range queries. * * @param The key type * @param The value type */
KeyValueStore
正在扩展 ReadOnlyKeyValueStore
。那怎么可能呢?
谁能帮忙理解一下?
只是一个接口,没有明确限制写入能力的逻辑
唯一的区别是添加了 put 和 delete 方法。 get方法是通过只读store接口的继承得到的