You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by sr...@apache.org on 2018/06/01 15:59:21 UTC

storm git commit: STORM-3089: Describe worker hooks in documentation

Repository: storm
Updated Branches:
  refs/heads/1.x-branch aeb69dd13 -> bfa578058


STORM-3089: Describe worker hooks in documentation


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/bfa57805
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/bfa57805
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/bfa57805

Branch: refs/heads/1.x-branch
Commit: bfa578058f61fb5eb09055cd7570ad30debbaf92
Parents: aeb69dd
Author: Stig Rohde Døssing <sr...@apache.org>
Authored: Tue May 29 17:56:02 2018 +0200
Committer: Stig Rohde Døssing <sr...@apache.org>
Committed: Fri Jun 1 17:58:15 2018 +0200

----------------------------------------------------------------------
 docs/Hooks.md | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/bfa57805/docs/Hooks.md
----------------------------------------------------------------------
diff --git a/docs/Hooks.md b/docs/Hooks.md
index 3c85407..450a560 100644
--- a/docs/Hooks.md
+++ b/docs/Hooks.md
@@ -3,7 +3,11 @@ title: Hooks
 layout: documentation
 documentation: true
 ---
+## Task hooks
 Storm provides hooks with which you can insert custom code to run on any number of events within Storm. You create a hook by extending the [BaseTaskHook](javadocs/org/apache/storm/hooks/BaseTaskHook.html) class and overriding the appropriate method for the event you want to catch. There are two ways to register your hook:
 
 1. In the open method of your spout or prepare method of your bolt using the [TopologyContext](javadocs/org/apache/storm/task/TopologyContext.html#addTaskHook) method.
 2. Through the Storm configuration using the ["topology.auto.task.hooks"](javadocs/org/apache/storm/Config.html#TOPOLOGY_AUTO_TASK_HOOKS) config. These hooks are automatically registered in every spout or bolt, and are useful for doing things like integrating with a custom monitoring system.
+
+## Worker hooks
+Storm also provides worker-level hooks that are called during worker startup, before any bolts or spouts are prepared/opened. You can create such a hook by extending [BaseWorkerHook](javadocs/org/apache/storm/hooks/BaseWorkerHook) and overriding the methods you want to implement. You can register your hook via `TopologyBuilder.addWorkerHook`.