Github user uce commented on a diff in the pull request:
https://github.com/apache/flink/pull/1668#discussion_r57319737
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
---
@@ -450,112 +450,121 @@ else if (operator != null) {
}
}
- @Override
- public boolean triggerCheckpoint(final long checkpointId, final long
timestamp) throws Exception {
- LOG.debug("Starting checkpoint {} on task {}", checkpointId,
getName());
-
- synchronized (lock) {
- if (isRunning) {
-
- // since both state checkpointing and
downstream barrier emission occurs in this
- // lock scope, they are an atomic operation
regardless of the order in which they occur
- // we immediately emit the checkpoint barriers,
so the downstream operators can start
- // their checkpoint work as soon as possible
-
operatorChain.broadcastCheckpointBarrier(checkpointId, timestamp);
-
- // now draw the state snapshot
- final StreamOperator<?>[] allOperators =
operatorChain.getAllOperators();
- final StreamTaskState[] states = new
StreamTaskState[allOperators.length];
+ /**
+ * Checkpoints all operator states of the current StreamTask.
+ * Thread-safety must be handled outside the scope of this function
+ */
+ protected boolean checkpointStatesInternal(final long checkpointId,
long timestamp) throws Exception {
--- End diff --
What about naming this as in the comments `drawStateSnapshot`? That it is
internal is more or less communicated by the fact that it is a `protected`
method.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---