http://git-wip-us.apache.org/repos/asf/kafka-site/blob/ba6c994c/090/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html ---------------------------------------------------------------------- diff --git a/090/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html b/090/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html new file mode 100644 index 0000000..43e8baa --- /dev/null +++ b/090/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html @@ -0,0 +1,484 @@ +<!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_51) on Fri Feb 13 15:47:45 PST 2015 --> +<title>KafkaProducer (clients 0.8.3-SNAPSHOT API)</title> +<meta name="date" content="2015-02-13"> +<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="KafkaProducer (clients 0.8.3-SNAPSHOT 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/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="class in org.apache.kafka.clients.producer"><span class="strong">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../../../../index.html?org/apache/kafka/clients/producer/KafkaProducer.html" target="_top">Frames</a></li> +<li><a href="KafkaProducer.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>Nested | </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.clients.producer</div> +<h2 title="Class KafkaProducer" class="title">Class KafkaProducer<K,V></h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>org.apache.kafka.clients.producer.KafkaProducer<K,V></li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Implemented Interfaces:</dt> +<dd>java.io.Closeable, java.lang.AutoCloseable, <a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><K,V></dd> +</dl> +<hr> +<br> +<pre>public class <span class="strong">KafkaProducer<K,V></span> +extends java.lang.Object +implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><K,V></pre> +<div class="block">A Kafka client that publishes records to the Kafka cluster. + <P> + The producer is <i>thread safe</i> and should generally be shared among all threads for best performance. + <p> + The producer manages a single background thread that does I/O as well as a TCP connection to each of the brokers it + needs to communicate with. Failure to close the producer after use will leak these resources.</div> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ======== 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/clients/producer/KafkaProducer.html#KafkaProducer(java.util.Map)">KafkaProducer</a></strong>(java.util.Map<java.lang.String,java.lang.Object> configs)</code> +<div class="block">A producer is instantiated by providing a set of key-value pairs as configuration.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#KafkaProducer(java.util.Map, org.apache.kafka.common.serialization.Serializer, org.apache.kafka.common.serialization.Serializer)">KafkaProducer</a></strong>(java.util.Map<java.lang.String,java.lang.Object> configs, + <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>> keySerializer, + <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>> valueSerializer)</code> +<div class="block">A producer is instantiated by providing a set of key-value pairs as configuration, a key and a value <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization"><code>Serializer</code></a>.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#KafkaProducer(java.util.Properties)">KafkaProducer</a></strong>(java.util.Properties properties)</code> +<div class="block">A producer is instantiated by providing a set of key-value pairs as configuration.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#KafkaProducer(java.util.Properties, org.apache.kafka.common.serialization.Serializer, org.apache.kafka.common.serialization.Serializer)">KafkaProducer</a></strong>(java.util.Properties properties, + <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>> keySerializer, + <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>> valueSerializer)</code> +<div class="block">A producer is instantiated by providing a set of key-value pairs as configuration, a key and a value <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization"><code>Serializer</code></a>.</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>void</code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#close()">close</a></strong>()</code> +<div class="block">Close this producer.</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/clients/producer/KafkaProducer.html#metrics()">metrics</a></strong>()</code> +<div class="block">Return a map of metrics maintained by the producer</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>java.util.List<<a href="../../../../../org/apache/kafka/common/PartitionInfo.html" title="class in org.apache.kafka.common">PartitionInfo</a>></code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#partitionsFor(java.lang.String)">partitionsFor</a></strong>(java.lang.String topic)</code> +<div class="block">Get a list of partitions for the given topic for custom partition assignment.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>></code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord)">send</a></strong>(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>> record)</code> +<div class="block">Asynchronously send a record to a topic.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>></code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord, org.apache.kafka.clients.producer.Callback)">send</a></strong>(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>> record, + <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer">Callback</a> callback)</code> +<div class="block">Asynchronously send a record to a topic and invoke the provided callback when the send has been acknowledged.</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, toString, 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="KafkaProducer(java.util.Map)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>KafkaProducer</h4> +<pre>public KafkaProducer(java.util.Map<java.lang.String,java.lang.Object> configs)</pre> +<div class="block">A producer is instantiated by providing a set of key-value pairs as configuration. Valid configuration strings + are documented <a href="http://kafka.apache.org/documentation.html#producerconfigs">here</a>. Values can be + either strings or Objects of the appropriate type (for example a numeric configuration would accept either the + string "42" or the integer 42).</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>configs</code> - The producer configs</dd></dl> +</li> +</ul> +<a name="KafkaProducer(java.util.Map, org.apache.kafka.common.serialization.Serializer, org.apache.kafka.common.serialization.Serializer)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>KafkaProducer</h4> +<pre>public KafkaProducer(java.util.Map<java.lang.String,java.lang.Object> configs, + <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>> keySerializer, + <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>> valueSerializer)</pre> +<div class="block">A producer is instantiated by providing a set of key-value pairs as configuration, a key and a value <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization"><code>Serializer</code></a>. + Valid configuration strings are documented <a href="http://kafka.apache.org/documentation.html#producerconfigs">here</a>. + Values can be either strings or Objects of the appropriate type (for example a numeric configuration would accept + either the string "42" or the integer 42).</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>configs</code> - The producer configs</dd><dd><code>keySerializer</code> - The serializer for key that implements <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization"><code>Serializer</code></a>. The configure() method won't be + called in the producer when the serializer is passed in directly.</dd><dd><code>valueSerializer</code> - The serializer for value that implements <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization"><code>Serializer</code></a>. The configure() method won't + be called in the producer when the serializer is passed in directly.</dd></dl> +</li> +</ul> +<a name="KafkaProducer(java.util.Properties)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>KafkaProducer</h4> +<pre>public KafkaProducer(java.util.Properties properties)</pre> +<div class="block">A producer is instantiated by providing a set of key-value pairs as configuration. Valid configuration strings + are documented <a href="http://kafka.apache.org/documentation.html#producerconfigs">here</a>.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>properties</code> - The producer configs</dd></dl> +</li> +</ul> +<a name="KafkaProducer(java.util.Properties, org.apache.kafka.common.serialization.Serializer, org.apache.kafka.common.serialization.Serializer)"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>KafkaProducer</h4> +<pre>public KafkaProducer(java.util.Properties properties, + <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>> keySerializer, + <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>> valueSerializer)</pre> +<div class="block">A producer is instantiated by providing a set of key-value pairs as configuration, a key and a value <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization"><code>Serializer</code></a>. + Valid configuration strings are documented <a href="http://kafka.apache.org/documentation.html#producerconfigs">here</a>.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>properties</code> - The producer configs</dd><dd><code>keySerializer</code> - The serializer for key that implements <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization"><code>Serializer</code></a>. The configure() method won't be + called in the producer when the serializer is passed in directly.</dd><dd><code>valueSerializer</code> - The serializer for value that implements <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization"><code>Serializer</code></a>. The configure() method won't + be called in the producer when the serializer is passed in directly.</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="send(org.apache.kafka.clients.producer.ProducerRecord)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>send</h4> +<pre>public java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>> send(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>> record)</pre> +<div class="block">Asynchronously send a record to a topic. Equivalent to <a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord, org.apache.kafka.clients.producer.Callback)"><code>send(record, null)</code></a></div> +<dl> +<dt><strong>Specified by:</strong></dt> +<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#send(org.apache.kafka.clients.producer.ProducerRecord)">send</a></code> in interface <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>></code></dd> +<dt><span class="strong">Parameters:</span></dt><dd><code>record</code> - The record to be sent</dd> +<dt><span class="strong">Returns:</span></dt><dd>A future which will eventually contain the response information</dd></dl> +</li> +</ul> +<a name="send(org.apache.kafka.clients.producer.ProducerRecord, org.apache.kafka.clients.producer.Callback)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>send</h4> +<pre>public java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>> send(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>> record, + <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer">Callback</a> callback)</pre> +<div class="block">Asynchronously send a record to a topic and invoke the provided callback when the send has been acknowledged. + <p> + The send is asynchronous and this method will return immediately once the record has been stored in the buffer of + records waiting to be sent. This allows sending many records in parallel without blocking to wait for the + response after each one. + <p> + The result of the send is a <a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer"><code>RecordMetadata</code></a> specifying the partition the record was sent to and the offset + it was assigned. + <p> + Since the send call is asynchronous it returns a <code>Future</code> for the + <a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer"><code>RecordMetadata</code></a> that will be assigned to this record. Invoking <code>get()</code> on this future will result in the metadata for the record or throw any exception that occurred while + sending the record. + <p> + If you want to simulate a simple blocking call you can do the following: + + <pre><code>producer.send(new ProducerRecord<byte[],byte[]>("the-topic", "key".getBytes(), "value".getBytes())).get(); + </code></pre> + <p> + Those desiring fully non-blocking usage can make use of the <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer"><code>Callback</code></a> parameter to provide a callback that + will be invoked when the request is complete. + + <pre><code>ProducerRecord<byte[],byte[]> record = new ProducerRecord<byte[],byte[]>("the-topic", "key".getBytes(), "value".getBytes()); + producer.send(myRecord, + new Callback() { + public void onCompletion(RecordMetadata metadata, Exception e) { + if(e != null) + e.printStackTrace(); + System.out.println("The offset of the record we just sent is: " + metadata.offset()); + } + }); + </code></pre> + + Callbacks for records being sent to the same partition are guaranteed to execute in order. That is, in the + following example <code>callback1</code> is guaranteed to execute before <code>callback2</code>: + + <pre><code>producer.send(new ProducerRecord<byte[],byte[]>(topic, partition, key1, value1), callback1); + producer.send(new ProducerRecord<byte[],byte[]>(topic, partition, key2, value2), callback2); + </code></pre> + <p> + Note that callbacks will generally execute in the I/O thread of the producer and so should be reasonably fast or + they will delay the sending of messages from other threads. If you want to execute blocking or computationally + expensive callbacks it is recommended to use your own <code>Executor</code> in the callback body + to parallelize processing. + <p> + The producer manages a buffer of records waiting to be sent. This buffer has a hard limit on it's size, which is + controlled by the configuration <code>total.memory.bytes</code>. If <code>send()</code> is called faster than the + I/O thread can transfer data to the brokers the buffer will eventually run out of space. The default behavior in + this case is to block the send call until the I/O thread catches up and more buffer space is available. However + in cases where non-blocking usage is desired the setting <code>block.on.buffer.full=false</code> will cause the + producer to instead throw an exception when buffer memory is exhausted.</div> +<dl> +<dt><strong>Specified by:</strong></dt> +<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#send(org.apache.kafka.clients.producer.ProducerRecord, org.apache.kafka.clients.producer.Callback)">send</a></code> in interface <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>></code></dd> +<dt><span class="strong">Parameters:</span></dt><dd><code>record</code> - The record to send</dd><dd><code>callback</code> - A user-supplied callback to execute when the record has been acknowledged by the server (null + indicates no callback)</dd></dl> +</li> +</ul> +<a name="partitionsFor(java.lang.String)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>partitionsFor</h4> +<pre>public java.util.List<<a href="../../../../../org/apache/kafka/common/PartitionInfo.html" title="class in org.apache.kafka.common">PartitionInfo</a>> partitionsFor(java.lang.String topic)</pre> +<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#partitionsFor(java.lang.String)">Producer</a></code></strong></div> +<div class="block">Get a list of partitions for the given topic for custom partition assignment. The partition metadata will change + over time so this list should not be cached.</div> +<dl> +<dt><strong>Specified by:</strong></dt> +<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#partitionsFor(java.lang.String)">partitionsFor</a></code> in interface <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>></code></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"><strong>Description copied from interface: <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#metrics()">Producer</a></code></strong></div> +<div class="block">Return a map of metrics maintained by the producer</div> +<dl> +<dt><strong>Specified by:</strong></dt> +<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#metrics()">metrics</a></code> in interface <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>></code></dd> +</dl> +</li> +</ul> +<a name="close()"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>close</h4> +<pre>public void close()</pre> +<div class="block">Close this producer. This method blocks until all in-flight requests complete.</div> +<dl> +<dt><strong>Specified by:</strong></dt> +<dd><code>close</code> in interface <code>java.io.Closeable</code></dd> +<dt><strong>Specified by:</strong></dt> +<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd> +<dt><strong>Specified by:</strong></dt> +<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#close()">close</a></code> in interface <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>></code></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/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="class in org.apache.kafka.clients.producer"><span class="strong">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../../../../index.html?org/apache/kafka/clients/producer/KafkaProducer.html" target="_top">Frames</a></li> +<li><a href="KafkaProducer.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>Nested | </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>
http://git-wip-us.apache.org/repos/asf/kafka-site/blob/ba6c994c/090/javadoc/org/apache/kafka/clients/producer/MockProducer.html ---------------------------------------------------------------------- diff --git a/090/javadoc/org/apache/kafka/clients/producer/MockProducer.html b/090/javadoc/org/apache/kafka/clients/producer/MockProducer.html new file mode 100644 index 0000000..208869a --- /dev/null +++ b/090/javadoc/org/apache/kafka/clients/producer/MockProducer.html @@ -0,0 +1,472 @@ +<!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_51) on Fri Feb 13 15:47:45 PST 2015 --> +<title>MockProducer (clients 0.8.3-SNAPSHOT API)</title> +<meta name="date" content="2015-02-13"> +<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="MockProducer (clients 0.8.3-SNAPSHOT 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/clients/producer/KafkaProducer.html" title="class in org.apache.kafka.clients.producer"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer"><span class="strong">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../../../../index.html?org/apache/kafka/clients/producer/MockProducer.html" target="_top">Frames</a></li> +<li><a href="MockProducer.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>Nested | </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.clients.producer</div> +<h2 title="Class MockProducer" class="title">Class MockProducer</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>org.apache.kafka.clients.producer.MockProducer</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Implemented Interfaces:</dt> +<dd>java.io.Closeable, java.lang.AutoCloseable, <a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><byte[],byte[]></dd> +</dl> +<hr> +<br> +<pre>public class <span class="strong">MockProducer</span> +extends java.lang.Object +implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><byte[],byte[]></pre> +<div class="block">A mock of the producer interface you can use for testing code that uses Kafka. + <p> + By default this mock will synchronously complete each send call successfully. However it can be configured to allow + the user to control the completion of the call and supply an optional error for the producer to throw.</div> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ======== 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/clients/producer/MockProducer.html#MockProducer()">MockProducer</a></strong>()</code> +<div class="block">Create a new auto completing mock producer + + Equivalent to <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(boolean)"><code>new MockProducer(true)</code></a></div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(boolean)">MockProducer</a></strong>(boolean autoComplete)</code> +<div class="block">Create a new mock producer with invented metadata the given autoComplete setting.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(org.apache.kafka.common.Cluster, boolean)">MockProducer</a></strong>(<a href="../../../../../org/apache/kafka/common/Cluster.html" title="class in org.apache.kafka.common">Cluster</a> cluster, + boolean autoComplete)</code> +<div class="block">Create a mock producer</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>void</code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#clear()">clear</a></strong>()</code> +<div class="block">Clear the stored history of sent records</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#close()">close</a></strong>()</code> +<div class="block">Close this producer</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#completeNext()">completeNext</a></strong>()</code> +<div class="block">Complete the earliest uncompleted call successfully.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#errorNext(java.lang.RuntimeException)">errorNext</a></strong>(java.lang.RuntimeException e)</code> +<div class="block">Complete the earliest uncompleted call with the given error.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>java.util.List<<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><byte[],byte[]>></code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#history()">history</a></strong>()</code> +<div class="block">Get the list of sent records since the last call to <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#clear()"><code>clear()</code></a></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>,<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/clients/producer/MockProducer.html#metrics()">metrics</a></strong>()</code> +<div class="block">Return a map of metrics maintained by the producer</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>java.util.List<<a href="../../../../../org/apache/kafka/common/PartitionInfo.html" title="class in org.apache.kafka.common">PartitionInfo</a>></code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#partitionsFor(java.lang.String)">partitionsFor</a></strong>(java.lang.String topic)</code> +<div class="block">Get a list of partitions for the given topic for custom partition assignment.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>></code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord)">send</a></strong>(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><byte[],byte[]> record)</code> +<div class="block">Adds the record to the list of sent records.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>></code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord, org.apache.kafka.clients.producer.Callback)">send</a></strong>(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><byte[],byte[]> record, + <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer">Callback</a> callback)</code> +<div class="block">Adds the record to the list of sent records.</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, toString, 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="MockProducer(org.apache.kafka.common.Cluster, boolean)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>MockProducer</h4> +<pre>public MockProducer(<a href="../../../../../org/apache/kafka/common/Cluster.html" title="class in org.apache.kafka.common">Cluster</a> cluster, + boolean autoComplete)</pre> +<div class="block">Create a mock producer</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cluster</code> - The cluster holding metadata for this producer</dd><dd><code>autoComplete</code> - If true automatically complete all requests successfully and execute the callback. Otherwise + the user must call <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#completeNext()"><code>completeNext()</code></a> or <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#errorNext(java.lang.RuntimeException)"><code>errorNext(RuntimeException)</code></a> after + <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord)"><code>send()</code></a> to complete the call and unblock the @{link + java.util.concurrent.Future Future<RecordMetadata>} that is returned.</dd></dl> +</li> +</ul> +<a name="MockProducer(boolean)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>MockProducer</h4> +<pre>public MockProducer(boolean autoComplete)</pre> +<div class="block">Create a new mock producer with invented metadata the given autoComplete setting. + + Equivalent to <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(org.apache.kafka.common.Cluster, boolean)"><code>new MockProducer(null, autoComplete)</code></a></div> +</li> +</ul> +<a name="MockProducer()"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>MockProducer</h4> +<pre>public MockProducer()</pre> +<div class="block">Create a new auto completing mock producer + + Equivalent to <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(boolean)"><code>new MockProducer(true)</code></a></div> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="send(org.apache.kafka.clients.producer.ProducerRecord)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>send</h4> +<pre>public java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>> send(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><byte[],byte[]> record)</pre> +<div class="block">Adds the record to the list of sent records. The <a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer"><code>RecordMetadata</code></a> returned will be immediately satisfied.</div> +<dl> +<dt><strong>Specified by:</strong></dt> +<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#send(org.apache.kafka.clients.producer.ProducerRecord)">send</a></code> in interface <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><byte[],byte[]></code></dd> +<dt><span class="strong">Parameters:</span></dt><dd><code>record</code> - The record to send</dd> +<dt><span class="strong">Returns:</span></dt><dd>A future which will eventually contain the response information</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#history()"><code>history()</code></a></dd></dl> +</li> +</ul> +<a name="send(org.apache.kafka.clients.producer.ProducerRecord, org.apache.kafka.clients.producer.Callback)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>send</h4> +<pre>public java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>> send(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><byte[],byte[]> record, + <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer">Callback</a> callback)</pre> +<div class="block">Adds the record to the list of sent records.</div> +<dl> +<dt><strong>Specified by:</strong></dt> +<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#send(org.apache.kafka.clients.producer.ProducerRecord, org.apache.kafka.clients.producer.Callback)">send</a></code> in interface <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><byte[],byte[]></code></dd> +<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#history()"><code>history()</code></a></dd></dl> +</li> +</ul> +<a name="partitionsFor(java.lang.String)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>partitionsFor</h4> +<pre>public java.util.List<<a href="../../../../../org/apache/kafka/common/PartitionInfo.html" title="class in org.apache.kafka.common">PartitionInfo</a>> partitionsFor(java.lang.String topic)</pre> +<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#partitionsFor(java.lang.String)">Producer</a></code></strong></div> +<div class="block">Get a list of partitions for the given topic for custom partition assignment. The partition metadata will change + over time so this list should not be cached.</div> +<dl> +<dt><strong>Specified by:</strong></dt> +<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#partitionsFor(java.lang.String)">partitionsFor</a></code> in interface <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><byte[],byte[]></code></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>,<a href="../../../../../org/apache/kafka/common/Metric.html" title="interface in org.apache.kafka.common">Metric</a>> metrics()</pre> +<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#metrics()">Producer</a></code></strong></div> +<div class="block">Return a map of metrics maintained by the producer</div> +<dl> +<dt><strong>Specified by:</strong></dt> +<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#metrics()">metrics</a></code> in interface <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><byte[],byte[]></code></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"><strong>Description copied from interface: <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#close()">Producer</a></code></strong></div> +<div class="block">Close this producer</div> +<dl> +<dt><strong>Specified by:</strong></dt> +<dd><code>close</code> in interface <code>java.io.Closeable</code></dd> +<dt><strong>Specified by:</strong></dt> +<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd> +<dt><strong>Specified by:</strong></dt> +<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#close()">close</a></code> in interface <code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a><byte[],byte[]></code></dd> +</dl> +</li> +</ul> +<a name="history()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>history</h4> +<pre>public java.util.List<<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><byte[],byte[]>> history()</pre> +<div class="block">Get the list of sent records since the last call to <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#clear()"><code>clear()</code></a></div> +</li> +</ul> +<a name="clear()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>clear</h4> +<pre>public void clear()</pre> +<div class="block">Clear the stored history of sent records</div> +</li> +</ul> +<a name="completeNext()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>completeNext</h4> +<pre>public boolean completeNext()</pre> +<div class="block">Complete the earliest uncompleted call successfully.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>true if there was an uncompleted call to complete</dd></dl> +</li> +</ul> +<a name="errorNext(java.lang.RuntimeException)"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>errorNext</h4> +<pre>public boolean errorNext(java.lang.RuntimeException e)</pre> +<div class="block">Complete the earliest uncompleted call with the given error.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>true if there was an uncompleted call to complete</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/clients/producer/KafkaProducer.html" title="class in org.apache.kafka.clients.producer"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer"><span class="strong">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../../../../index.html?org/apache/kafka/clients/producer/MockProducer.html" target="_top">Frames</a></li> +<li><a href="MockProducer.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>Nested | </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> http://git-wip-us.apache.org/repos/asf/kafka-site/blob/ba6c994c/090/javadoc/org/apache/kafka/clients/producer/Producer.html ---------------------------------------------------------------------- diff --git a/090/javadoc/org/apache/kafka/clients/producer/Producer.html b/090/javadoc/org/apache/kafka/clients/producer/Producer.html new file mode 100644 index 0000000..e522606 --- /dev/null +++ b/090/javadoc/org/apache/kafka/clients/producer/Producer.html @@ -0,0 +1,294 @@ +<!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_51) on Fri Feb 13 15:47:45 PST 2015 --> +<title>Producer (clients 0.8.3-SNAPSHOT API)</title> +<meta name="date" content="2015-02-13"> +<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="Producer (clients 0.8.3-SNAPSHOT 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/clients/producer/MockProducer.html" title="class in org.apache.kafka.clients.producer"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../../../org/apache/kafka/clients/producer/ProducerConfig.html" title="class in org.apache.kafka.clients.producer"><span class="strong">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../../../../index.html?org/apache/kafka/clients/producer/Producer.html" target="_top">Frames</a></li> +<li><a href="Producer.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>Nested | </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method_summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li>Constr | </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.clients.producer</div> +<h2 title="Interface Producer" class="title">Interface Producer<K,V></h2> +</div> +<div class="contentContainer"> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Superinterfaces:</dt> +<dd>java.lang.AutoCloseable, java.io.Closeable</dd> +</dl> +<dl> +<dt>All Known Implementing Classes:</dt> +<dd><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="class in org.apache.kafka.clients.producer">KafkaProducer</a>, <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="class in org.apache.kafka.clients.producer">MockProducer</a></dd> +</dl> +<hr> +<br> +<pre>public interface <span class="strong">Producer<K,V></span> +extends java.io.Closeable</pre> +<div class="block">The interface for the <a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="class in org.apache.kafka.clients.producer"><code>KafkaProducer</code></a></div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="class in org.apache.kafka.clients.producer"><code>KafkaProducer</code></a>, +<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="class in org.apache.kafka.clients.producer"><code>MockProducer</code></a></dd></dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========== 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>void</code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#close()">close</a></strong>()</code> +<div class="block">Close this producer</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/clients/producer/Producer.html#metrics()">metrics</a></strong>()</code> +<div class="block">Return a map of metrics maintained by the producer</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>java.util.List<<a href="../../../../../org/apache/kafka/common/PartitionInfo.html" title="class in org.apache.kafka.common">PartitionInfo</a>></code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#partitionsFor(java.lang.String)">partitionsFor</a></strong>(java.lang.String topic)</code> +<div class="block">Get a list of partitions for the given topic for custom partition assignment.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>></code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#send(org.apache.kafka.clients.producer.ProducerRecord)">send</a></strong>(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><<a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="type parameter in Producer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="type parameter in Producer">V</a>> record)</code> +<div class="block">Send the given record asynchronously and return a future which will eventually contain the response information.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>></code></td> +<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#send(org.apache.kafka.clients.producer.ProducerRecord, org.apache.kafka.clients.producer.Callback)">send</a></strong>(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><<a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="type parameter in Producer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="type parameter in Producer">V</a>> record, + <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer">Callback</a> callback)</code> +<div class="block">Send a record and invoke the given callback when the record has been acknowledged by the server</div> +</td> +</tr> +</table> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="send(org.apache.kafka.clients.producer.ProducerRecord)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>send</h4> +<pre>java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>> send(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><<a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="type parameter in Producer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="type parameter in Producer">V</a>> record)</pre> +<div class="block">Send the given record asynchronously and return a future which will eventually contain the response information.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>record</code> - The record to send</dd> +<dt><span class="strong">Returns:</span></dt><dd>A future which will eventually contain the response information</dd></dl> +</li> +</ul> +<a name="send(org.apache.kafka.clients.producer.ProducerRecord, org.apache.kafka.clients.producer.Callback)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>send</h4> +<pre>java.util.concurrent.Future<<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>> send(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a><<a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="type parameter in Producer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="type parameter in Producer">V</a>> record, + <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer">Callback</a> callback)</pre> +<div class="block">Send a record and invoke the given callback when the record has been acknowledged by the server</div> +</li> +</ul> +<a name="partitionsFor(java.lang.String)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>partitionsFor</h4> +<pre>java.util.List<<a href="../../../../../org/apache/kafka/common/PartitionInfo.html" title="class in org.apache.kafka.common">PartitionInfo</a>> partitionsFor(java.lang.String topic)</pre> +<div class="block">Get a list of partitions for the given topic for custom partition assignment. The partition metadata will change + over time so this list should not be cached.</div> +</li> +</ul> +<a name="metrics()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>metrics</h4> +<pre>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">Return a map of metrics maintained by the producer</div> +</li> +</ul> +<a name="close()"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>close</h4> +<pre>void close()</pre> +<div class="block">Close this producer</div> +<dl> +<dt><strong>Specified by:</strong></dt> +<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd> +<dt><strong>Specified by:</strong></dt> +<dd><code>close</code> in interface <code>java.io.Closeable</code></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/clients/producer/MockProducer.html" title="class in org.apache.kafka.clients.producer"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../../../org/apache/kafka/clients/producer/ProducerConfig.html" title="class in org.apache.kafka.clients.producer"><span class="strong">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../../../../index.html?org/apache/kafka/clients/producer/Producer.html" target="_top">Frames</a></li> +<li><a href="Producer.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>Nested | </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method_summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method_detail">Method</a></li> +</ul> +</div> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
