You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ju...@apache.org on 2015/11/13 18:40:31 UTC

[09/17] kafka-site git commit: update 0.9.0 docs

http://git-wip-us.apache.org/repos/asf/kafka-site/blob/e047c4b2/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
index 43e8baa..6544c17 100644
--- a/090/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html
+++ b/090/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html
@@ -2,15 +2,15 @@
 <!-- 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">
+<!-- Generated by javadoc (version 1.7.0_80) on Fri Nov 13 08:33:05 PST 2015 -->
+<title>KafkaProducer (clients 0.9.0.0 API)</title>
+<meta name="date" content="2015-11-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)";
+        parent.document.title="KafkaProducer (clients 0.9.0.0 API)";
     }
 //-->
 </script>
@@ -104,10 +104,65 @@ extends java.lang.Object
 implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;K,V&gt;</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.
+ The producer is <i>thread safe</i> and sharing a single producer instance across threads will generally be faster than
+ having multiple instances.
  <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>
+ Here is a simple example of using the producer to send records with strings containing sequential numbers as the key/value
+ pairs.
+ <pre>
+ <code>Properties props = new Properties();
+ props.put("bootstrap.servers", "localhost:4242");
+ props.put("acks", "all");
+ props.put("retries", 0);
+ props.put("batch.size", 16384);
+ props.put("linger.ms", 1);
+ props.put("buffer.memory", 33554432);
+ props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
+ props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
+
+ Producer&lt;String, String&gt; producer = new KafkaProducer(props);
+ for(int i = 0; i &lt; 100; i++)
+     producer.send(new ProducerRecord&lt;String, String&gt;("my-topic", Integer.toString(i), Integer.toString(i)));
+
+ producer.close();
+ </code></pre>
+ <p>
+ The producer consists of a pool of buffer space that holds records that haven't yet been transmitted to the server
+ as well as a background I/O thread that is responsible for turning these records into requests and transmitting them
+ to the cluster. Failure to close the producer after use will leak these resources.
+ <p>
+ The <a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord)"><code>send()</code></a> method is asynchronous. When called it adds the record to a buffer of pending record sends
+ and immediately returns. This allows the producer to batch together individual records for efficiency.
+ <p>
+ The <code>acks</code> config controls the criteria under which requests are considered complete. The "all" setting
+ we have specified will result in blocking on the full commit of the record, the slowest but most durable setting.
+ <p>
+ If the request fails, the producer can automatically retry, though since we have specified <code>retries</code>
+ as 0 it won't. Enabling retries also opens up the possibility of duplicates (see the documentation on
+ <a href="http://kafka.apache.org/documentation.html#semantics">message delivery semantics</a> for details).
+ <p>
+ The producer maintains buffers of unsent records for each partition. These buffers are of a size specified by
+ the <code>batch.size</code> config. Making this larger can result in more batching, but requires more memory (since we will
+ generally have one of these buffers for each active partition).
+ <p>
+ By default a buffer is available to send immediately even if there is additional unused space in the buffer. However if you
+ want to reduce the number of requests you can set <code>linger.ms</code> to something greater than 0. This will
+ instruct the producer to wait up to that number of milliseconds before sending a request in hope that more records will
+ arrive to fill up the same batch. This is analogous to Nagle's algorithm in TCP. For example, in the code snippet above,
+ likely all 100 records would be sent in a single request since we set our linger time to 1 millisecond. However this setting
+ would add 1 millisecond of latency to our request waiting for more records to arrive if we didn't fill up the buffer. Note that
+ records that arrive close together in time will generally batch together even with <code>linger.ms=0</code> so under heavy load
+ batching will occur regardless of the linger configuration; however setting this to something larger than 0 can lead to fewer, more
+ efficient requests when not under maximal load at the cost of a small amount of latency.
+ <p>
+ The <code>buffer.memory</code> controls the total amount of memory available to the producer for buffering. If records
+ are sent faster than they can be transmitted to the server then this buffer space will be exhausted. When the buffer space is
+ exhausted additional send calls will block. For uses where you want to avoid any blocking you can set <code>block.on.buffer.full=false</code> which
+ will cause the send call to result in an exception.
+ <p>
+ The <code>key.serializer</code> and <code>value.serializer</code> instruct how to turn the key and value objects the user provides with
+ their <code>ProducerRecord</code> into bytes. You can use the included <a href="../../../../../org/apache/kafka/common/serialization/ByteArraySerializer.html" title="class in org.apache.kafka.common.serialization"><code>ByteArraySerializer</code></a> or
+ <a href="../../../../../org/apache/kafka/common/serialization/StringSerializer.html" title="class in org.apache.kafka.common.serialization"><code>StringSerializer</code></a> for simple string or byte types.</div>
 </li>
 </ul>
 </div>
