use of org.apache.kafka.streams.state.internals.RocksDBWindowStoreSupplier in project kafka by apache.
the class TopologyBuilderTest method shouldAddInternalTopicConfigWithCompactAndDeleteSetForWindowStores.
@SuppressWarnings("unchecked")
@Test
public void shouldAddInternalTopicConfigWithCompactAndDeleteSetForWindowStores() throws Exception {
final TopologyBuilder builder = new TopologyBuilder();
builder.setApplicationId("appId");
builder.addSource("source", "topic");
builder.addProcessor("processor", new MockProcessorSupplier(), "source");
builder.addStateStore(new RocksDBWindowStoreSupplier("store", 30000, 3, false, null, null, 10000, true, Collections.<String, String>emptyMap(), false), "processor");
final Map<Integer, TopicsInfo> topicGroups = builder.topicGroups();
final TopicsInfo topicsInfo = topicGroups.values().iterator().next();
final InternalTopicConfig topicConfig = topicsInfo.stateChangelogTopics.get("appId-store-changelog");
final Properties properties = topicConfig.toProperties(0);
final List<String> policies = Arrays.asList(properties.getProperty(InternalTopicManager.CLEANUP_POLICY_PROP).split(","));
assertEquals("appId-store-changelog", topicConfig.name());
assertTrue(policies.contains("compact"));
assertTrue(policies.contains("delete"));
assertEquals(2, policies.size());
assertEquals("30000", properties.getProperty(InternalTopicManager.RETENTION_MS));
assertEquals(2, properties.size());
}
Aggregations