This is an automated email from the ASF dual-hosted git repository. rzo1 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/storm.git
commit 374eee25cac240bc5567a579eda8232ad35766b6 Author: Bharat Gulati <[email protected]> AuthorDate: Sat Jun 17 14:18:45 2023 +0530 updating flux README --- docs/flux.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/flux.md b/docs/flux.md index cf83741c4..75a62e133 100644 --- a/docs/flux.md +++ b/docs/flux.md @@ -244,6 +244,7 @@ definition consists of the following: * A list of spouts, each identified by a unique ID * A list of bolts, each identified by a unique ID * A list of "stream" objects representing a flow of tuples between spouts and bolts + * (Optional) A list of "workerHooks", each identifed by a unique ID 4. **OR** (A JVM class that can produce a `org.apache.storm.generated.StormTopology` instance: * A `topologySource` definition. @@ -286,6 +287,10 @@ streams: grouping: type: SHUFFLE +# worker hook definitions +workerHooks: + - id: "base-worker-hook" + className: "org.apache.storm.hooks.BaseWorkerHook" ``` ## Property Substitution/Filtering @@ -765,6 +770,16 @@ The `override` property controls how includes affect the values defined in the c **N.B.:** Includes are not yet recursive. Includes from included files will be ignored. +## Worker Hooks +Flux allows you to attach topology component that can be executed when a worker starts, and when a worker shuts down. It can be useful when you want to execute operations before topology processing starts, or cleanup operations before your workers shut down, e.g. managing application context. Worker Hooks should be an implementation of [IWorkerHook]({{page.git-blob-base}}/storm-client/src/jvm/org/apache/storm/hooks/IWorkerHook.java). Otherwise, follow similar Bean definition semantics as [...] + +Worker Hooks are specified as a list of maps: + +```yaml +workerHooks: + - id: "base-worker-hook" + className: "org.apache.storm.hooks.BaseWorkerHook" +``` ## Basic Word Count Example