@@ -131,7 +186,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 </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&lt;java.lang.String,java.lang.Object&gt;&nbsp;configs,
+<td class="colOne"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#KafkaProducer(java.util.Map,%20org.apache.kafka.common.serialization.Serializer,%20org.apache.kafka.common.serialization.Serializer)">KafkaProducer</a></strong>(java.util.Map&lt;java.lang.String,java.lang.Object&gt;&nbsp;configs,
              <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>&gt;&nbsp;keySerializer,
              <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>&gt;&nbsp;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>
@@ -143,7 +198,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 </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&nbsp;properties,
+<td class="colOne"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#KafkaProducer(java.util.Properties,%20org.apache.kafka.common.serialization.Serializer,%20org.apache.kafka.common.serialization.Serializer)">KafkaProducer</a></strong>(java.util.Properties&nbsp;properties,
              <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>&gt;&nbsp;keySerializer,
              <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>&gt;&nbsp;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>
@@ -171,15 +226,29 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 </td>
 </tr>
 <tr class="rowColor">
+<td class="colFirst"><code>void</code></td>
+<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#close(long,%20java.util.concurrent.TimeUnit)">close</a></strong>(long&nbsp;timeout,
+     java.util.concurrent.TimeUnit&nbsp;timeUnit)</code>
+<div class="block">This method waits up to <code>timeout</code> for the producer to complete the sending of all incomplete requests.</div>
+</td>
+</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#flush()">flush</a></strong>()</code>
+<div class="block">Invoking this method makes all buffered records immediately available to send (even if <code>linger.ms</code> is
+ greater than 0) and blocks on the completion of the requests associated with these records.</div>
+</td>
+</tr>
+<tr class="rowColor">
 <td class="colFirst"><code>java.util.Map&lt;<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>&gt;</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>
+<div class="block">Get the full set of internal metrics maintained by the producer.</div>
 </td>
 </tr>
 <tr class="altColor">
 <td class="colFirst"><code>java.util.List&lt;<a href="../../../../../org/apache/kafka/common/PartitionInfo.html" title="class in org.apache.kafka.common">PartitionInfo</a>&gt;</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&nbsp;topic)</code>
-<div class="block">Get a list of partitions for the given topic for custom partition assignment.</div>
+<div class="block">Get the partition metadata for the give topic.</div>
 </td>
 </tr>
 <tr class="rowColor">
@@ -190,7 +259,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 </tr>
 <tr class="altColor">
 <td class="colFirst"><code>java.util.concurrent.Future&lt;<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>&gt;</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>&lt;<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>&gt;&nbsp;record,
+<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord,%20org.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>&lt;<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>&gt;&nbsp;record,
     <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer">Callback</a>&nbsp;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>
@@ -225,7 +294,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <h4>KafkaProducer</h4>
 <pre>public&nbsp;KafkaProducer(java.util.Map&lt;java.lang.String,java.lang.Object&gt;&nbsp;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
+ are documented <a href="http://kafka.apache.org/documentation.html#newproducerconfigs">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>
@@ -241,7 +310,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
              <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>&gt;&nbsp;keySerializer,
              <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>&gt;&nbsp;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>.
+ Valid configuration strings are documented <a href="http://kafka.apache.org/documentation.html#newproducerconfigs">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
@@ -257,7 +326,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <h4>KafkaProducer</h4>
 <pre>public&nbsp;KafkaProducer(java.util.Properties&nbsp;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>
+ are documented <a href="http://kafka.apache.org/documentation.html#newproducerconfigs">here</a>.</div>
 <dl><dt><span class="strong">Parameters:</span></dt><dd><code>properties</code> - The producer configs</dd></dl>
 </li>
 </ul>
@@ -271,7 +340,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
              <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">K</a>&gt;&nbsp;keySerializer,
              <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html" title="type parameter in KafkaProducer">V</a>&gt;&nbsp;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>
+ Valid configuration strings are documented <a href="http://kafka.apache.org/documentation.html#newproducerconfigs">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>
@@ -292,11 +361,12 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <li class="blockList">
 <h4>send</h4>
 <pre>public&nbsp;java.util.concurrent.Future&lt;<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>&gt;&nbsp;send(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a>&lt;<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>&gt;&nbsp;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>
+<div class="block">Asynchronously send a record to a topic. Equivalent to <code>send(record, null)</code>.
+ See <a href="../../../../../org/apache/kafka/clients/producer/KafkaProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord,%20org.apache.kafka.clients.producer.Callback)"><code>send(ProducerRecord, Callback)</code></a> for details.</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>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<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>&gt;</code></dd>
-<dt><span class="strong">Parameters:</span></dt><dd><code>record</code> - The record to be sent</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></dl>
 </li>
 </ul>
@@ -318,51 +388,93 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
  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.
+ <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 block until the associated request completes and then return 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&lt;byte[],byte[]&gt;("the-topic", "key".getBytes(), "value".getBytes())).get();
+ If you want to simulate a simple blocking call you can call the <code>get()</code> method immediately:
+
+ <pre>
+ <code>byte[] key = "key".getBytes();
+ byte[] value = "value".getBytes();
+ ProducerRecord&lt;byte[],byte[]&gt; record = new ProducerRecord&lt;byte[],byte[]&gt;("my-topic", key, value)
+ producer.send(record).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
+ 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&lt;byte[],byte[]&gt; record = new ProducerRecord&lt;byte[],byte[]&gt;("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>
- 
+
+ <pre>
+ <code>ProducerRecord&lt;byte[],byte[]&gt; record = new ProducerRecord&lt;byte[],byte[]&gt;("the-topic", key, value);
+ 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&lt;byte[],byte[]&gt;(topic, partition, key1, value1), callback1);
+
+ <pre>
+ <code>producer.send(new ProducerRecord&lt;byte[],byte[]&gt;(topic, partition, key1, value1), callback1);
  producer.send(new ProducerRecord&lt;byte[],byte[]&gt;(topic, partition, key2, value2), callback2);
- </code></pre>
+ </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>
+ to parallelize processing.</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>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<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>&gt;</code></dd>
+<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#send(org.apache.kafka.clients.producer.ProducerRecord,%20org.apache.kafka.clients.producer.Callback)">send</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<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>&gt;</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>
+        indicates no callback)</dd>
+<dt><span class="strong">Throws:</span></dt>
+<dd><code><a href="../../../../../org/apache/kafka/common/errors/InterruptException.html" title="class in org.apache.kafka.common.errors">InterruptException</a></code> - If the thread is interrupted while blocked</dd>
+<dd><code><a href="../../../../../org/apache/kafka/common/errors/SerializationException.html" title="class in org.apache.kafka.common.errors">SerializationException</a></code> - If the key or value are not valid objects given the configured serializers</dd>
+<dd><code><a href="../../../../../org/apache/kafka/clients/producer/BufferExhaustedException.html" title="class in org.apache.kafka.clients.producer">BufferExhaustedException</a></code> - If <code>block.on.buffer.full=false</code> and the buffer is full.</dd></dl>
+</li>
+</ul>
+<a name="flush()">
+<!--   -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>flush</h4>
+<pre>public&nbsp;void&nbsp;flush()</pre>
+<div class="block">Invoking this method makes all buffered records immediately available to send (even if <code>linger.ms</code> is
+ greater than 0) and blocks on the completion of the requests associated with these records. The post-condition
+ of <code>flush()</code> is that any previously sent record will have completed (e.g. <code>Future.isDone() == true</code>).
+ A request is considered completed when it is successfully acknowledged
+ according to the <code>acks</code> configuration you have specified or else it results in an error.
+ <p>
+ Other threads can continue sending records while one thread is blocked waiting for a flush call to complete,
+ however no guarantee is made about the completion of records sent after the flush call begins.
+ <p>
+ This method can be useful when consuming from some input system and producing into Kafka. The <code>flush()</code> call
+ gives a convenient way to ensure all previously sent messages have actually completed.
+ <p>
+ This example shows how to consume from one Kafka topic and produce to another Kafka topic:
+ <pre>
+ <code>for(ConsumerRecord&lt;String, String&gt; record: consumer.poll(100))
+     producer.send(new ProducerRecord("my-topic", record.key(), record.value());
+ producer.flush();
+ consumer.commit();
+ </code>
+ </pre>
+
+ Note that the above example may drop records if the produce request fails. If we want to ensure that this does not occur
+ we need to set <code>retries=&lt;large_number&gt;</code> in our config.</div>
+<dl>
+<dt><strong>Specified by:</strong></dt>
+<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#flush()">flush</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<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>&gt;</code></dd>
+<dt><span class="strong">Throws:</span></dt>
+<dd><code><a href="../../../../../org/apache/kafka/common/errors/InterruptException.html" title="class in org.apache.kafka.common.errors">InterruptException</a></code> - If the thread is interrupted while blocked</dd></dl>
 </li>
 </ul>
 <a name="partitionsFor(java.lang.String)">
@@ -372,13 +484,12 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <li class="blockList">
 <h4>partitionsFor</h4>
 <pre>public&nbsp;java.util.List&lt;<a href="../../../../../org/apache/kafka/common/PartitionInfo.html" title="class in org.apache.kafka.common">PartitionInfo</a>&gt;&nbsp;partitionsFor(java.lang.String&nbsp;topic)</pre>
-<div class="block"><strong>Description copied from interface:&nbsp;<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>
+<div class="block">Get the partition metadata for the give topic. This can be used for custom partitioning.</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>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<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>&gt;</code></dd>
-</dl>
+<dt><span class="strong">Throws:</span></dt>
+<dd><code><a href="../../../../../org/apache/kafka/common/errors/InterruptException.html" title="class in org.apache.kafka.common.errors">InterruptException</a></code> - If the thread is interrupted while blocked</dd></dl>
 </li>
 </ul>
 <a name="metrics()">
@@ -388,8 +499,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <li class="blockList">
 <h4>metrics</h4>
 <pre>public&nbsp;java.util.Map&lt;<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>&gt;&nbsp;metrics()</pre>
-<div class="block"><strong>Description copied from interface:&nbsp;<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>
+<div class="block">Get the full set of internal 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>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<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>&gt;</code></dd>
@@ -399,11 +509,17 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <a name="close()">
 <!--   -->
 </a>
-<ul class="blockListLast">
+<ul class="blockList">
 <li class="blockList">
 <h4>close</h4>
 <pre>public&nbsp;void&nbsp;close()</pre>
-<div class="block">Close this producer. This method blocks until all in-flight requests complete.</div>
+<div class="block">Close this producer. This method blocks until all previously sent requests complete.
+ This method is equivalent to <code>close(Long.MAX_VALUE, TimeUnit.MILLISECONDS)</code>.
+ <p>
+ <strong>If close() is called from <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer"><code>Callback</code></a>, a warning message will be logged and close(0, TimeUnit.MILLISECONDS)
+ will be called instead. We do this because the sender thread would otherwise try to join itself and
+ block forever.</strong>
+ <p></div>
 <dl>
 <dt><strong>Specified by:</strong></dt>
 <dd><code>close</code>&nbsp;in interface&nbsp;<code>java.io.Closeable</code></dd>
@@ -411,7 +527,34 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <dd><code>close</code>&nbsp;in interface&nbsp;<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>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<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>&gt;</code></dd>
-</dl>
+<dt><span class="strong">Throws:</span></dt>
+<dd><code><a href="../../../../../org/apache/kafka/common/errors/InterruptException.html" title="class in org.apache.kafka.common.errors">InterruptException</a></code> - If the thread is interrupted while blocked</dd></dl>
+</li>
+</ul>
+<a name="close(long, java.util.concurrent.TimeUnit)">
+<!--   -->
+</a>
+<ul class="blockListLast">
+<li class="blockList">
+<h4>close</h4>
+<pre>public&nbsp;void&nbsp;close(long&nbsp;timeout,
+         java.util.concurrent.TimeUnit&nbsp;timeUnit)</pre>
+<div class="block">This method waits up to <code>timeout</code> for the producer to complete the sending of all incomplete requests.
+ <p>
+ If the producer is unable to complete all requests before the timeout expires, this method will fail
+ any unsent and unacknowledged records immediately.
+ <p>
+ If invoked from within a <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer"><code>Callback</code></a> this method will not block and will be equivalent to
+ <code>close(0, TimeUnit.MILLISECONDS)</code>. This is done since no further sending will happen while
+ blocking the I/O thread of the producer.</div>
+<dl>
+<dt><strong>Specified by:</strong></dt>
+<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#close(long,%20java.util.concurrent.TimeUnit)">close</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<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>&gt;</code></dd>
+<dt><span class="strong">Parameters:</span></dt><dd><code>timeout</code> - The maximum time to wait for producer to complete any pending requests. The value should be
+                non-negative. Specifying a timeout of zero means do not wait for pending send requests to complete.</dd><dd><code>timeUnit</code> - The time unit for the <code>timeout</code></dd>
+<dt><span class="strong">Throws:</span></dt>
+<dd><code><a href="../../../../../org/apache/kafka/common/errors/InterruptException.html" title="class in org.apache.kafka.common.errors">InterruptException</a></code> - If the thread is interrupted while blocked</dd>
+<dd><code>java.lang.IllegalArgumentException</code> - If the <code>timeout</code> is negative.</dd></dl>
 </li>
 </ul>
 </li>

http://git-wip-us.apache.org/repos/asf/kafka-site/blob/e047c4b2/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
index 208869a..e0625ea 100644
--- a/090/javadoc/org/apache/kafka/clients/producer/MockProducer.html
+++ b/090/javadoc/org/apache/kafka/clients/producer/MockProducer.html
@@ -2,15 +2,15 @@
 <!-- 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">
+<!-- Generated by javadoc (version 1.7.0_80) on Fri Nov 13 08:33:06 PST 2015 -->
+<title>MockProducer (clients 0.9.0.0 API)</title>
+<meta name="date" content="2015-11-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)";
+        parent.document.title="MockProducer (clients 0.9.0.0 API)";
     }
 //-->
 </script>
@@ -36,7 +36,7 @@
 <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>
+<li><a href="../../../../../org/apache/kafka/clients/producer/Partitioner.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>
@@ -79,14 +79,14 @@
 <!-- ======== 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>
+<h2 title="Class MockProducer" class="title">Class MockProducer&lt;K,V&gt;</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>
+<li>org.apache.kafka.clients.producer.MockProducer&lt;K,V&gt;</li>
 </ul>
 </li>
 </ul>
@@ -95,13 +95,13 @@
 <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>&lt;byte[],byte[]&gt;</dd>
+<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>&lt;K,V&gt;</dd>
 </dl>
 <hr>
 <br>
-<pre>public class <span class="strong">MockProducer</span>
+<pre>public class <span class="strong">MockProducer&lt;K,V&gt;</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>&lt;byte[],byte[]&gt;</pre>
+implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;K,V&gt;</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
@@ -124,20 +124,30 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <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 class="colOne"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(boolean,%20org.apache.kafka.clients.producer.Partitioner,%20org.apache.kafka.common.serialization.Serializer,%20org.apache.kafka.common.serialization.Serializer)">MockProducer</a></strong>(boolean&nbsp;autoComplete,
+            <a href="../../../../../org/apache/kafka/clients/producer/Partitioner.html" title="interface in org.apache.kafka.clients.producer">Partitioner</a>&nbsp;partitioner,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>&gt;&nbsp;keySerializer,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&nbsp;valueSerializer)</code>
+<div class="block">Create a new mock producer with invented metadata the given autoComplete setting, partitioner and key\value serializers
+
+ Equivalent to <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(org.apache.kafka.common.Cluster,%20boolean,%20org.apache.kafka.clients.producer.Partitioner,%20org.apache.kafka.common.serialization.Serializer,%20org.apache.kafka.common.serialization.Serializer)"><code>MockProducer(Cluster, boolean, Partitioner, Serializer, Serializer)</code></a> new MockProducer(Cluster.empty(), autoComplete, partitioner, keySerializer, valueSerializer)}</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&nbsp;autoComplete)</code>
-<div class="block">Create a new mock producer with invented metadata the given autoComplete setting.</div>
+<td class="colOne"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(boolean,%20org.apache.kafka.common.serialization.Serializer,%20org.apache.kafka.common.serialization.Serializer)">MockProducer</a></strong>(boolean&nbsp;autoComplete,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>&gt;&nbsp;keySerializer,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&nbsp;valueSerializer)</code>
+<div class="block">Create a new mock producer with invented metadata the given autoComplete setting and key\value serializers
+
+ Equivalent to <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(org.apache.kafka.common.Cluster,%20boolean,%20org.apache.kafka.clients.producer.Partitioner,%20org.apache.kafka.common.serialization.Serializer,%20org.apache.kafka.common.serialization.Serializer)"><code>MockProducer(Cluster, boolean, Partitioner, Serializer, Serializer)</code></a> new MockProducer(Cluster.empty(), autoComplete, new DefaultPartitioner(), keySerializer, valueSerializer)}</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>&nbsp;cluster,
-            boolean&nbsp;autoComplete)</code>
+<td class="colOne"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(org.apache.kafka.common.Cluster,%20boolean,%20org.apache.kafka.clients.producer.Partitioner,%20org.apache.kafka.common.serialization.Serializer,%20org.apache.kafka.common.serialization.Serializer)">MockProducer</a></strong>(<a href="../../../../../org/apache/kafka/common/Cluster.html" title="class in org.apache.kafka.common">Cluster</a>&nbsp;cluster,
+            boolean&nbsp;autoComplete,
+            <a href="../../../../../org/apache/kafka/clients/producer/Partitioner.html" title="interface in org.apache.kafka.clients.producer">Partitioner</a>&nbsp;partitioner,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>&gt;&nbsp;keySerializer,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&nbsp;valueSerializer)</code>
 <div class="block">Create a mock producer</div>
 </td>
 </tr>
@@ -169,19 +179,32 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 </td>
 </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#close(long,%20java.util.concurrent.TimeUnit)">close</a></strong>(long&nbsp;timeout,
+     java.util.concurrent.TimeUnit&nbsp;timeUnit)</code>
+<div class="block">Tries to close the producer cleanly within the specified timeout.</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#completeNext()">completeNext</a></strong>()</code>
 <div class="block">Complete the earliest uncompleted call successfully.</div>
 </td>
 </tr>
-<tr class="rowColor">
+<tr class="altColor">
 <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&nbsp;e)</code>
 <div class="block">Complete the earliest uncompleted call with the given error.</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#flush()">flush</a></strong>()</code>
+<div class="block">Flush any accumulated records from the producer.</div>
+</td>
+</tr>
 <tr class="altColor">
-<td class="colFirst"><code>java.util.List&lt;<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a>&lt;byte[],byte[]&gt;&gt;</code></td>
+<td class="colFirst"><code>java.util.List&lt;<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&gt;</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>
@@ -200,13 +223,13 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 </tr>
 <tr class="rowColor">
 <td class="colFirst"><code>java.util.concurrent.Future&lt;<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>&gt;</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>&lt;byte[],byte[]&gt;&nbsp;record)</code>
+<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>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&nbsp;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&lt;<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>&gt;</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>&lt;byte[],byte[]&gt;&nbsp;record,
+<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord,%20org.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>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&nbsp;record,
     <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer">Callback</a>&nbsp;callback)</code>
 <div class="block">Adds the record to the list of sent records.</div>
 </td>
@@ -233,43 +256,51 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <!--   -->
 </a>
 <h3>Constructor Detail</h3>
-<a name="MockProducer(org.apache.kafka.common.Cluster, boolean)">
+<a name="MockProducer(org.apache.kafka.common.Cluster, boolean, org.apache.kafka.clients.producer.Partitioner, org.apache.kafka.common.serialization.Serializer, org.apache.kafka.common.serialization.Serializer)">
 <!--   -->
 </a>
 <ul class="blockList">
 <li class="blockList">
 <h4>MockProducer</h4>
 <pre>public&nbsp;MockProducer(<a href="../../../../../org/apache/kafka/common/Cluster.html" title="class in org.apache.kafka.common">Cluster</a>&nbsp;cluster,
-            boolean&nbsp;autoComplete)</pre>
+            boolean&nbsp;autoComplete,
+            <a href="../../../../../org/apache/kafka/clients/producer/Partitioner.html" title="interface in org.apache.kafka.clients.producer">Partitioner</a>&nbsp;partitioner,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>&gt;&nbsp;keySerializer,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&nbsp;valueSerializer)</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&lt;RecordMetadata&gt;} that is returned.</dd></dl>
+        java.util.concurrent.Future Future&lt;RecordMetadata&gt;} that is returned.</dd><dd><code>partitioner</code> - The partition strategy</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>.</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>.</dd></dl>
 </li>
 </ul>
-<a name="MockProducer(boolean)">
+<a name="MockProducer(boolean, org.apache.kafka.common.serialization.Serializer, org.apache.kafka.common.serialization.Serializer)">
 <!--   -->
 </a>
 <ul class="blockList">
 <li class="blockList">
 <h4>MockProducer</h4>
-<pre>public&nbsp;MockProducer(boolean&nbsp;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>
+<pre>public&nbsp;MockProducer(boolean&nbsp;autoComplete,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>&gt;&nbsp;keySerializer,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&nbsp;valueSerializer)</pre>
+<div class="block">Create a new mock producer with invented metadata the given autoComplete setting and key\value serializers
+
+ Equivalent to <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(org.apache.kafka.common.Cluster,%20boolean,%20org.apache.kafka.clients.producer.Partitioner,%20org.apache.kafka.common.serialization.Serializer,%20org.apache.kafka.common.serialization.Serializer)"><code>MockProducer(Cluster, boolean, Partitioner, Serializer, Serializer)</code></a> new MockProducer(Cluster.empty(), autoComplete, new DefaultPartitioner(), keySerializer, valueSerializer)}</div>
 </li>
 </ul>
-<a name="MockProducer()">
+<a name="MockProducer(boolean, org.apache.kafka.clients.producer.Partitioner, org.apache.kafka.common.serialization.Serializer, org.apache.kafka.common.serialization.Serializer)">
 <!--   -->
 </a>
 <ul class="blockListLast">
 <li class="blockList">
 <h4>MockProducer</h4>
-<pre>public&nbsp;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>
+<pre>public&nbsp;MockProducer(boolean&nbsp;autoComplete,
+            <a href="../../../../../org/apache/kafka/clients/producer/Partitioner.html" title="interface in org.apache.kafka.clients.producer">Partitioner</a>&nbsp;partitioner,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>&gt;&nbsp;keySerializer,
+            <a href="../../../../../org/apache/kafka/common/serialization/Serializer.html" title="interface in org.apache.kafka.common.serialization">Serializer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&nbsp;valueSerializer)</pre>
+<div class="block">Create a new mock producer with invented metadata the given autoComplete setting, partitioner and key\value serializers
+
+ Equivalent to <a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html#MockProducer(org.apache.kafka.common.Cluster,%20boolean,%20org.apache.kafka.clients.producer.Partitioner,%20org.apache.kafka.common.serialization.Serializer,%20org.apache.kafka.common.serialization.Serializer)"><code>MockProducer(Cluster, boolean, Partitioner, Serializer, Serializer)</code></a> new MockProducer(Cluster.empty(), autoComplete, partitioner, keySerializer, valueSerializer)}</div>
 </li>
 </ul>
 </li>
@@ -286,11 +317,11 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <ul class="blockList">
 <li class="blockList">
 <h4>send</h4>
-<pre>public&nbsp;java.util.concurrent.Future&lt;<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>&gt;&nbsp;send(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a>&lt;byte[],byte[]&gt;&nbsp;record)</pre>
+<pre>public&nbsp;java.util.concurrent.Future&lt;<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>&gt;&nbsp;send(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&nbsp;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>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;byte[],byte[]&gt;</code></dd>
+<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#send(org.apache.kafka.clients.producer.ProducerRecord)">send</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;</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>
@@ -301,15 +332,30 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <ul class="blockList">
 <li class="blockList">
 <h4>send</h4>
-<pre>public&nbsp;java.util.concurrent.Future&lt;<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>&gt;&nbsp;send(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a>&lt;byte[],byte[]&gt;&nbsp;record,
+<pre>public&nbsp;java.util.concurrent.Future&lt;<a href="../../../../../org/apache/kafka/clients/producer/RecordMetadata.html" title="class in org.apache.kafka.clients.producer">RecordMetadata</a>&gt;&nbsp;send(<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&nbsp;record,
                                                <a href="../../../../../org/apache/kafka/clients/producer/Callback.html" title="interface in org.apache.kafka.clients.producer">Callback</a>&nbsp;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>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;byte[],byte[]&gt;</code></dd>
+<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#send(org.apache.kafka.clients.producer.ProducerRecord,%20org.apache.kafka.clients.producer.Callback)">send</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;</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="flush()">
+<!--   -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>flush</h4>
+<pre>public&nbsp;void&nbsp;flush()</pre>
+<div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#flush()">Producer</a></code></strong></div>
+<div class="block">Flush any accumulated records from the producer. Blocks until all sends are complete.</div>
+<dl>
+<dt><strong>Specified by:</strong></dt>
+<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#flush()">flush</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;</code></dd>
+</dl>
+</li>
+</ul>
 <a name="partitionsFor(java.lang.String)">
 <!--   -->
 </a>
@@ -322,7 +368,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
  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>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;byte[],byte[]&gt;</code></dd>
+<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#partitionsFor(java.lang.String)">partitionsFor</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;</code></dd>
 </dl>
 </li>
 </ul>
@@ -337,7 +383,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <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>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;byte[],byte[]&gt;</code></dd>
+<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#metrics()">metrics</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;</code></dd>
 </dl>
 </li>
 </ul>
@@ -356,7 +402,24 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <dt><strong>Specified by:</strong></dt>
 <dd><code>close</code>&nbsp;in interface&nbsp;<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>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;byte[],byte[]&gt;</code></dd>
+<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#close()">close</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;</code></dd>
+</dl>
+</li>
+</ul>
+<a name="close(long, java.util.concurrent.TimeUnit)">
+<!--   -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>close</h4>
+<pre>public&nbsp;void&nbsp;close(long&nbsp;timeout,
+         java.util.concurrent.TimeUnit&nbsp;timeUnit)</pre>
+<div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#close(long,%20java.util.concurrent.TimeUnit)">Producer</a></code></strong></div>
+<div class="block">Tries to close the producer cleanly within the specified timeout. If the close does not complete within the
+ timeout, fail any pending send requests and force close the producer.</div>
+<dl>
+<dt><strong>Specified by:</strong></dt>
+<dd><code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html#close(long,%20java.util.concurrent.TimeUnit)">close</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/clients/producer/Producer.html" title="interface in org.apache.kafka.clients.producer">Producer</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;</code></dd>
 </dl>
 </li>
 </ul>
@@ -366,7 +429,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <ul class="blockList">
 <li class="blockList">
 <h4>history</h4>
-<pre>public&nbsp;java.util.List&lt;<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a>&lt;byte[],byte[]&gt;&gt;&nbsp;history()</pre>
+<pre>public&nbsp;java.util.List&lt;<a href="../../../../../org/apache/kafka/clients/producer/ProducerRecord.html" title="class in org.apache.kafka.clients.producer">ProducerRecord</a>&lt;<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">K</a>,<a href="../../../../../org/apache/kafka/clients/producer/MockProducer.html" title="type parameter in MockProducer">V</a>&gt;&gt;&nbsp;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>
@@ -428,7 +491,7 @@ implements <a href="../../../../../org/apache/kafka/clients/producer/Producer.ht
 <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>
+<li><a href="../../../../../org/apache/kafka/clients/producer/Partitioner.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>

http://git-wip-us.apache.org/repos/asf/kafka-site/blob/e047c4b2/090/javadoc/org/apache/kafka/clients/producer/Partitioner.html
----------------------------------------------------------------------
diff --git a/090/javadoc/org/apache/kafka/clients/producer/Partitioner.html b/090/javadoc/org/apache/kafka/clients/producer/Partitioner.html
new file mode 100644
index 0000000..a857049
--- /dev/null
+++ b/090/javadoc/org/apache/kafka/clients/producer/Partitioner.html
@@ -0,0 +1,247 @@
+<!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 13 08:33:06 PST 2015 -->
+<title>Partitioner (clients 0.9.0.0 API)</title>
+<meta name="date" content="2015-11-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="Partitioner (clients 0.9.0.0 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/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/Partitioner.html" target="_top">Frames</a></li>
+<li><a href="Partitioner.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:&nbsp;</li>
+<li>Nested&nbsp;|&nbsp;</li>
+<li>Field&nbsp;|&nbsp;</li>
+<li>Constr&nbsp;|&nbsp;</li>
+<li><a href="#method_summary">Method</a></li>
+</ul>
+<ul class="subNavList">
+<li>Detail:&nbsp;</li>
+<li>Field&nbsp;|&nbsp;</li>
+<li>Constr&nbsp;|&nbsp;</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 Partitioner" class="title">Interface Partitioner</h2>
+</div>
+<div class="contentContainer">
+<div class="description">
+<ul class="blockList">
+<li class="blockList">
+<dl>
+<dt>All Superinterfaces:</dt>
+<dd><a href="../../../../../org/apache/kafka/common/Configurable.html" title="interface in org.apache.kafka.common">Configurable</a></dd>
+</dl>
+<hr>
+<br>
+<pre>public interface <span class="strong">Partitioner</span>
+extends <a href="../../../../../org/apache/kafka/common/Configurable.html" title="interface in org.apache.kafka.common">Configurable</a></pre>
+<div class="block">Partitioner Interface</div>
+</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">&nbsp;</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/Partitioner.html#close()">close</a></strong>()</code>
+<div class="block">This is called when partitioner is closed.</div>
+</td>
+</tr>
+<tr class="rowColor">
+<td class="colFirst"><code>int</code></td>
+<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/clients/producer/Partitioner.html#partition(java.lang.String,%20java.lang.Object,%20byte[],%20java.lang.Object,%20byte[],%20org.apache.kafka.common.Cluster)">partition</a></strong>(java.lang.String&nbsp;topic,
+         java.lang.Object&nbsp;key,
+         byte[]&nbsp;keyBytes,
+         java.lang.Object&nbsp;value,
+         byte[]&nbsp;valueBytes,
+         <a href="../../../../../org/apache/kafka/common/Cluster.html" title="class in org.apache.kafka.common">Cluster</a>&nbsp;cluster)</code>
+<div class="block">Compute the partition for the given record.</div>
+</td>
+</tr>
+</table>
+<ul class="blockList">
+<li class="blockList"><a name="methods_inherited_from_class_org.apache.kafka.common.Configurable">
+<!--   -->
+</a>
+<h3>Methods inherited from interface&nbsp;org.apache.kafka.common.<a href="../../../../../org/apache/kafka/common/Configurable.html" title="interface in org.apache.kafka.common">Configurable</a></h3>
+<code><a href="../../../../../org/apache/kafka/common/Configurable.html#configure(java.util.Map)">configure</a></code></li>
+</ul>
+</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="partition(java.lang.String, java.lang.Object, byte[], java.lang.Object, byte[], org.apache.kafka.common.Cluster)">
+<!--   -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>partition</h4>
+<pre>int&nbsp;partition(java.lang.String&nbsp;topic,
+            java.lang.Object&nbsp;key,
+            byte[]&nbsp;keyBytes,
+            java.lang.Object&nbsp;value,
+            byte[]&nbsp;valueBytes,
+            <a href="../../../../../org/apache/kafka/common/Cluster.html" title="class in org.apache.kafka.common">Cluster</a>&nbsp;cluster)</pre>
+<div class="block">Compute the partition for the given record.</div>
+<dl><dt><span class="strong">Parameters:</span></dt><dd><code>topic</code> - The topic name</dd><dd><code>key</code> - The key to partition on (or null if no key)</dd><dd><code>keyBytes</code> - The serialized key to partition on( or null if no key)</dd><dd><code>value</code> - The value to partition on or null</dd><dd><code>valueBytes</code> - The serialized value to partition on or null</dd><dd><code>cluster</code> - The current cluster metadata</dd></dl>
+</li>
+</ul>
+<a name="close()">
+<!--   -->
+</a>
+<ul class="blockListLast">
+<li class="blockList">
+<h4>close</h4>
+<pre>void&nbsp;close()</pre>
+<div class="block">This is called when partitioner is closed.</div>
+</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/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/Partitioner.html" target="_top">Frames</a></li>
+<li><a href="Partitioner.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:&nbsp;</li>
+<li>Nested&nbsp;|&nbsp;</li>
+<li>Field&nbsp;|&nbsp;</li>
+<li>Constr&nbsp;|&nbsp;</li>
+<li><a href="#method_summary">Method</a></li>
+</ul>
+<ul class="subNavList">
+<li>Detail:&nbsp;</li>
+<li>Field&nbsp;|&nbsp;</li>
+<li>Constr&nbsp;|&nbsp;</li>
+<li><a href="#method_detail">Method</a></li>
+</ul>
+</div>
+<a name="skip-navbar_bottom">
+<!--   -->
+</a></div>
+<!-- ======== END OF BOTTOM NAVBAR ======= -->
+</body>
+</html>