1fanwang commented on code in PR #22155:
URL: https://github.com/apache/kafka/pull/22155#discussion_r4589525406


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/RecordQueue.java:
##########
@@ -212,8 +214,9 @@ private void updateHead() {
 
         while (headRecord == null && !fifoQueue.isEmpty()) {
             final ConsumerRecord<byte[], byte[]> raw = fifoQueue.pollFirst();
+            final Headers sourceRawHeaders = new RecordHeaders(raw.headers());

Review Comment:
   It has to happen before deserialization: deserializers and timestamp 
extractors get the record's own headers object and can change it in place, so a 
later copy would already be changed. The copy holds header references only, one 
small list per record, and I have not benchmarked it. I added a comment that 
says why. Done in 
https://github.com/apache/kafka/commit/2cc9763f6f91010596fdf6e7ff5099f5a2a6e74e.



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorContextImpl.java:
##########
@@ -262,7 +262,8 @@ public <K, V> void forward(final Record<K, V> record, final 
String childName) {
                     recordContext.topic(),
                     record.headers(),
                     recordContext.sourceRawKey(),
-                    recordContext.sourceRawValue()
+                    recordContext.sourceRawValue(),
+                    recordContext.sourceRawHeaders()

Review Comment:
   Done in 
https://github.com/apache/kafka/commit/37856e5c04c119175a0a0819baf0fb11c267a345.
 The accessor is public because the caching stores are in another package, and 
a punctuator test now pins it.



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStateUpdateTask.java:
##########
@@ -118,7 +121,10 @@ public void update(final ConsumerRecord<byte[], byte[]> 
record) {
                     deserialized.offset(),
                     deserialized.partition(),
                     deserialized.topic(),
-                    deserialized.headers());
+                    deserialized.headers(),
+                    null,

Review Comment:
   Yes, the raw key and value are passed now. Done in 
https://github.com/apache/kafka/commit/25d75ddae82f570a6dc51feea9e6ad1e2bc16f98,
 with a test for both.



##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/ProcessingExceptionHandlerIntegrationTest.java:
##########
@@ -582,6 +660,71 @@ public void configure(final Map<String, ?> configs) {
         }
     }
 
+    public static class AssertSourceRawHeadersProcessingExceptionHandler 
implements ProcessingExceptionHandler {

Review Comment:
   Done in 
https://github.com/apache/kafka/commit/de5ac20f0dbf0b9f11b59358aac813cf608b77f4.
 Each handler sets a flag, and the tests assert it after assertThrows.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to