masteryhx commented on code in PR #21468:
URL: https://github.com/apache/flink/pull/21468#discussion_r1051733639


##########
flink-state-backends/flink-statebackend-changelog/src/main/java/org/apache/flink/state/changelog/KvStateChangeLoggerImpl.java:
##########
@@ -78,21 +79,25 @@ public void namespacesMerged(Ns target, Collection<Ns> 
sources) throws IOExcepti
     }
 
     @Override
-    protected void serializeValue(Value value, DataOutputViewStreamWrapper 
out) throws IOException {
+    protected void serializeValue(Value value, DataOutputView out) throws 
IOException {
         valueSerializer.serialize(value, out);
     }
 
     @Override
-    protected void serializeScope(Ns ns, DataOutputViewStreamWrapper out) 
throws IOException {
+    protected void serializeScope(Ns ns, DataOutputView out) throws 
IOException {
         keySerializer.serialize(keyContext.getCurrentKey(), out);
         namespaceSerializer.serialize(ns, out);
     }
 
-    protected void writeDefaultValueAndTtl(DataOutputViewStreamWrapper out) 
throws IOException {
+    protected void writeDefaultValueAndTtl(DataOutputView out) throws 
IOException {
         out.writeBoolean(ttlConfig.isEnabled());
         if (ttlConfig.isEnabled()) {
-            try (ObjectOutputStream o = new ObjectOutputStream(out)) {
-                o.writeObject(ttlConfig);
+            try (ByteArrayOutputStreamWithPos outputStreamWithPos =
+                            new ByteArrayOutputStreamWithPos();

Review Comment:
   Actually, I used `ByteArrayOutputStreamWithPos` because it's Un-synchronized 
but `ByteArrayOutputStream` is synchronized which is unnecessary.



-- 
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