rmetzger commented on a change in pull request #6594: [FLINK-9311] [pubsub] 
Added PubSub source connector with support for checkpointing (ATLEAST_ONCE)
URL: https://github.com/apache/flink/pull/6594#discussion_r257699807
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/MessageAcknowledgingSourceBase.java
 ##########
 @@ -148,16 +149,12 @@ public void 
initializeState(FunctionInitializationContext context) throws Except
                if (context.isRestored()) {
                        LOG.info("Restoring state for the {}.", 
getClass().getSimpleName());
 
-                       List<SerializedCheckpointData[]> retrievedStates = new 
ArrayList<>();
+                       List<Map<Long, Set<UId>>> retrievedStates = new 
ArrayList<>();
                        for (SerializedCheckpointData[] entry : 
this.checkpointedState.get()) {
-                               retrievedStates.add(entry);
+                               
retrievedStates.add(SerializedCheckpointData.toDeque(entry, idSerializer));
                        }
+                       pendingCheckpoints = 
SerializedCheckpointData.combine(retrievedStates);
 
-                       // given that the parallelism of the function is 1, we 
can only have at most 1 state
 
 Review comment:
   But doesn't it make more sense to disable the deduplication if the 
parallelism > 1 ? (We would not have the memory and CPU usage + smaller 
checkpoints)
   
   If the user wants a best-effort deduping, they can implement it themselves 
in user code.
   

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


With regards,
Apache Git Services

Reply via email to