Xeli 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_r257795582
##########
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:
Yep makes sense, I've made it conditional based on parallelism == 1
----------------------------------------------------------------
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