use of org.apache.kafka.test.MockRecordCollector in project kafka by apache.
the class CompositeReadOnlyKeyValueStoreTest method newStoreInstance.
private KeyValueStore<String, String> newStoreInstance() {
final KeyValueStore<String, String> store = Stores.keyValueStoreBuilder(Stores.inMemoryKeyValueStore(storeName), Serdes.String(), Serdes.String()).build();
@SuppressWarnings("rawtypes") final InternalMockProcessorContext context = new InternalMockProcessorContext<>(new StateSerdes<>(ProcessorStateManager.storeChangelogTopic("appId", storeName, null), Serdes.String(), Serdes.String()), new MockRecordCollector());
context.setTime(1L);
store.init((StateStoreContext) context, store);
return store;
}
use of org.apache.kafka.test.MockRecordCollector in project kafka by apache.
the class ListValueStoreTest method setup.
@Before
public void setup() {
listStore = buildStore(Serdes.Integer(), Serdes.String());
final MockRecordCollector recordCollector = new MockRecordCollector();
final InternalMockProcessorContext<Integer, String> context = new InternalMockProcessorContext<>(baseDir, Serdes.String(), Serdes.Integer(), recordCollector, new ThreadCache(new LogContext("testCache"), 0, new MockStreamsMetrics(new Metrics())));
context.setTime(1L);
listStore.init((StateStoreContext) context, listStore);
}
use of org.apache.kafka.test.MockRecordCollector in project kafka by apache.
the class KeyValueSegmentsTest method createContext.
@Before
public void createContext() {
stateDirectory = TestUtils.tempDirectory();
context = new InternalMockProcessorContext<>(stateDirectory, Serdes.String(), Serdes.Long(), new MockRecordCollector(), new ThreadCache(new LogContext("testCache "), 0, new MockStreamsMetrics(new Metrics())));
segments = new KeyValueSegments(storeName, METRICS_SCOPE, RETENTION_PERIOD, SEGMENT_INTERVAL);
segments.openExisting(context, -1L);
}
use of org.apache.kafka.test.MockRecordCollector in project kafka by apache.
the class TimeOrderedKeyValueBufferTest method makeContext.
private static MockInternalProcessorContext makeContext() {
final Properties properties = new Properties();
properties.setProperty(StreamsConfig.APPLICATION_ID_CONFIG, APP_ID);
properties.setProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "");
final TaskId taskId = new TaskId(0, 0);
final MockInternalProcessorContext context = new MockInternalProcessorContext(properties, taskId, TestUtils.tempDirectory());
context.setRecordCollector(new MockRecordCollector());
return context;
}
use of org.apache.kafka.test.MockRecordCollector in project kafka by apache.
the class TimestampedSegmentsTest method createContext.
@Before
public void createContext() {
stateDirectory = TestUtils.tempDirectory();
context = new InternalMockProcessorContext<>(stateDirectory, Serdes.String(), Serdes.Long(), new MockRecordCollector(), new ThreadCache(new LogContext("testCache "), 0, new MockStreamsMetrics(new Metrics())));
segments = new TimestampedSegments(storeName, METRICS_SCOPE, RETENTION_PERIOD, SEGMENT_INTERVAL);
segments.openExisting(context, -1L);
}
Aggregations