-
Notifications
You must be signed in to change notification settings - Fork 505
METRON-1853: Add shutdown hook to Stellar BaseFunctionResolver #1251
Conversation
ottobackwards
left a comment
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.
Comments
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/StellarFunctions.java
Outdated
Show resolved
Hide resolved
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/StellarFunction.java
Show resolved
Hide resolved
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/StellarFunction.java
Show resolved
Hide resolved
...mon/src/main/java/org/apache/metron/stellar/dsl/functions/resolver/BaseFunctionResolver.java
Outdated
Show resolved
Hide resolved
...-common/src/main/java/org/apache/metron/stellar/dsl/functions/resolver/FunctionResolver.java
Show resolved
Hide resolved
|
Should the resolver throw if there is a call after it is closed? |
…ed as IOException
What do you think of a no-op on multiple invocations of close? This would be consistent with the |
|
That is great |
|
@ottobackwards Ok, pushed out an update for that change along with accompanying unit test. |
TestingNote - this test script can be used in conjunction with #1250 because this PR exposes the close() capability, but it does NOT add it to the parser/enrichment bolts or Stellar shell executor. i.e. you won't see the messages until that implementation is exposed. 1250 exposes the close() invocations. Create a custom Stellar functionSee the following for reference - https://github.com/apache/metron/blob/master/metron-stellar/stellar-common/3rdPartyStellar.md
|
|
+1 |
|
@ottobackwards Any other feedback on this? |
|
+1 |
Contributor Comments
https://issues.apache.org/jira/browse/METRON-1853
Noodling on a method to add shutdown hooks to Stellar. Modified the StellarFunction interface to include a teardown method. Added a no-op to BaseStellarFunction to make it easy for implementations that don't need a teardown.
Rationale - some functions may have long-lived activities that include closeable resources. Adding the teardown method enables function implementers to close any resources opened during init gracefully.
Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines for complete smoke testing guides.
In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:
For all changes:
For code changes:
Have you included steps to reproduce the behavior or problem that is being changed or addressed?
Have you included steps or a guide to how the change may be verified and tested manually?
Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:
Have you written or updated unit tests and or integration tests to verify your changes?
n/a If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
For documentation related changes:
Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via
site-book/target/site/index.html:Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
It is also recommended that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.