I'm trying to evaluate using Riak's Post-Commit Hooks to build a distributed, incremental MapReduce-based index, but was wondering which Riak nodes the Post-Commit Hooks actually run on. Are they run on the nodes the client used to put the commits, or on the primary nodes where the data is persisted? If it's the latter, I'm thinking I can from there efficiently do a map or reduce and put additional records from the output.
All git hooks are stored in the . git/hooks/ directory under your project root. A pre-commit hook is just an executable file stored in this folder with the magic name pre-commit .
The post-commit hook is called immediately after the commit-msg hook. It can't change the outcome of the git commit operation, so it's used primarily for notification purposes. The script takes no parameters and its exit status does not affect the commit in any way.
If you want to manually run all pre-commit hooks on a repository, run pre-commit run --all-files . To run individual hooks use pre-commit run <hook_id> . The first time pre-commit runs on a file it will automatically download, install, and run the hook.
Description. The post-commit hook is run after the transaction is committed and a new revision is created. Most people use this hook to send out descriptive emails about the commit or to notify some other tool (such as an issue tracker) that a commit has happened.
From the docs
Post-commit hooks are run after the write has completed successfully.
Specifically,the hook function is called by riak_kv_put_fsm immediately
before the calling process is notified of the successful write
riak_kv_put_fsm handles "coordination of Riak PUT requests", so the post commit hook is run on the co-ordinator node, i.e. the node that the client sent the put to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With