Github user tweise commented on a diff in the pull request:
https://github.com/apache/incubator-apex-core/pull/187#discussion_r47975611
--- Diff: api/src/main/java/com/datatorrent/api/Operator.java ---
@@ -270,4 +271,29 @@ public String toString()
}
+ /**
+ * Operators that need to be notified about checkpoint events should
implement this interface.
+ *
+ * The notification callbacks in this interface are called outside
window boundaries so the operators should not
+ * attempt to send any tuples in these callbacks.
+ *
+ */
+ public static interface CheckpointNotificationListener extends
CheckpointListener
+ {
+ /**
+ * Notify the operator that a checkpoint is about to be performed.
+ *
+ * Operators may need to perform certain tasks just before a
checkpoint such as calling flush on a stream. Having
+ * this notification helps operators perform such operations optimally
by doing them once before checkpoint as
+ * opposed to doing it repeatedly at the end of every window.
+ *
+ * The method will be called before the checkpoint is performed. It
will be called after
+ * {@link Operator#endWindow()} call of the window preceding the
checkpoint and before the checkpoint is
+ * actually performed.
+ *
+ * @param windowId The window id of the window preceding the checkpoint
+ */
+ public void checkpoint(long windowId);
--- End diff --
There will be cases where it is needed to slice the state by checkpoint for
processing in committed, but then this is the same situation as with endWindow
and we should keep it consistent.
---
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.
---