-
Notifications
You must be signed in to change notification settings - Fork 226
Add shutdown requested implemention in python client. #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -220,6 +220,17 @@ def shutdown(self, checkpointer, reason): | |
''' | ||
raise NotImplementedError | ||
|
||
@abc.abstractmethod | ||
def shutdownRequested(self, checkpointer): | ||
''' | ||
Called by a KCLProcess instance to indicate that this record processor is being shutdown. | ||
And it gives an opportunity for record processor to checkpoint before shutdown. | ||
|
||
:type checkpointer: amazon_kclpy.kcl.Checkpointer | ||
:param checkpointer: A checkpointer which accepts a sequence number or no parameters. | ||
''' | ||
raise NotImplementedError | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably do nothing. If someone upgrades to the newer version without implementing the shutdownRequested it would cause their application to fail. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additionally this should be placed on the v2 version of the record processor in v2/processor.py |
||
|
||
version = 1 | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should follow Python PEP8 style e.g. shutdown_requested.
For the v2 interface this should also use intermediate type, even though I did that wrong with the interface in the Java KCL. See v2/processor.py#L51 for an example