| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (version 1.7.0_80) on Fri Nov 10 23:49:17 GMT 2017 --> |
| <title>KafkaStreams (kafka 0.11.0.2 API)</title> |
| <meta name="date" content="2017-11-10"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="KafkaStreams (kafka 0.11.0.2 API)"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar_top"> |
| <!-- --> |
| </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">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">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/kafka/streams/KafkaClientSupplier.html" title="interface in org.apache.kafka.streams"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/kafka/streams/KafkaStreams.State.html" title="enum in org.apache.kafka.streams"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/kafka/streams/KafkaStreams.html" target="_top">Frames</a></li> |
| <li><a href="KafkaStreams.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested_class_summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li><a href="#constructor_summary">Constr</a> | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor_detail">Constr</a> | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.kafka.streams</div> |
| <h2 title="Class KafkaStreams" class="title">Class KafkaStreams</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.kafka.streams.KafkaStreams</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre><a href="../../../../org/apache/kafka/common/annotation/InterfaceStability.Evolving.html" title="annotation in org.apache.kafka.common.annotation">@InterfaceStability.Evolving</a> |
| public class <span class="strong">KafkaStreams</span> |
| extends java.lang.Object</pre> |
| <div class="block">A Kafka client that allows for performing continuous computation on input coming from one or more input topics and |
| sends output to zero, one, or more output topics. |
| <p> |
| The computational logic can be specified either by using the <a href="../../../../org/apache/kafka/streams/processor/TopologyBuilder.html" title="class in org.apache.kafka.streams.processor"><code>TopologyBuilder</code></a> to define a DAG topology of |
| <a href="../../../../org/apache/kafka/streams/processor/Processor.html" title="interface in org.apache.kafka.streams.processor"><code>Processor</code></a>s or by using the <a href="../../../../org/apache/kafka/streams/kstream/KStreamBuilder.html" title="class in org.apache.kafka.streams.kstream"><code>KStreamBuilder</code></a> which provides the high-level DSL to define transformations. |
| <p> |
| One <code>KafkaStreams</code> instance can contain one or more threads specified in the configs for the processing work. |
| <p> |
| A <code>KafkaStreams</code> instance can co-ordinate with any other instances with the same |
| <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#APPLICATION_ID_CONFIG"><code>application ID</code></a> (whether in the same process, on other processes on this |
| machine, or on remote machines) as a single (possibly distributed) stream processing application. |
| These instances will divide up the work based on the assignment of the input topic partitions so that all partitions |
| are being consumed. |
| If instances are added or fail, all (remaining) instances will rebalance the partition assignment among themselves |
| to balance processing load and ensure that all input topic partitions are processed. |
| <p> |
| Internally a <code>KafkaStreams</code> instance contains a normal <a href="../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="class in org.apache.kafka.clients.producer"><code>KafkaProducer</code></a> and <a href="../../../../org/apache/kafka/clients/consumer/KafkaConsumer.html" title="class in org.apache.kafka.clients.consumer"><code>KafkaConsumer</code></a> instance |
| that is used for reading input and writing output. |
| <p> |
| A simple example might look like this: |
| <pre><code>Map<String, Object> props = new HashMap<>(); |
| props.put(StreamsConfig.APPLICATION_ID_CONFIG, "my-stream-processing-application"); |
| props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092"); |
| props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass()); |
| props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass()); |
| StreamsConfig config = new StreamsConfig(props); |
| |
| KStreamBuilder builder = new KStreamBuilder(); |
| builder.stream("my-input-topic").mapValues(value -> value.length().toString()).to("my-output-topic"); |
| |
| KafkaStreams streams = new KafkaStreams(builder, config); |
| streams.start(); |
| </code></pre></div> |
| <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/kafka/streams/kstream/KStreamBuilder.html" title="class in org.apache.kafka.streams.kstream"><code>KStreamBuilder</code></a>, |
| <a href="../../../../org/apache/kafka/streams/processor/TopologyBuilder.html" title="class in org.apache.kafka.streams.processor"><code>TopologyBuilder</code></a></dd></dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested_class_summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Class and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.State.html" title="enum in org.apache.kafka.streams">KafkaStreams.State</a></strong></code> |
| <div class="block">Kafka Streams states are the possible state that a Kafka Streams instance can be in.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static interface </code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.StateListener.html" title="interface in org.apache.kafka.streams">KafkaStreams.StateListener</a></strong></code> |
| <div class="block">Listen to <a href="../../../../org/apache/kafka/streams/KafkaStreams.State.html" title="enum in org.apache.kafka.streams"><code>KafkaStreams.State</code></a> change events.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#KafkaStreams(org.apache.kafka.streams.processor.TopologyBuilder,%20java.util.Properties)">KafkaStreams</a></strong>(<a href="../../../../org/apache/kafka/streams/processor/TopologyBuilder.html" title="class in org.apache.kafka.streams.processor">TopologyBuilder</a> builder, |
| java.util.Properties props)</code> |
| <div class="block">Create a <code>KafkaStreams</code> instance.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#KafkaStreams(org.apache.kafka.streams.processor.TopologyBuilder,%20org.apache.kafka.streams.StreamsConfig)">KafkaStreams</a></strong>(<a href="../../../../org/apache/kafka/streams/processor/TopologyBuilder.html" title="class in org.apache.kafka.streams.processor">TopologyBuilder</a> builder, |
| <a href="../../../../org/apache/kafka/streams/StreamsConfig.html" title="class in org.apache.kafka.streams">StreamsConfig</a> config)</code> |
| <div class="block">Create a <code>KafkaStreams</code> instance.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#KafkaStreams(org.apache.kafka.streams.processor.TopologyBuilder,%20org.apache.kafka.streams.StreamsConfig,%20org.apache.kafka.streams.KafkaClientSupplier)">KafkaStreams</a></strong>(<a href="../../../../org/apache/kafka/streams/processor/TopologyBuilder.html" title="class in org.apache.kafka.streams.processor">TopologyBuilder</a> builder, |
| <a href="../../../../org/apache/kafka/streams/StreamsConfig.html" title="class in org.apache.kafka.streams">StreamsConfig</a> config, |
| <a href="../../../../org/apache/kafka/streams/KafkaClientSupplier.html" title="interface in org.apache.kafka.streams">KafkaClientSupplier</a> clientSupplier)</code> |
| <div class="block">Create a <code>KafkaStreams</code> instance.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span>Methods</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>java.util.Collection<<a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state">StreamsMetadata</a>></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#allMetadata()">allMetadata</a></strong>()</code> |
| <div class="block">Find all currently running <code>KafkaStreams</code> instances (potentially remotely) that use the same |
| <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#APPLICATION_ID_CONFIG"><code>application ID</code></a> as this instance (i.e., all instances that belong to |
| the same Kafka Streams application) and return <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for each discovered instance.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>java.util.Collection<<a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state">StreamsMetadata</a>></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#allMetadataForStore(java.lang.String)">allMetadataForStore</a></strong>(java.lang.String storeName)</code> |
| <div class="block">Find all currently running <code>KafkaStreams</code> instances (potentially remotely) that |
| |
| use the same <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#APPLICATION_ID_CONFIG"><code>application ID</code></a> as this instance (i.e., all |
| instances that belong to the same Kafka Streams application) |
| and that contain a <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> with the given <code>storeName</code> |
| |
| and return <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for each discovered instance.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#cleanUp()">cleanUp</a></strong>()</code> |
| <div class="block">Do a clean up of the local <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> directory (<a href="../../../../org/apache/kafka/streams/StreamsConfig.html#STATE_DIR_CONFIG"><code>StreamsConfig.STATE_DIR_CONFIG</code></a>) by deleting all |
| data with regard to the <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#APPLICATION_ID_CONFIG"><code>application ID</code></a>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#close()">close</a></strong>()</code> |
| <div class="block">Shutdown this <code>KafkaStreams</code> instance by signaling all the threads to stop, and then wait for them to join.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#close(long,%20java.util.concurrent.TimeUnit)">close</a></strong>(long timeout, |
| java.util.concurrent.TimeUnit timeUnit)</code> |
| <div class="block">Shutdown this <code>KafkaStreams</code> by signaling all the threads to stop, and then wait up to the timeout for the |
| threads to join.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><K> <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state">StreamsMetadata</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#metadataForKey(java.lang.String,%20K,%20org.apache.kafka.common.serialization.Serializer)">metadataForKey</a></strong>(java.lang.String storeName, |
| K key, |
| <a href="../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a><K> keySerializer)</code> |
| <div class="block">Find the currently running <code>KafkaStreams</code> instance (potentially remotely) that |
| |
| use the same <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#APPLICATION_ID_CONFIG"><code>application ID</code></a> as this instance (i.e., all |
| instances that belong to the same Kafka Streams application) |
| and that contain a <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> with the given <code>storeName</code> |
| and the <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> contains the given <code>key</code> |
| |
| and return <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for it.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><K> <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state">StreamsMetadata</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#metadataForKey(java.lang.String,%20K,%20org.apache.kafka.streams.processor.StreamPartitioner)">metadataForKey</a></strong>(java.lang.String storeName, |
| K key, |
| <a href="../../../../org/apache/kafka/streams/processor/StreamPartitioner.html" title="interface in org.apache.kafka.streams.processor">StreamPartitioner</a><? super K,?> partitioner)</code> |
| <div class="block">Find the currently running <code>KafkaStreams</code> instance (potentially remotely) that |
| |
| use the same <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#APPLICATION_ID_CONFIG"><code>application ID</code></a> as this instance (i.e., all |
| instances that belong to the same Kafka Streams application) |
| and that contain a <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> with the given <code>storeName</code> |
| and the <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> contains the given <code>key</code> |
| |
| and return <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for it.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>java.util.Map<<a href="../../../../org/apache/kafka/common/MetricName.html" title="class in org.apache.kafka.common">MetricName</a>,? extends <a href="../../../../org/apache/kafka/common/Metric.html" title="interface in org.apache.kafka.common">Metric</a>></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#metrics()">metrics</a></strong>()</code> |
| <div class="block">Get read-only handle on global metrics registry.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#setStateListener(org.apache.kafka.streams.KafkaStreams.StateListener)">setStateListener</a></strong>(<a href="../../../../org/apache/kafka/streams/KafkaStreams.StateListener.html" title="interface in org.apache.kafka.streams">KafkaStreams.StateListener</a> listener)</code> |
| <div class="block">An app can set a single <a href="../../../../org/apache/kafka/streams/KafkaStreams.StateListener.html" title="interface in org.apache.kafka.streams"><code>KafkaStreams.StateListener</code></a> so that the app is notified when state changes.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler)">setUncaughtExceptionHandler</a></strong>(java.lang.Thread.UncaughtExceptionHandler eh)</code> |
| <div class="block">Set the handler invoked when a <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#NUM_STREAM_THREADS_CONFIG"><code>internal thread</code></a> abruptly |
| terminates due to an uncaught exception.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#start()">start</a></strong>()</code> |
| <div class="block">Start the <code>KafkaStreams</code> instance by starting all its threads.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/kafka/streams/KafkaStreams.State.html" title="enum in org.apache.kafka.streams">KafkaStreams.State</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#state()">state</a></strong>()</code> |
| <div class="block">Return the current <a href="../../../../org/apache/kafka/streams/KafkaStreams.State.html" title="enum in org.apache.kafka.streams"><code>KafkaStreams.State</code></a> of this <code>KafkaStreams</code> instance.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><T> T</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#store(java.lang.String,%20org.apache.kafka.streams.state.QueryableStoreType)">store</a></strong>(java.lang.String storeName, |
| <a href="../../../../org/apache/kafka/streams/state/QueryableStoreType.html" title="interface in org.apache.kafka.streams.state">QueryableStoreType</a><T> queryableStoreType)</code> |
| <div class="block">Get a facade wrapping the local <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> instances with the provided <code>storeName</code> if the Store's |
| type is accepted by the provided <a href="../../../../org/apache/kafka/streams/state/QueryableStoreType.html#accepts(org.apache.kafka.streams.processor.StateStore)"><code>queryableStoreType</code></a>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#toString()">toString</a></strong>()</code> |
| <div class="block">Produce a string representation containing useful information about this <code>KafkaStream</code> instance such as |
| thread IDs, task IDs, and a representation of the topology DAG including <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a>s (cf.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/kafka/streams/KafkaStreams.html#toString(java.lang.String)">toString</a></strong>(java.lang.String indent)</code> |
| <div class="block">Produce a string representation containing useful information about this <code>KafkaStream</code> instance such as |
| thread IDs, task IDs, and a representation of the topology DAG including <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a>s (cf.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="KafkaStreams(org.apache.kafka.streams.processor.TopologyBuilder, java.util.Properties)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>KafkaStreams</h4> |
| <pre>public KafkaStreams(<a href="../../../../org/apache/kafka/streams/processor/TopologyBuilder.html" title="class in org.apache.kafka.streams.processor">TopologyBuilder</a> builder, |
| java.util.Properties props)</pre> |
| <div class="block">Create a <code>KafkaStreams</code> instance.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>builder</code> - the processor topology builder specifying the computational logic</dd><dd><code>props</code> - properties for <a href="../../../../org/apache/kafka/streams/StreamsConfig.html" title="class in org.apache.kafka.streams"><code>StreamsConfig</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="KafkaStreams(org.apache.kafka.streams.processor.TopologyBuilder, org.apache.kafka.streams.StreamsConfig)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>KafkaStreams</h4> |
| <pre>public KafkaStreams(<a href="../../../../org/apache/kafka/streams/processor/TopologyBuilder.html" title="class in org.apache.kafka.streams.processor">TopologyBuilder</a> builder, |
| <a href="../../../../org/apache/kafka/streams/StreamsConfig.html" title="class in org.apache.kafka.streams">StreamsConfig</a> config)</pre> |
| <div class="block">Create a <code>KafkaStreams</code> instance.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>builder</code> - the processor topology builder specifying the computational logic</dd><dd><code>config</code> - the Kafka Streams configuration</dd></dl> |
| </li> |
| </ul> |
| <a name="KafkaStreams(org.apache.kafka.streams.processor.TopologyBuilder, org.apache.kafka.streams.StreamsConfig, org.apache.kafka.streams.KafkaClientSupplier)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>KafkaStreams</h4> |
| <pre>public KafkaStreams(<a href="../../../../org/apache/kafka/streams/processor/TopologyBuilder.html" title="class in org.apache.kafka.streams.processor">TopologyBuilder</a> builder, |
| <a href="../../../../org/apache/kafka/streams/StreamsConfig.html" title="class in org.apache.kafka.streams">StreamsConfig</a> config, |
| <a href="../../../../org/apache/kafka/streams/KafkaClientSupplier.html" title="interface in org.apache.kafka.streams">KafkaClientSupplier</a> clientSupplier)</pre> |
| <div class="block">Create a <code>KafkaStreams</code> instance.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>builder</code> - the processor topology builder specifying the computational logic</dd><dd><code>config</code> - the Kafka Streams configuration</dd><dd><code>clientSupplier</code> - the Kafka clients supplier which provides underlying producer and consumer clients |
| for the new <code>KafkaStreams</code> instance</dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="setStateListener(org.apache.kafka.streams.KafkaStreams.StateListener)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setStateListener</h4> |
| <pre>public void setStateListener(<a href="../../../../org/apache/kafka/streams/KafkaStreams.StateListener.html" title="interface in org.apache.kafka.streams">KafkaStreams.StateListener</a> listener)</pre> |
| <div class="block">An app can set a single <a href="../../../../org/apache/kafka/streams/KafkaStreams.StateListener.html" title="interface in org.apache.kafka.streams"><code>KafkaStreams.StateListener</code></a> so that the app is notified when state changes.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>listener</code> - a new state listener</dd></dl> |
| </li> |
| </ul> |
| <a name="state()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>state</h4> |
| <pre>public <a href="../../../../org/apache/kafka/streams/KafkaStreams.State.html" title="enum in org.apache.kafka.streams">KafkaStreams.State</a> state()</pre> |
| <div class="block">Return the current <a href="../../../../org/apache/kafka/streams/KafkaStreams.State.html" title="enum in org.apache.kafka.streams"><code>KafkaStreams.State</code></a> of this <code>KafkaStreams</code> instance.</div> |
| <dl><dt><span class="strong">Returns:</span></dt><dd>the current state of this Kafka Streams instance</dd></dl> |
| </li> |
| </ul> |
| <a name="metrics()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>metrics</h4> |
| <pre>public java.util.Map<<a href="../../../../org/apache/kafka/common/MetricName.html" title="class in org.apache.kafka.common">MetricName</a>,? extends <a href="../../../../org/apache/kafka/common/Metric.html" title="interface in org.apache.kafka.common">Metric</a>> metrics()</pre> |
| <div class="block">Get read-only handle on global metrics registry.</div> |
| <dl><dt><span class="strong">Returns:</span></dt><dd>Map of all metrics.</dd></dl> |
| </li> |
| </ul> |
| <a name="start()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>start</h4> |
| <pre>public void start() |
| throws java.lang.IllegalStateException, |
| <a href="../../../../org/apache/kafka/streams/errors/StreamsException.html" title="class in org.apache.kafka.streams.errors">StreamsException</a></pre> |
| <div class="block">Start the <code>KafkaStreams</code> instance by starting all its threads. |
| <p> |
| Note, for brokers with version <code>0.9.x</code> or lower, the broker version cannot be checked. |
| There will be no error and the client will hang and retry to verify the broker version until it |
| <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#REQUEST_TIMEOUT_MS_CONFIG"><code>times out</code></a>.</div> |
| <dl><dt><span class="strong">Throws:</span></dt> |
| <dd><code>java.lang.IllegalStateException</code> - if process was already started</dd> |
| <dd><code><a href="../../../../org/apache/kafka/streams/errors/StreamsException.html" title="class in org.apache.kafka.streams.errors">StreamsException</a></code> - if the Kafka brokers have version 0.10.0.x</dd></dl> |
| </li> |
| </ul> |
| <a name="close()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>close</h4> |
| <pre>public void close()</pre> |
| <div class="block">Shutdown this <code>KafkaStreams</code> instance by signaling all the threads to stop, and then wait for them to join. |
| This will block until all threads have stopped.</div> |
| </li> |
| </ul> |
| <a name="close(long, java.util.concurrent.TimeUnit)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>close</h4> |
| <pre>public boolean close(long timeout, |
| java.util.concurrent.TimeUnit timeUnit)</pre> |
| <div class="block">Shutdown this <code>KafkaStreams</code> by signaling all the threads to stop, and then wait up to the timeout for the |
| threads to join. |
| A <code>timeout</code> of 0 means to wait forever.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>timeout</code> - how long to wait for the threads to shutdown</dd><dd><code>timeUnit</code> - unit of time used for timeout</dd> |
| <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if all threads were successfully stopped—<code>false</code> if the timeout was reached |
| before all threads stopped |
| Note that this method must not be called in the <code>onChange</code> callback of <a href="../../../../org/apache/kafka/streams/KafkaStreams.StateListener.html" title="interface in org.apache.kafka.streams"><code>KafkaStreams.StateListener</code></a>.</dd></dl> |
| </li> |
| </ul> |
| <a name="toString()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre>public java.lang.String toString()</pre> |
| <div class="block">Produce a string representation containing useful information about this <code>KafkaStream</code> instance such as |
| thread IDs, task IDs, and a representation of the topology DAG including <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a>s (cf. |
| <a href="../../../../org/apache/kafka/streams/processor/TopologyBuilder.html" title="class in org.apache.kafka.streams.processor"><code>TopologyBuilder</code></a> and <a href="../../../../org/apache/kafka/streams/kstream/KStreamBuilder.html" title="class in org.apache.kafka.streams.kstream"><code>KStreamBuilder</code></a>).</div> |
| <dl> |
| <dt><strong>Overrides:</strong></dt> |
| <dd><code>toString</code> in class <code>java.lang.Object</code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd>A string representation of the Kafka Streams instance.</dd></dl> |
| </li> |
| </ul> |
| <a name="toString(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre>public java.lang.String toString(java.lang.String indent)</pre> |
| <div class="block">Produce a string representation containing useful information about this <code>KafkaStream</code> instance such as |
| thread IDs, task IDs, and a representation of the topology DAG including <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a>s (cf. |
| <a href="../../../../org/apache/kafka/streams/processor/TopologyBuilder.html" title="class in org.apache.kafka.streams.processor"><code>TopologyBuilder</code></a> and <a href="../../../../org/apache/kafka/streams/kstream/KStreamBuilder.html" title="class in org.apache.kafka.streams.kstream"><code>KStreamBuilder</code></a>).</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>indent</code> - the top-level indent for each line</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>A string representation of the Kafka Streams instance.</dd></dl> |
| </li> |
| </ul> |
| <a name="cleanUp()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>cleanUp</h4> |
| <pre>public void cleanUp()</pre> |
| <div class="block">Do a clean up of the local <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> directory (<a href="../../../../org/apache/kafka/streams/StreamsConfig.html#STATE_DIR_CONFIG"><code>StreamsConfig.STATE_DIR_CONFIG</code></a>) by deleting all |
| data with regard to the <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#APPLICATION_ID_CONFIG"><code>application ID</code></a>. |
| <p> |
| May only be called either before this <code>KafkaStreams</code> instance is <a href="../../../../org/apache/kafka/streams/KafkaStreams.html#start()"><code>started</code></a> or after the |
| instance is <a href="../../../../org/apache/kafka/streams/KafkaStreams.html#close()"><code>closed</code></a>. |
| <p> |
| Calling this method triggers a restore of local <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a>s on the next <a href="../../../../org/apache/kafka/streams/KafkaStreams.html#start()"><code>application start</code></a>.</div> |
| <dl><dt><span class="strong">Throws:</span></dt> |
| <dd><code>java.lang.IllegalStateException</code> - if the instance is currently running</dd></dl> |
| </li> |
| </ul> |
| <a name="setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setUncaughtExceptionHandler</h4> |
| <pre>public void setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler eh)</pre> |
| <div class="block">Set the handler invoked when a <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#NUM_STREAM_THREADS_CONFIG"><code>internal thread</code></a> abruptly |
| terminates due to an uncaught exception.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>eh</code> - the uncaught exception handler for all internal threads; <code>null</code> deletes the current handler</dd></dl> |
| </li> |
| </ul> |
| <a name="allMetadata()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>allMetadata</h4> |
| <pre>public java.util.Collection<<a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state">StreamsMetadata</a>> allMetadata()</pre> |
| <div class="block">Find all currently running <code>KafkaStreams</code> instances (potentially remotely) that use the same |
| <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#APPLICATION_ID_CONFIG"><code>application ID</code></a> as this instance (i.e., all instances that belong to |
| the same Kafka Streams application) and return <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for each discovered instance. |
| <p> |
| Note: this is a point in time view and it may change due to partition reassignment.</div> |
| <dl><dt><span class="strong">Returns:</span></dt><dd><a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for each <code>KafkaStreams</code> instances of this application</dd></dl> |
| </li> |
| </ul> |
| <a name="allMetadataForStore(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>allMetadataForStore</h4> |
| <pre>public java.util.Collection<<a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state">StreamsMetadata</a>> allMetadataForStore(java.lang.String storeName)</pre> |
| <div class="block">Find all currently running <code>KafkaStreams</code> instances (potentially remotely) that |
| <ul> |
| <li>use the same <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#APPLICATION_ID_CONFIG"><code>application ID</code></a> as this instance (i.e., all |
| instances that belong to the same Kafka Streams application)</li> |
| <li>and that contain a <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> with the given <code>storeName</code></li> |
| </ul> |
| and return <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for each discovered instance. |
| <p> |
| Note: this is a point in time view and it may change due to partition reassignment.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>storeName</code> - the <code>storeName</code> to find metadata for</dd> |
| <dt><span class="strong">Returns:</span></dt><dd><a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for each <code>KafkaStreams</code> instances with the provide <code>storeName</code> of |
| this application</dd></dl> |
| </li> |
| </ul> |
| <a name="metadataForKey(java.lang.String,java.lang.Object,org.apache.kafka.common.serialization.Serializer)"> |
| <!-- --> |
| </a><a name="metadataForKey(java.lang.String, K, org.apache.kafka.common.serialization.Serializer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>metadataForKey</h4> |
| <pre>public <K> <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state">StreamsMetadata</a> metadataForKey(java.lang.String storeName, |
| K key, |
| <a href="../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a><K> keySerializer)</pre> |
| <div class="block">Find the currently running <code>KafkaStreams</code> instance (potentially remotely) that |
| <ul> |
| <li>use the same <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#APPLICATION_ID_CONFIG"><code>application ID</code></a> as this instance (i.e., all |
| instances that belong to the same Kafka Streams application)</li> |
| <li>and that contain a <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> with the given <code>storeName</code></li> |
| <li>and the <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> contains the given <code>key</code></li> |
| </ul> |
| and return <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for it. |
| <p> |
| This will use the default Kafka Streams partitioner to locate the partition. |
| If a <a href="../../../../org/apache/kafka/streams/processor/StreamPartitioner.html" title="interface in org.apache.kafka.streams.processor"><code>custom partitioner</code></a> has been |
| <a href="../../../../org/apache/kafka/clients/producer/ProducerConfig.html#PARTITIONER_CLASS_CONFIG"><code>configured</code></a> via <a href="../../../../org/apache/kafka/streams/StreamsConfig.html" title="class in org.apache.kafka.streams"><code>StreamsConfig</code></a>, |
| <a href="../../../../org/apache/kafka/streams/kstream/KStream.html#through(org.apache.kafka.streams.processor.StreamPartitioner,%20java.lang.String)"><code>KStream.through(StreamPartitioner, String)</code></a>, or <a href="../../../../org/apache/kafka/streams/kstream/KTable.html#through(org.apache.kafka.streams.processor.StreamPartitioner,%20java.lang.String,%20java.lang.String)"><code>KTable.through(StreamPartitioner, String, String)</code></a>, |
| or if the original <a href="../../../../org/apache/kafka/streams/kstream/KTable.html" title="interface in org.apache.kafka.streams.kstream"><code>KTable</code></a>'s input <a href="../../../../org/apache/kafka/streams/kstream/KStreamBuilder.html#table(java.lang.String,%20java.lang.String)"><code>topic</code></a> is partitioned |
| differently, please use <a href="../../../../org/apache/kafka/streams/KafkaStreams.html#metadataForKey(java.lang.String,%20K,%20org.apache.kafka.streams.processor.StreamPartitioner)"><code>metadataForKey(String, Object, StreamPartitioner)</code></a>. |
| <p> |
| Note: |
| <ul> |
| <li>this is a point in time view and it may change due to partition reassignment</li> |
| <li>the key may not exist in the <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a>; this method provides a way of finding which host it |
| <em>would</em> exist on</li> |
| <li>if this is for a window store the serializer should be the serializer for the record key, |
| not the window serializer</li> |
| </ul></div> |
| <dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>K</code> - key type</dd><dt><span class="strong">Parameters:</span></dt><dd><code>storeName</code> - the <code>storeName</code> to find metadata for</dd><dd><code>key</code> - the key to find metadata for</dd><dd><code>keySerializer</code> - serializer for the key</dd> |
| <dt><span class="strong">Returns:</span></dt><dd><a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for the <code>KafkaStreams</code> instance with the provide <code>storeName</code> and |
| <code>key</code> of this application or <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html#NOT_AVAILABLE"><code>StreamsMetadata.NOT_AVAILABLE</code></a> if Kafka Streams is (re-)initializing</dd></dl> |
| </li> |
| </ul> |
| <a name="metadataForKey(java.lang.String,java.lang.Object,org.apache.kafka.streams.processor.StreamPartitioner)"> |
| <!-- --> |
| </a><a name="metadataForKey(java.lang.String, K, org.apache.kafka.streams.processor.StreamPartitioner)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>metadataForKey</h4> |
| <pre>public <K> <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state">StreamsMetadata</a> metadataForKey(java.lang.String storeName, |
| K key, |
| <a href="../../../../org/apache/kafka/streams/processor/StreamPartitioner.html" title="interface in org.apache.kafka.streams.processor">StreamPartitioner</a><? super K,?> partitioner)</pre> |
| <div class="block">Find the currently running <code>KafkaStreams</code> instance (potentially remotely) that |
| <ul> |
| <li>use the same <a href="../../../../org/apache/kafka/streams/StreamsConfig.html#APPLICATION_ID_CONFIG"><code>application ID</code></a> as this instance (i.e., all |
| instances that belong to the same Kafka Streams application)</li> |
| <li>and that contain a <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> with the given <code>storeName</code></li> |
| <li>and the <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> contains the given <code>key</code></li> |
| </ul> |
| and return <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for it. |
| <p> |
| Note: |
| <ul> |
| <li>this is a point in time view and it may change due to partition reassignment</li> |
| <li>the key may not exist in the <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a>; this method provides a way of finding which host it |
| <em>would</em> exist on</li> |
| </ul></div> |
| <dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>K</code> - key type</dd><dt><span class="strong">Parameters:</span></dt><dd><code>storeName</code> - the <code>storeName</code> to find metadata for</dd><dd><code>key</code> - the key to find metadata for</dd><dd><code>partitioner</code> - the partitioner to be use to locate the host for the key</dd> |
| <dt><span class="strong">Returns:</span></dt><dd><a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html" title="class in org.apache.kafka.streams.state"><code>StreamsMetadata</code></a> for the <code>KafkaStreams</code> instance with the provide <code>storeName</code> and |
| <code>key</code> of this application or <a href="../../../../org/apache/kafka/streams/state/StreamsMetadata.html#NOT_AVAILABLE"><code>StreamsMetadata.NOT_AVAILABLE</code></a> if Kafka Streams is (re-)initializing</dd></dl> |
| </li> |
| </ul> |
| <a name="store(java.lang.String, org.apache.kafka.streams.state.QueryableStoreType)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>store</h4> |
| <pre>public <T> T store(java.lang.String storeName, |
| <a href="../../../../org/apache/kafka/streams/state/QueryableStoreType.html" title="interface in org.apache.kafka.streams.state">QueryableStoreType</a><T> queryableStoreType)</pre> |
| <div class="block">Get a facade wrapping the local <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> instances with the provided <code>storeName</code> if the Store's |
| type is accepted by the provided <a href="../../../../org/apache/kafka/streams/state/QueryableStoreType.html#accepts(org.apache.kafka.streams.processor.StateStore)"><code>queryableStoreType</code></a>. |
| The returned object can be used to query the <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> instances.</div> |
| <dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - return type</dd><dt><span class="strong">Parameters:</span></dt><dd><code>storeName</code> - name of the store to find</dd><dd><code>queryableStoreType</code> - accept only stores that are accepted by <a href="../../../../org/apache/kafka/streams/state/QueryableStoreType.html#accepts(org.apache.kafka.streams.processor.StateStore)"><code>QueryableStoreType.accepts(StateStore)</code></a></dd> |
| <dt><span class="strong">Returns:</span></dt><dd>A facade wrapping the local <a href="../../../../org/apache/kafka/streams/processor/StateStore.html" title="interface in org.apache.kafka.streams.processor"><code>StateStore</code></a> instances</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../org/apache/kafka/streams/errors/InvalidStateStoreException.html" title="class in org.apache.kafka.streams.errors">InvalidStateStoreException</a></code> - if Kafka Streams is (re-)initializing or a store with <code>storeName</code> and |
| <code>queryableStoreType</code> doesnt' exist</dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar_bottom"> |
| <!-- --> |
| </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">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">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/kafka/streams/KafkaClientSupplier.html" title="interface in org.apache.kafka.streams"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/kafka/streams/KafkaStreams.State.html" title="enum in org.apache.kafka.streams"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/kafka/streams/KafkaStreams.html" target="_top">Frames</a></li> |
| <li><a href="KafkaStreams.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested_class_summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li><a href="#constructor_summary">Constr</a> | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor_detail">Constr</a> | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |