[ 
https://issues.apache.org/jira/browse/KAFKA-4932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16645431#comment-16645431
 ] 

ASF GitHub Bot commented on KAFKA-4932:
---------------------------------------

mjsax closed pull request #5769: KAFKA-4932: Update docs for KIP-206
URL: https://github.com/apache/kafka/pull/5769
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/streams/developer-guide/datatypes.html 
b/docs/streams/developer-guide/datatypes.html
index a24dc4ce324..6c7869c3ba1 100644
--- a/docs/streams/developer-guide/datatypes.html
+++ b/docs/streams/developer-guide/datatypes.html
@@ -142,6 +142,9 @@ <h3>Primitive and basic types<a class="headerlink" 
href="#primitive-and-basic-ty
           <tr class="row-odd"><td>String</td>
             <td><code class="docutils literal"><span 
class="pre">Serdes.String()</span></code></td>
           </tr>
+          <tr class="row-even"><td>UUID</td>
+            <td><code class="docutils literal"><span 
class="pre">Serdes.UUID()</span></code></td>
+          </tr>
           </tbody>
         </table>
         <div class="admonition tip">
@@ -174,7 +177,10 @@ <h3>JSON<a class="headerlink" href="#json" 
title="Permalink to this headline"></
             <a class="reference external" 
href="https://github.com/apache/kafka/blob/1.0/clients/src/main/java/org/apache/kafka/common/serialization/Serde.java";>org.apache.kafka.common.serialization.Serde</a>,
             which you either do manually (see existing SerDes in the previous 
section) or by leveraging helper functions in
             <a class="reference external" 
href="https://github.com/apache/kafka/blob/1.0/clients/src/main/java/org/apache/kafka/common/serialization/Serdes.java";>Serdes</a>
-            such as <code class="docutils literal"><span 
class="pre">Serdes.serdeFrom(Serializer&lt;T&gt;,</span> <span 
class="pre">Deserializer&lt;T&gt;)</span></code>.</li>
+            such as <code class="docutils literal"><span 
class="pre">Serdes.serdeFrom(Serializer&lt;T&gt;, 
Deserializer&lt;T&gt;)</span></code>.
+            Note that you will need to implement your own class (that has no 
generic types) if you want to use your custom serde in the configuration 
provided to <code class="docutils literal"><span 
class="pre">KafkaStreams</span></code>.
+            If your serde class has generic types or you use <code 
class="docutils literal"><span 
class="pre">Serdes.serdeFrom(Serializer&lt;T&gt;, 
Deserializer&lt;T&gt;)</span></code>, you can pass your serde only
+            via methods calls (for example <code class="docutils 
literal"><span class="pre">builder.stream("topicName", 
Consumed.with(...))</span></code>).</li>
         </ol>
       </div>
     </div>
diff --git a/docs/streams/upgrade-guide.html b/docs/streams/upgrade-guide.html
index 0309a5312f5..4bece4ae5be 100644
--- a/docs/streams/upgrade-guide.html
+++ b/docs/streams/upgrade-guide.html
@@ -108,6 +108,10 @@ <h3><a id="streams_api_changes_210" 
href="#streams_api_changes_210">Streams API
         they can override this config to a larger value.
     </p>
 
+    <p>
+        We added a new serde for UUIDs (<code>Serdes.UUIDSerde</code>) that 
you can use via <code>Serdes.UUID()</code> (cf. <a 
href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-206%3A+Add+support+for+UUID+serialization+and+deserialization";>KIP-206</a>).
+    </p>
+
     <h3><a id="streams_api_changes_200" 
href="#streams_api_changes_200">Streams API changes in 2.0.0</a></h3>
     <p>
         We have removed the <code>skippedDueToDeserializationError-rate</code> 
and <code>skippedDueToDeserializationError-total</code> metrics.


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Add UUID Serde
> --------------
>
>                 Key: KAFKA-4932
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4932
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients, streams
>            Reporter: Jeff Klukas
>            Assignee: Brandon Kirchner
>            Priority: Minor
>              Labels: needs-kip, newbie
>             Fix For: 2.1.0
>
>
> I propose adding serializers and deserializers for the java.util.UUID class.
> I have many use cases where I want to set the key of a Kafka message to be a 
> UUID. Currently, I need to turn UUIDs into strings or byte arrays and use 
> their associated Serdes, but it would be more convenient to serialize and 
> deserialize UUIDs directly.
> I'd propose that the serializer and deserializer use the 36-byte string 
> representation, calling UUID.toString and UUID.fromString, and then using the 
> existing StringSerializer / StringDeserializer to finish the job. We would 
> also wrap these in a Serde and modify the streams Serdes class to include 
> this in the list of supported types.
> Optionally, we could have the deserializer support a 16-byte representation 
> and it would check the size of the input byte array to determine whether it's 
> a binary or string representation of the UUID. It's not well defined whether 
> the most significant bits or least significant go first, so this deserializer 
> would have to support only one or the other.
> Similary, if the deserializer supported a 16-byte representation, there could 
> be two variants of the serializer, a UUIDStringSerializer and a 
> UUIDBytesSerializer.
> I would be willing to write this PR, but am looking for feedback about 
> whether there are significant concerns here around ambiguity of what the byte 
> representation of a UUID should be, or if there's desire to keep to list of 
> built-in Serdes minimal such that a PR would be unlikely to be accepted.
> KIP Link: 
> https://cwiki.apache.org/confluence/display/KAFKA/KIP-206%3A+Add+support+for+UUID+serialization+and+deserialization



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to