blob: 1f13937cc2e29eae4eca229f4ec5ce22aec2cda9 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (21) -->
<title>TopologyTestDriver (kafka 4.0.1 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.kafka.streams, class: TopologyTestDriver">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var pathtoroot = "../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html#class">Help</a></li>
</ul>
<ul class="sub-nav-list-small">
<li>
<p>Summary:</p>
<ul>
<li>Nested</li>
<li>Field</li>
<li><a href="#constructor-summary">Constr</a></li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li>Field</li>
<li><a href="#constructor-detail">Constr</a></li>
<li><a href="#method-detail">Method</a></li>
</ul>
</li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list">
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><a href="../../../../search.html">SEARCH</a>
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.kafka.streams</a></div>
<h1 title="Class TopologyTestDriver" class="title">Class TopologyTestDriver</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">org.apache.kafka.streams.TopologyTestDriver</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/Closeable.html" title="class or interface in java.io" class="external-link">Closeable</a></code>, <code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/AutoCloseable.html" title="class or interface in java.lang" class="external-link">AutoCloseable</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">TopologyTestDriver</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
implements <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/Closeable.html" title="class or interface in java.io" class="external-link">Closeable</a></span></div>
<div class="block">This class makes it easier to write tests to verify the behavior of topologies created with <a href="Topology.html" title="class in org.apache.kafka.streams"><code>Topology</code></a> or
<a href="StreamsBuilder.html" title="class in org.apache.kafka.streams"><code>StreamsBuilder</code></a>.
You can test simple topologies that have a single processor, or very complex topologies that have multiple sources,
processors, sinks, or sub-topologies.
Best of all, the class works without a real Kafka broker, so the tests execute very quickly with very little overhead.
<p>
Using the <code>TopologyTestDriver</code> in tests is easy: simply instantiate the driver and provide a <a href="Topology.html" title="class in org.apache.kafka.streams"><code>Topology</code></a>
(cf. <a href="StreamsBuilder.html#build()"><code>StreamsBuilder.build()</code></a>) and <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Properties.html" title="class or interface in java.util" class="external-link"><code>config</code></a>, <a href="#createInputTopic(java.lang.String,org.apache.kafka.common.serialization.Serializer,org.apache.kafka.common.serialization.Serializer)"><code>create</code></a>
and use a <a href="TestInputTopic.html" title="class in org.apache.kafka.streams"><code>TestInputTopic</code></a> to supply an input records to the topology,
and then <a href="#createOutputTopic(java.lang.String,org.apache.kafka.common.serialization.Deserializer,org.apache.kafka.common.serialization.Deserializer)"><code>create</code></a> and use a <a href="TestOutputTopic.html" title="class in org.apache.kafka.streams"><code>TestOutputTopic</code></a> to read and
verify any output records by the topology.
<p>
Although the driver doesn't use a real Kafka broker, it does simulate Kafka <a href="../clients/consumer/Consumer.html" title="interface in org.apache.kafka.clients.consumer"><code>consumers</code></a> and
<a href="../clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer"><code>producers</code></a> that read and write raw <code>byte[]</code> messages.
You can let <a href="TestInputTopic.html" title="class in org.apache.kafka.streams"><code>TestInputTopic</code></a> and <a href="TestOutputTopic.html" title="class in org.apache.kafka.streams"><code>TestOutputTopic</code></a> to handle conversion
form regular Java objects to raw bytes.
<h2 id="driver-setup-heading">Driver setup</h2>
In order to create a <code>TopologyTestDriver</code> instance, you need a <a href="Topology.html" title="class in org.apache.kafka.streams"><code>Topology</code></a> and a <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Properties.html" title="class or interface in java.util" class="external-link"><code>config</code></a>.
The configuration needs to be representative of what you'd supply to the real topology, so that means including
several key properties (cf. <a href="StreamsConfig.html" title="class in org.apache.kafka.streams"><code>StreamsConfig</code></a>).
For example, the following code fragment creates a configuration that specifies a timestamp extractor,
default serializers and deserializers for string keys and values:
<pre><code>
Properties props = new Properties();
props.setProperty(StreamsConfig.DEFAULT_TIMESTAMP_EXTRACTOR_CLASS_CONFIG, CustomTimestampExtractor.class.getName());
props.setProperty(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
props.setProperty(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
Topology topology = ...
TopologyTestDriver driver = new TopologyTestDriver(topology, props);
</code></pre>
<p> Note that the <code>TopologyTestDriver</code> processes input records synchronously.
This implies that <a href="StreamsConfig.html#COMMIT_INTERVAL_MS_CONFIG"><code>commit.interval.ms</code></a> and
<a href="StreamsConfig.html#STATESTORE_CACHE_MAX_BYTES_CONFIG"><code>cache.max.bytes.buffering</code></a> configuration have no effect.
The driver behaves as if both configs would be set to zero, i.e., as if a "commit" (and thus "flush") would happen
after each input record.
<h2 id="processing-messages-heading">Processing messages</h2>
<p>
Your test can supply new input records on any of the topics that the topology's sources consume.
This test driver simulates single-partitioned input topics.
Here's an example of an input message on the topic named <code>input-topic</code>:
<pre><code>
TestInputTopic&lt;String, String&gt; inputTopic = driver.createInputTopic("input-topic", stringSerdeSerializer, stringSerializer);
inputTopic.pipeInput("key1", "value1");
</code></pre>
When <a href="TestInputTopic.html#pipeInput(K,V)"><code>TestInputTopic.pipeInput(Object, Object)</code></a> is called, the driver passes the input message through to the appropriate source that
consumes the named topic, and will invoke the processor(s) downstream of the source.
If your topology's processors forward messages to sinks, your test can then consume these output messages to verify
they match the expected outcome.
For example, if our topology should have generated 2 messages on <code>output-topic-1</code> and 1 message on
<code>output-topic-2</code>, then our test can obtain these messages using the
<a href="TestOutputTopic.html#readKeyValue()"><code>TestOutputTopic.readKeyValue()</code></a> method:
<pre><code>
TestOutputTopic&lt;String, String&gt; outputTopic1 = driver.createOutputTopic("output-topic-1", stringDeserializer, stringDeserializer);
TestOutputTopic&lt;String, String&gt; outputTopic2 = driver.createOutputTopic("output-topic-2", stringDeserializer, stringDeserializer);
KeyValue&lt;String, String&gt; record1 = outputTopic1.readKeyValue();
KeyValue&lt;String, String&gt; record2 = outputTopic2.readKeyValue();
KeyValue&lt;String, String&gt; record3 = outputTopic1.readKeyValue();
</code></pre>
Again, our example topology generates messages with string keys and values, so we supply our string deserializer
instance for use on both the keys and values. Your test logic can then verify whether these output records are
correct.
<p>
Note, that calling <code>pipeInput()</code> will also trigger <a href="processor/PunctuationType.html#STREAM_TIME"><code>event-time</code></a> base
<a href="processor/api/ProcessingContext.html#schedule(java.time.Duration,org.apache.kafka.streams.processor.PunctuationType,org.apache.kafka.streams.processor.Punctuator)"><code>punctuation</code></a> callbacks.
However, you won't trigger <a href="processor/PunctuationType.html#WALL_CLOCK_TIME"><code>wall-clock</code></a> type punctuations that you must
trigger manually via <a href="#advanceWallClockTime(java.time.Duration)"><code>advanceWallClockTime(Duration)</code></a>.
<p>
Finally, when completed, make sure your tests <a href="#close()"><code>close()</code></a> the driver to release all resources and
<a href="processor/api/Processor.html" title="interface in org.apache.kafka.streams.processor.api"><code>processors</code></a>.
<h2 id="processor-state-heading">Processor state</h2>
<p>
Some processors use Kafka <a href="processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>state storage</code></a>, so this driver class provides the generic
<a href="#getStateStore(java.lang.String)"><code>getStateStore(String)</code></a> as well as store-type specific methods so that your tests can check the underlying
state store(s) used by your topology's processors.
In our previous example, after we supplied a single input message and checked the three output messages, our test
could also check the key value store to verify the processor correctly added, removed, or updated internal state.
Or, our test might have pre-populated some state <em>before</em> submitting the input message, and verified afterward
that the processor(s) correctly updated the state.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="TestInputTopic.html" title="class in org.apache.kafka.streams"><code>TestInputTopic</code></a></li>
<li><a href="TestOutputTopic.html" title="class in org.apache.kafka.streams"><code>TestOutputTopic</code></a></li>
</ul>
</dd>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.apache.kafka.streams.Topology)" class="member-name-link">TopologyTestDriver</a><wbr>(<a href="Topology.html" title="class in org.apache.kafka.streams">Topology</a>&nbsp;topology)</code></div>
<div class="col-last even-row-color">
<div class="block">Create a new test diver instance.</div>
</div>
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.apache.kafka.streams.Topology,java.time.Instant)" class="member-name-link">TopologyTestDriver</a><wbr>(<a href="Topology.html" title="class in org.apache.kafka.streams">Topology</a>&nbsp;topology,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Instant.html" title="class or interface in java.time" class="external-link">Instant</a>&nbsp;initialWallClockTimeMs)</code></div>
<div class="col-last odd-row-color">
<div class="block">Create a new test diver instance.</div>
</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.apache.kafka.streams.Topology,java.util.Properties)" class="member-name-link">TopologyTestDriver</a><wbr>(<a href="Topology.html" title="class in org.apache.kafka.streams">Topology</a>&nbsp;topology,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a>&nbsp;config)</code></div>
<div class="col-last even-row-color">
<div class="block">Create a new test diver instance.</div>
</div>
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.apache.kafka.streams.Topology,java.util.Properties,java.time.Instant)" class="member-name-link">TopologyTestDriver</a><wbr>(<a href="Topology.html" title="class in org.apache.kafka.streams">Topology</a>&nbsp;topology,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a>&nbsp;config,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Instant.html" title="class or interface in java.time" class="external-link">Instant</a>&nbsp;initialWallClockTime)</code></div>
<div class="col-last odd-row-color">
<div class="block">Create a new test diver instance.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel" aria-labelledby="method-summary-table-tab0">
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#advanceWallClockTime(java.time.Duration)" class="member-name-link">advanceWallClockTime</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a>&nbsp;advance)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Advances the internally mocked wall-clock time.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#close()" class="member-name-link">close</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Close the driver, its topology, and all processors.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final &lt;K,<wbr>
V&gt;&nbsp;<a href="TestInputTopic.html" title="class in org.apache.kafka.streams">TestInputTopic</a><wbr>&lt;K,<wbr>V&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#createInputTopic(java.lang.String,org.apache.kafka.common.serialization.Serializer,org.apache.kafka.common.serialization.Serializer)" class="member-name-link">createInputTopic</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;topicName,
<a href="../common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;K&gt;&nbsp;keySerializer,
<a href="../common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;V&gt;&nbsp;valueSerializer)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Create <a href="TestInputTopic.html" title="class in org.apache.kafka.streams"><code>TestInputTopic</code></a> to be used for piping records to topic
Uses current system time as start timestamp for records.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final &lt;K,<wbr>
V&gt;&nbsp;<a href="TestInputTopic.html" title="class in org.apache.kafka.streams">TestInputTopic</a><wbr>&lt;K,<wbr>V&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#createInputTopic(java.lang.String,org.apache.kafka.common.serialization.Serializer,org.apache.kafka.common.serialization.Serializer,java.time.Instant,java.time.Duration)" class="member-name-link">createInputTopic</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;topicName,
<a href="../common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;K&gt;&nbsp;keySerializer,
<a href="../common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;V&gt;&nbsp;valueSerializer,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Instant.html" title="class or interface in java.time" class="external-link">Instant</a>&nbsp;startTimestamp,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a>&nbsp;autoAdvance)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Create <a href="TestInputTopic.html" title="class in org.apache.kafka.streams"><code>TestInputTopic</code></a> to be used for piping records to topic
Uses provided start timestamp and autoAdvance parameter for records</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final &lt;K,<wbr>
V&gt;&nbsp;<a href="TestOutputTopic.html" title="class in org.apache.kafka.streams">TestOutputTopic</a><wbr>&lt;K,<wbr>V&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#createOutputTopic(java.lang.String,org.apache.kafka.common.serialization.Deserializer,org.apache.kafka.common.serialization.Deserializer)" class="member-name-link">createOutputTopic</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;topicName,
<a href="../common/serialization/Deserializer.html" title="interface in org.apache.kafka.common.serialization">Deserializer</a>&lt;K&gt;&nbsp;keyDeserializer,
<a href="../common/serialization/Deserializer.html" title="interface in org.apache.kafka.common.serialization">Deserializer</a>&lt;V&gt;&nbsp;valueDeserializer)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Create <a href="TestOutputTopic.html" title="class in org.apache.kafka.streams"><code>TestOutputTopic</code></a> to be used for reading records from topic</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><wbr>&lt;<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="processor/StateStore.html" title="interface in org.apache.kafka.streams.processor">StateStore</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAllStateStores()" class="member-name-link">getAllStateStores</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get all <a href="processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStores</code></a> from the topology.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;K,<wbr>
V&gt;&nbsp;<a href="state/KeyValueStore.html" title="interface in org.apache.kafka.streams.state">KeyValueStore</a><wbr>&lt;K,<wbr>V&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getKeyValueStore(java.lang.String)" class="member-name-link">getKeyValueStore</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the <a href="state/KeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>KeyValueStore</code></a> or <a href="state/TimestampedKeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedKeyValueStore</code></a> with the given name.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;K,<wbr>
V&gt;&nbsp;<a href="state/SessionStore.html" title="interface in org.apache.kafka.streams.state">SessionStore</a><wbr>&lt;K,<wbr>V&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSessionStore(java.lang.String)" class="member-name-link">getSessionStore</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the <a href="state/SessionStore.html" title="interface in org.apache.kafka.streams.state"><code>SessionStore</code></a> with the given name.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="processor/StateStore.html" title="interface in org.apache.kafka.streams.processor">StateStore</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getStateStore(java.lang.String)" class="member-name-link">getStateStore</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the <a href="processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> with the given name.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;K,<wbr>
V&gt;&nbsp;<a href="state/KeyValueStore.html" title="interface in org.apache.kafka.streams.state">KeyValueStore</a><wbr>&lt;K,<wbr><a href="state/ValueAndTimestamp.html" title="class in org.apache.kafka.streams.state">ValueAndTimestamp</a>&lt;V&gt;&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTimestampedKeyValueStore(java.lang.String)" class="member-name-link">getTimestampedKeyValueStore</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the <a href="state/TimestampedKeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedKeyValueStore</code></a> with the given name.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;K,<wbr>
V&gt;&nbsp;<a href="state/WindowStore.html" title="interface in org.apache.kafka.streams.state">WindowStore</a><wbr>&lt;K,<wbr><a href="state/ValueAndTimestamp.html" title="class in org.apache.kafka.streams.state">ValueAndTimestamp</a>&lt;V&gt;&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTimestampedWindowStore(java.lang.String)" class="member-name-link">getTimestampedWindowStore</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the <a href="state/TimestampedWindowStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedWindowStore</code></a> with the given name.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;K,<wbr>
V&gt;&nbsp;<a href="state/VersionedKeyValueStore.html" title="interface in org.apache.kafka.streams.state">VersionedKeyValueStore</a><wbr>&lt;K,<wbr>V&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getVersionedKeyValueStore(java.lang.String)" class="member-name-link">getVersionedKeyValueStore</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the <a href="state/VersionedKeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>VersionedKeyValueStore</code></a> with the given name.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;K,<wbr>
V&gt;&nbsp;<a href="state/WindowStore.html" title="interface in org.apache.kafka.streams.state">WindowStore</a><wbr>&lt;K,<wbr>V&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getWindowStore(java.lang.String)" class="member-name-link">getWindowStore</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the <a href="state/WindowStore.html" title="interface in org.apache.kafka.streams.state"><code>WindowStore</code></a> or <a href="state/TimestampedWindowStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedWindowStore</code></a> with the given name.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><wbr>&lt;<a href="../common/MetricName.html" title="class in org.apache.kafka.common">MetricName</a>,<wbr>? extends <a href="../common/Metric.html" title="interface in org.apache.kafka.common">Metric</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#metrics()" class="member-name-link">metrics</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get read-only handle on global metrics registry.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><wbr>&lt;<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#producedTopicNames()" class="member-name-link">producedTopicNames</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get all the names of all the topics to which records have been produced during the test run.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(org.apache.kafka.streams.Topology)">
<h3>TopologyTestDriver</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">TopologyTestDriver</span><wbr><span class="parameters">(<a href="Topology.html" title="class in org.apache.kafka.streams">Topology</a>&nbsp;topology)</span></div>
<div class="block">Create a new test diver instance.
Default test properties are used to initialize the driver instance</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>topology</code> - the topology to be tested</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(org.apache.kafka.streams.Topology,java.util.Properties)">
<h3>TopologyTestDriver</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">TopologyTestDriver</span><wbr><span class="parameters">(<a href="Topology.html" title="class in org.apache.kafka.streams">Topology</a>&nbsp;topology,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a>&nbsp;config)</span></div>
<div class="block">Create a new test diver instance.
Initialized the internally mocked wall-clock time with <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/System.html#currentTimeMillis()" title="class or interface in java.lang" class="external-link"><code>current system time</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>topology</code> - the topology to be tested</dd>
<dd><code>config</code> - the configuration for the topology</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(org.apache.kafka.streams.Topology,java.time.Instant)">
<h3>TopologyTestDriver</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">TopologyTestDriver</span><wbr><span class="parameters">(<a href="Topology.html" title="class in org.apache.kafka.streams">Topology</a>&nbsp;topology,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Instant.html" title="class or interface in java.time" class="external-link">Instant</a>&nbsp;initialWallClockTimeMs)</span></div>
<div class="block">Create a new test diver instance.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>topology</code> - the topology to be tested</dd>
<dd><code>initialWallClockTimeMs</code> - the initial value of internally mocked wall-clock time</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(org.apache.kafka.streams.Topology,java.util.Properties,java.time.Instant)">
<h3>TopologyTestDriver</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">TopologyTestDriver</span><wbr><span class="parameters">(<a href="Topology.html" title="class in org.apache.kafka.streams">Topology</a>&nbsp;topology,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a>&nbsp;config,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Instant.html" title="class or interface in java.time" class="external-link">Instant</a>&nbsp;initialWallClockTime)</span></div>
<div class="block">Create a new test diver instance.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>topology</code> - the topology to be tested</dd>
<dd><code>config</code> - the configuration for the topology</dd>
<dd><code>initialWallClockTime</code> - the initial value of internally mocked wall-clock time</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="metrics()">
<h3>metrics</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="../common/MetricName.html" title="class in org.apache.kafka.common">MetricName</a>,<wbr>? extends <a href="../common/Metric.html" title="interface in org.apache.kafka.common">Metric</a>&gt;</span>&nbsp;<span class="element-name">metrics</span>()</div>
<div class="block">Get read-only handle on global metrics registry.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>Map of all metrics.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="advanceWallClockTime(java.time.Duration)">
<h3>advanceWallClockTime</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">advanceWallClockTime</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a>&nbsp;advance)</span></div>
<div class="block">Advances the internally mocked wall-clock time.
This might trigger a <a href="processor/PunctuationType.html#WALL_CLOCK_TIME"><code>wall-clock</code></a> type
<a href="processor/api/ProcessingContext.html#schedule(java.time.Duration,org.apache.kafka.streams.processor.PunctuationType,org.apache.kafka.streams.processor.Punctuator)"><code>punctuations</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>advance</code> - the amount of time to advance wall-clock time</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createInputTopic(java.lang.String,org.apache.kafka.common.serialization.Serializer,org.apache.kafka.common.serialization.Serializer)">
<h3>createInputTopic</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="type-parameters">&lt;K,<wbr>
V&gt;</span>&nbsp;<span class="return-type"><a href="TestInputTopic.html" title="class in org.apache.kafka.streams">TestInputTopic</a>&lt;K,<wbr>V&gt;</span>&nbsp;<span class="element-name">createInputTopic</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;topicName,
<a href="../common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;K&gt;&nbsp;keySerializer,
<a href="../common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;V&gt;&nbsp;valueSerializer)</span></div>
<div class="block">Create <a href="TestInputTopic.html" title="class in org.apache.kafka.streams"><code>TestInputTopic</code></a> to be used for piping records to topic
Uses current system time as start timestamp for records.
Auto-advance is disabled.</div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>K</code> - the key type</dd>
<dd><code>V</code> - the value type</dd>
<dt>Parameters:</dt>
<dd><code>topicName</code> - the name of the topic</dd>
<dd><code>keySerializer</code> - the Serializer for the key type</dd>
<dd><code>valueSerializer</code> - the Serializer for the value type</dd>
<dt>Returns:</dt>
<dd><a href="TestInputTopic.html" title="class in org.apache.kafka.streams"><code>TestInputTopic</code></a> object</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createInputTopic(java.lang.String,org.apache.kafka.common.serialization.Serializer,org.apache.kafka.common.serialization.Serializer,java.time.Instant,java.time.Duration)">
<h3>createInputTopic</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="type-parameters">&lt;K,<wbr>
V&gt;</span>&nbsp;<span class="return-type"><a href="TestInputTopic.html" title="class in org.apache.kafka.streams">TestInputTopic</a>&lt;K,<wbr>V&gt;</span>&nbsp;<span class="element-name">createInputTopic</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;topicName,
<a href="../common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;K&gt;&nbsp;keySerializer,
<a href="../common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;V&gt;&nbsp;valueSerializer,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Instant.html" title="class or interface in java.time" class="external-link">Instant</a>&nbsp;startTimestamp,
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a>&nbsp;autoAdvance)</span></div>
<div class="block">Create <a href="TestInputTopic.html" title="class in org.apache.kafka.streams"><code>TestInputTopic</code></a> to be used for piping records to topic
Uses provided start timestamp and autoAdvance parameter for records</div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>K</code> - the key type</dd>
<dd><code>V</code> - the value type</dd>
<dt>Parameters:</dt>
<dd><code>topicName</code> - the name of the topic</dd>
<dd><code>keySerializer</code> - the Serializer for the key type</dd>
<dd><code>valueSerializer</code> - the Serializer for the value type</dd>
<dd><code>startTimestamp</code> - Start timestamp for auto-generated record time</dd>
<dd><code>autoAdvance</code> - autoAdvance duration for auto-generated record time</dd>
<dt>Returns:</dt>
<dd><a href="TestInputTopic.html" title="class in org.apache.kafka.streams"><code>TestInputTopic</code></a> object</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createOutputTopic(java.lang.String,org.apache.kafka.common.serialization.Deserializer,org.apache.kafka.common.serialization.Deserializer)">
<h3>createOutputTopic</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="type-parameters">&lt;K,<wbr>
V&gt;</span>&nbsp;<span class="return-type"><a href="TestOutputTopic.html" title="class in org.apache.kafka.streams">TestOutputTopic</a>&lt;K,<wbr>V&gt;</span>&nbsp;<span class="element-name">createOutputTopic</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;topicName,
<a href="../common/serialization/Deserializer.html" title="interface in org.apache.kafka.common.serialization">Deserializer</a>&lt;K&gt;&nbsp;keyDeserializer,
<a href="../common/serialization/Deserializer.html" title="interface in org.apache.kafka.common.serialization">Deserializer</a>&lt;V&gt;&nbsp;valueDeserializer)</span></div>
<div class="block">Create <a href="TestOutputTopic.html" title="class in org.apache.kafka.streams"><code>TestOutputTopic</code></a> to be used for reading records from topic</div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>K</code> - the key type</dd>
<dd><code>V</code> - the value type</dd>
<dt>Parameters:</dt>
<dd><code>topicName</code> - the name of the topic</dd>
<dd><code>keyDeserializer</code> - the Deserializer for the key type</dd>
<dd><code>valueDeserializer</code> - the Deserializer for the value type</dd>
<dt>Returns:</dt>
<dd><a href="TestOutputTopic.html" title="class in org.apache.kafka.streams"><code>TestOutputTopic</code></a> object</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="producedTopicNames()">
<h3>producedTopicNames</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a>&lt;<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;</span>&nbsp;<span class="element-name">producedTopicNames</span>()</div>
<div class="block">Get all the names of all the topics to which records have been produced during the test run.
<p>
Call this method after piping the input into the test driver to retrieve the full set of topic names the topology
produced records to.
<p>
The returned set of topic names may include user (e.g., output) and internal (e.g., changelog, repartition) topic
names.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the set of topic names the topology has produced to</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getAllStateStores()">
<h3>getAllStateStores</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="processor/StateStore.html" title="interface in org.apache.kafka.streams.processor">StateStore</a>&gt;</span>&nbsp;<span class="element-name">getAllStateStores</span>()</div>
<div class="block">Get all <a href="processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStores</code></a> from the topology.
The stores can be a "regular" or global stores.
<p>
This is often useful in test cases to pre-populate the store before the test case instructs the topology to
<a href="TestInputTopic.html#pipeInput(org.apache.kafka.streams.test.TestRecord)"><code>TestInputTopic.pipeInput(TestRecord)</code></a> process an input message}, and/or to check the store afterward.
<p>
Note, that <code>StateStore</code> might be <code>null</code> if a store is added but not connected to any processor.
<p>
<strong>Caution:</strong> Using this method to access stores that are added by the DSL is unsafe as the store
types may change. Stores added by the DSL should only be accessed via the corresponding typed methods
like <a href="#getKeyValueStore(java.lang.String)"><code>getKeyValueStore(String)</code></a> etc.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>all stores my name</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getStateStore(java.lang.String)"><code>getStateStore(String)</code></a></li>
<li><a href="#getKeyValueStore(java.lang.String)"><code>getKeyValueStore(String)</code></a></li>
<li><a href="#getTimestampedKeyValueStore(java.lang.String)"><code>getTimestampedKeyValueStore(String)</code></a></li>
<li><a href="#getVersionedKeyValueStore(java.lang.String)"><code>getVersionedKeyValueStore(String)</code></a></li>
<li><a href="#getWindowStore(java.lang.String)"><code>getWindowStore(String)</code></a></li>
<li><a href="#getTimestampedWindowStore(java.lang.String)"><code>getTimestampedWindowStore(String)</code></a></li>
<li><a href="#getSessionStore(java.lang.String)"><code>getSessionStore(String)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getStateStore(java.lang.String)">
<h3>getStateStore</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="processor/StateStore.html" title="interface in org.apache.kafka.streams.processor">StateStore</a></span>&nbsp;<span class="element-name">getStateStore</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
<div class="block">Get the <a href="processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> with the given name.
The store can be a "regular" or global store.
<p>
Should be used for custom stores only.
For built-in stores, the corresponding typed methods like <a href="#getKeyValueStore(java.lang.String)"><code>getKeyValueStore(String)</code></a> should be used.
<p>
This is often useful in test cases to pre-populate the store before the test case instructs the topology to
<a href="TestInputTopic.html#pipeInput(org.apache.kafka.streams.test.TestRecord)"><code>process an input message</code></a>, and/or to check the store afterward.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - the name of the store</dd>
<dt>Returns:</dt>
<dd>the state store, or <code>null</code> if no store has been registered with the given name</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the store is a built-in store like <a href="state/KeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>KeyValueStore</code></a>,
<a href="state/WindowStore.html" title="interface in org.apache.kafka.streams.state"><code>WindowStore</code></a>, or <a href="state/SessionStore.html" title="interface in org.apache.kafka.streams.state"><code>SessionStore</code></a></dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getAllStateStores()"><code>getAllStateStores()</code></a></li>
<li><a href="#getKeyValueStore(java.lang.String)"><code>getKeyValueStore(String)</code></a></li>
<li><a href="#getTimestampedKeyValueStore(java.lang.String)"><code>getTimestampedKeyValueStore(String)</code></a></li>
<li><a href="#getVersionedKeyValueStore(java.lang.String)"><code>getVersionedKeyValueStore(String)</code></a></li>
<li><a href="#getWindowStore(java.lang.String)"><code>getWindowStore(String)</code></a></li>
<li><a href="#getTimestampedWindowStore(java.lang.String)"><code>getTimestampedWindowStore(String)</code></a></li>
<li><a href="#getSessionStore(java.lang.String)"><code>getSessionStore(String)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getKeyValueStore(java.lang.String)">
<h3>getKeyValueStore</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;K,<wbr>
V&gt;</span>&nbsp;<span class="return-type"><a href="state/KeyValueStore.html" title="interface in org.apache.kafka.streams.state">KeyValueStore</a>&lt;K,<wbr>V&gt;</span>&nbsp;<span class="element-name">getKeyValueStore</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span></div>
<div class="block">Get the <a href="state/KeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>KeyValueStore</code></a> or <a href="state/TimestampedKeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedKeyValueStore</code></a> with the given name.
The store can be a "regular" or global store.
<p>
If the registered store is a <a href="state/TimestampedKeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedKeyValueStore</code></a> this method will return a value-only query
interface. <strong>It is highly recommended to update the code for this case to avoid bugs and to use
<a href="#getTimestampedKeyValueStore(java.lang.String)"><code>getTimestampedKeyValueStore(String)</code></a> for full store access instead.</strong>
<p>
This is often useful in test cases to pre-populate the store before the test case instructs the topology to
<a href="TestInputTopic.html#pipeInput(org.apache.kafka.streams.test.TestRecord)"><code>process an input message</code></a>, and/or to check the store afterward.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - the name of the store</dd>
<dt>Returns:</dt>
<dd>the key value store, or <code>null</code> if no <a href="state/KeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>KeyValueStore</code></a> or <a href="state/TimestampedKeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedKeyValueStore</code></a>
has been registered with the given name</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getAllStateStores()"><code>getAllStateStores()</code></a></li>
<li><a href="#getStateStore(java.lang.String)"><code>getStateStore(String)</code></a></li>
<li><a href="#getTimestampedKeyValueStore(java.lang.String)"><code>getTimestampedKeyValueStore(String)</code></a></li>
<li><a href="#getVersionedKeyValueStore(java.lang.String)"><code>getVersionedKeyValueStore(String)</code></a></li>
<li><a href="#getWindowStore(java.lang.String)"><code>getWindowStore(String)</code></a></li>
<li><a href="#getTimestampedWindowStore(java.lang.String)"><code>getTimestampedWindowStore(String)</code></a></li>
<li><a href="#getSessionStore(java.lang.String)"><code>getSessionStore(String)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getTimestampedKeyValueStore(java.lang.String)">
<h3>getTimestampedKeyValueStore</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;K,<wbr>
V&gt;</span>&nbsp;<span class="return-type"><a href="state/KeyValueStore.html" title="interface in org.apache.kafka.streams.state">KeyValueStore</a>&lt;K,<wbr><a href="state/ValueAndTimestamp.html" title="class in org.apache.kafka.streams.state">ValueAndTimestamp</a>&lt;V&gt;&gt;</span>&nbsp;<span class="element-name">getTimestampedKeyValueStore</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span></div>
<div class="block">Get the <a href="state/TimestampedKeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedKeyValueStore</code></a> with the given name.
The store can be a "regular" or global store.
<p>
This is often useful in test cases to pre-populate the store before the test case instructs the topology to
<a href="TestInputTopic.html#pipeInput(org.apache.kafka.streams.test.TestRecord)"><code>process an input message</code></a>, and/or to check the store afterward.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - the name of the store</dd>
<dt>Returns:</dt>
<dd>the key value store, or <code>null</code> if no <a href="state/TimestampedKeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedKeyValueStore</code></a> has been registered with the given name</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getAllStateStores()"><code>getAllStateStores()</code></a></li>
<li><a href="#getStateStore(java.lang.String)"><code>getStateStore(String)</code></a></li>
<li><a href="#getKeyValueStore(java.lang.String)"><code>getKeyValueStore(String)</code></a></li>
<li><a href="#getVersionedKeyValueStore(java.lang.String)"><code>getVersionedKeyValueStore(String)</code></a></li>
<li><a href="#getWindowStore(java.lang.String)"><code>getWindowStore(String)</code></a></li>
<li><a href="#getTimestampedWindowStore(java.lang.String)"><code>getTimestampedWindowStore(String)</code></a></li>
<li><a href="#getSessionStore(java.lang.String)"><code>getSessionStore(String)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getVersionedKeyValueStore(java.lang.String)">
<h3>getVersionedKeyValueStore</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;K,<wbr>
V&gt;</span>&nbsp;<span class="return-type"><a href="state/VersionedKeyValueStore.html" title="interface in org.apache.kafka.streams.state">VersionedKeyValueStore</a>&lt;K,<wbr>V&gt;</span>&nbsp;<span class="element-name">getVersionedKeyValueStore</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span></div>
<div class="block">Get the <a href="state/VersionedKeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>VersionedKeyValueStore</code></a> with the given name.
The store can be a "regular" or global store.
<p>
This is often useful in test cases to pre-populate the store before the test case instructs the topology to
<a href="TestInputTopic.html#pipeInput(org.apache.kafka.streams.test.TestRecord)"><code>process an input message</code></a>, and/or to check the store afterward.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - the name of the store</dd>
<dt>Returns:</dt>
<dd>the key value store, or <code>null</code> if no <a href="state/VersionedKeyValueStore.html" title="interface in org.apache.kafka.streams.state"><code>VersionedKeyValueStore</code></a> has been registered with the given name</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getAllStateStores()"><code>getAllStateStores()</code></a></li>
<li><a href="#getStateStore(java.lang.String)"><code>getStateStore(String)</code></a></li>
<li><a href="#getKeyValueStore(java.lang.String)"><code>getKeyValueStore(String)</code></a></li>
<li><a href="#getTimestampedKeyValueStore(java.lang.String)"><code>getTimestampedKeyValueStore(String)</code></a></li>
<li><a href="#getWindowStore(java.lang.String)"><code>getWindowStore(String)</code></a></li>
<li><a href="#getTimestampedWindowStore(java.lang.String)"><code>getTimestampedWindowStore(String)</code></a></li>
<li><a href="#getSessionStore(java.lang.String)"><code>getSessionStore(String)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getWindowStore(java.lang.String)">
<h3>getWindowStore</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;K,<wbr>
V&gt;</span>&nbsp;<span class="return-type"><a href="state/WindowStore.html" title="interface in org.apache.kafka.streams.state">WindowStore</a>&lt;K,<wbr>V&gt;</span>&nbsp;<span class="element-name">getWindowStore</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span></div>
<div class="block">Get the <a href="state/WindowStore.html" title="interface in org.apache.kafka.streams.state"><code>WindowStore</code></a> or <a href="state/TimestampedWindowStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedWindowStore</code></a> with the given name.
The store can be a "regular" or global store.
<p>
If the registered store is a <a href="state/TimestampedWindowStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedWindowStore</code></a> this method will return a value-only query
interface. <strong>It is highly recommended to update the code for this case to avoid bugs and to use
<a href="#getTimestampedWindowStore(java.lang.String)"><code>getTimestampedWindowStore(String)</code></a> for full store access instead.</strong>
<p>
This is often useful in test cases to pre-populate the store before the test case instructs the topology to
<a href="TestInputTopic.html#pipeInput(org.apache.kafka.streams.test.TestRecord)"><code>process an input message</code></a>, and/or to check the store afterward.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - the name of the store</dd>
<dt>Returns:</dt>
<dd>the key value store, or <code>null</code> if no <a href="state/WindowStore.html" title="interface in org.apache.kafka.streams.state"><code>WindowStore</code></a> or <a href="state/TimestampedWindowStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedWindowStore</code></a>
has been registered with the given name</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getAllStateStores()"><code>getAllStateStores()</code></a></li>
<li><a href="#getStateStore(java.lang.String)"><code>getStateStore(String)</code></a></li>
<li><a href="#getKeyValueStore(java.lang.String)"><code>getKeyValueStore(String)</code></a></li>
<li><a href="#getTimestampedKeyValueStore(java.lang.String)"><code>getTimestampedKeyValueStore(String)</code></a></li>
<li><a href="#getVersionedKeyValueStore(java.lang.String)"><code>getVersionedKeyValueStore(String)</code></a></li>
<li><a href="#getTimestampedWindowStore(java.lang.String)"><code>getTimestampedWindowStore(String)</code></a></li>
<li><a href="#getSessionStore(java.lang.String)"><code>getSessionStore(String)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getTimestampedWindowStore(java.lang.String)">
<h3>getTimestampedWindowStore</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;K,<wbr>
V&gt;</span>&nbsp;<span class="return-type"><a href="state/WindowStore.html" title="interface in org.apache.kafka.streams.state">WindowStore</a>&lt;K,<wbr><a href="state/ValueAndTimestamp.html" title="class in org.apache.kafka.streams.state">ValueAndTimestamp</a>&lt;V&gt;&gt;</span>&nbsp;<span class="element-name">getTimestampedWindowStore</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span></div>
<div class="block">Get the <a href="state/TimestampedWindowStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedWindowStore</code></a> with the given name.
The store can be a "regular" or global store.
<p>
This is often useful in test cases to pre-populate the store before the test case instructs the topology to
<a href="TestInputTopic.html#pipeInput(org.apache.kafka.streams.test.TestRecord)"><code>process an input message</code></a>, and/or to check the store afterward.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - the name of the store</dd>
<dt>Returns:</dt>
<dd>the key value store, or <code>null</code> if no <a href="state/TimestampedWindowStore.html" title="interface in org.apache.kafka.streams.state"><code>TimestampedWindowStore</code></a> has been registered with the given name</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getAllStateStores()"><code>getAllStateStores()</code></a></li>
<li><a href="#getStateStore(java.lang.String)"><code>getStateStore(String)</code></a></li>
<li><a href="#getKeyValueStore(java.lang.String)"><code>getKeyValueStore(String)</code></a></li>
<li><a href="#getTimestampedKeyValueStore(java.lang.String)"><code>getTimestampedKeyValueStore(String)</code></a></li>
<li><a href="#getVersionedKeyValueStore(java.lang.String)"><code>getVersionedKeyValueStore(String)</code></a></li>
<li><a href="#getWindowStore(java.lang.String)"><code>getWindowStore(String)</code></a></li>
<li><a href="#getSessionStore(java.lang.String)"><code>getSessionStore(String)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getSessionStore(java.lang.String)">
<h3>getSessionStore</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;K,<wbr>
V&gt;</span>&nbsp;<span class="return-type"><a href="state/SessionStore.html" title="interface in org.apache.kafka.streams.state">SessionStore</a>&lt;K,<wbr>V&gt;</span>&nbsp;<span class="element-name">getSessionStore</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span></div>
<div class="block">Get the <a href="state/SessionStore.html" title="interface in org.apache.kafka.streams.state"><code>SessionStore</code></a> with the given name.
The store can be a "regular" or global store.
<p>
This is often useful in test cases to pre-populate the store before the test case instructs the topology to
<a href="TestInputTopic.html#pipeInput(org.apache.kafka.streams.test.TestRecord)"><code>process an input message</code></a>, and/or to check the store afterward.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>name</code> - the name of the store</dd>
<dt>Returns:</dt>
<dd>the key value store, or <code>null</code> if no <a href="state/SessionStore.html" title="interface in org.apache.kafka.streams.state"><code>SessionStore</code></a> has been registered with the given name</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getAllStateStores()"><code>getAllStateStores()</code></a></li>
<li><a href="#getStateStore(java.lang.String)"><code>getStateStore(String)</code></a></li>
<li><a href="#getKeyValueStore(java.lang.String)"><code>getKeyValueStore(String)</code></a></li>
<li><a href="#getTimestampedKeyValueStore(java.lang.String)"><code>getTimestampedKeyValueStore(String)</code></a></li>
<li><a href="#getVersionedKeyValueStore(java.lang.String)"><code>getVersionedKeyValueStore(String)</code></a></li>
<li><a href="#getWindowStore(java.lang.String)"><code>getWindowStore(String)</code></a></li>
<li><a href="#getTimestampedWindowStore(java.lang.String)"><code>getTimestampedWindowStore(String)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="close()">
<h3>close</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">close</span>()</div>
<div class="block">Close the driver, its topology, and all processors.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/AutoCloseable.html#close()" title="class or interface in java.lang" class="external-link">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/AutoCloseable.html" title="class or interface in java.lang" class="external-link">AutoCloseable</a></code></dd>
<dt>Specified by:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/Closeable.html#close()" title="class or interface in java.io" class="external-link">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/Closeable.html" title="class or interface in java.io" class="external-link">Closeable</a></code></dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>