use of org.apache.kafka.common.utils.LogContext in project apache-kafka-on-k8s by banzaicloud.
the class KStreamSessionWindowAggregateProcessorTest method initializeStore.
@Before
public void initializeStore() {
final File stateDir = TestUtils.tempDirectory();
context = new InternalMockProcessorContext(stateDir, Serdes.String(), Serdes.String(), new NoOpRecordCollector(), new ThreadCache(new LogContext("testCache "), 100000, new MockStreamsMetrics(new Metrics()))) {
@Override
public <K, V> void forward(final K key, final V value) {
results.add(KeyValue.pair(key, value));
}
};
initStore(true);
processor.init(context);
}
use of org.apache.kafka.common.utils.LogContext in project apache-kafka-on-k8s by banzaicloud.
the class AbstractCoordinatorTest method setupCoordinator.
private void setupCoordinator(long retryBackoffMs) {
this.mockTime = new MockTime();
this.mockClient = new MockClient(mockTime);
Metadata metadata = new Metadata(100L, 60 * 60 * 1000L, true);
this.consumerClient = new ConsumerNetworkClient(new LogContext(), mockClient, metadata, mockTime, retryBackoffMs, REQUEST_TIMEOUT_MS, HEARTBEAT_INTERVAL_MS);
Metrics metrics = new Metrics();
Cluster cluster = TestUtils.singletonCluster("topic", 1);
metadata.update(cluster, Collections.<String>emptySet(), mockTime.milliseconds());
this.node = cluster.nodes().get(0);
mockClient.setNode(node);
this.coordinatorNode = new Node(Integer.MAX_VALUE - node.id(), node.host(), node.port());
this.coordinator = new DummyCoordinator(consumerClient, metrics, mockTime);
}
use of org.apache.kafka.common.utils.LogContext in project apache-kafka-on-k8s by banzaicloud.
the class RocksDBSegmentedBytesStoreTest method before.
@Before
public void before() {
schema.init("topic");
bytesStore = new RocksDBSegmentedBytesStore(storeName, retention, numSegments, schema);
stateDir = TestUtils.tempDirectory();
context = new InternalMockProcessorContext(stateDir, Serdes.String(), Serdes.Long(), new NoOpRecordCollector(), new ThreadCache(new LogContext("testCache "), 0, new MockStreamsMetrics(new Metrics())));
bytesStore.init(context, bytesStore);
}
use of org.apache.kafka.common.utils.LogContext in project apache-kafka-on-k8s by banzaicloud.
the class RocksDBSessionStoreTest method before.
@Before
public void before() {
final SessionKeySchema schema = new SessionKeySchema();
schema.init("topic");
final RocksDBSegmentedBytesStore bytesStore = new RocksDBSegmentedBytesStore("session-store", 10000L, 3, schema);
sessionStore = new RocksDBSessionStore<>(bytesStore, Serdes.String(), Serdes.Long());
context = new InternalMockProcessorContext(TestUtils.tempDirectory(), Serdes.String(), Serdes.Long(), new NoOpRecordCollector(), new ThreadCache(new LogContext("testCache "), 0, new MockStreamsMetrics(new Metrics())));
sessionStore.init(context, sessionStore);
}
use of org.apache.kafka.common.utils.LogContext in project apache-kafka-on-k8s by banzaicloud.
the class RocksDBStoreTest method shouldThrowProcessorStateExceptionOnOpeningReadOnlyDir.
@Test(expected = ProcessorStateException.class)
public void shouldThrowProcessorStateExceptionOnOpeningReadOnlyDir() throws IOException {
final File tmpDir = TestUtils.tempDirectory();
InternalMockProcessorContext tmpContext = new InternalMockProcessorContext(tmpDir, Serdes.String(), Serdes.Long(), new NoOpRecordCollector(), new ThreadCache(new LogContext("testCache "), 0, new MockStreamsMetrics(new Metrics())));
tmpDir.setReadOnly();
rocksDBStore.openDB(tmpContext);
}
Aggregations