...
The change of the StateStoreContext interface does not require any changes to any of the implementations of the interface, it merely exposes (recordMetadata) a method that is already implemented in AbstractProcessorContext. Therefore we do not expect any compatibility issues. Moreover, recordMetadata returns an object of type RecordMetadata which is exclusively read-only, thus, protecting Kafka-internal from being tampered by applications.
Rejected Alternatives
...
Add a new Put mehtod to the KeyValueStore interface
The idea would be to couple data and metadata together in a single Put call.
Code Block |
---|
public interface KeyValueStore<K, V> extends StateStore, ReadOnlyKeyValueStore<K, V> {
...
void Put(K key, V value, RecordMetadata metadata);
...
} |
Add a new UpdatePosition method to the KeyValueStore interface
Code Block |
---|
public interface KeyValueStore<K, V> extends StateStore, ReadOnlyKeyValueStore<K, V> {
...
void UpdatePosition(String topic, int partition, int offset);
...
} |