THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||
---|---|---|
| ||
package org.apache.kafka.streams.test; public class ConsumerRecordFactory<K, V> { // default public ConsumerRecordFactory(String defaultTopicName, Serializer<K> keySerializer, Serializer<V> valueSerializer); // initialized WallClockMockTimeMsstartTimestampMs with System.currentTimeMillis(); and autoAdvanceMs with zero public ConsumerRecordFactory(String defaultTopicName, Serializer<K> keySerializer, Serializer<V> valueSerializer, long startTimestampMs); public ConsumerRecordFactory(String defaultTopicName, Serializer<K> keySerializer, Serializer<V> valueSerializer, long startTimestampMs, long autoAdvanceMs); // no default topic name; requires to specify topic name in #create(...) public ConsumerRecordFactory(Serializer<K> keySerializer, Serializer<V> valueSerializer); public ConsumerRecordFactory(Serializer<K> keySerializer, Serializer<V> valueSerializer, long startTimestampMs); public ConsumerRecordFactory(Serializer<K> keySerializer, Serializer<V> valueSerializer, long startTimestampMs, long autoAdvanceMs); public void advanceTimeMs(long advanceMs); // create single records with default topic name public ConsumerRecord<byte[], byte[]> create(K key, V value, long timestampMs); public ConsumerRecord<byte[], byte[]> create(K key, V value); public ConsumerRecord<byte[], byte[]> create(V value, long timestampMs); public ConsumerRecord<byte[], byte[]> create(V value); // create list of records with default topic name public List<ConsumerRecord<byte[], byte[]>> create(List<KeyValue<K, V>> keyValues); public List<ConsumerRecord<byte[], byte[]>> create(List<KeyValue<K, V>> keyValues, long startTimestamp, long advanceMs); public List<ConsumerRecord<byte[], byte[]>> create(List<KeyValue<K, V>> keyValues, long startTimestamp); // overwrite default topic name public ConsumerRecord<byte[], byte[]> create(String topicName, K key, V value, long timestampMs); public ConsumerRecord<byte[], byte[]> create(String topicName, K key, V value); public ConsumerRecord<byte[], byte[]> create(String topicName, V value, long timestampMs); public ConsumerRecord<byte[], byte[]> create(String topicName, V value); // those methods allow to access regular as well as global stores public List<ConsumerRecord<byte[], byte[]>> create(String topicName, List<KeyValue<K, V>> keyValues); public List<ConsumerRecord<byte[], byte[]>> create(String topicName, List<KeyValue<K, V>> keyValues, long startTimestamp, long advanceMs); public List<ConsumerRecord<byte[], byte[]>> create(String topicName, List<KeyValue<K, V>> keyValues, long startTimestamp); } |
...