Initializing a commit hook

Luke Bakken lbakken at basho.com
Fri Nov 18 18:24:08 EST 2016


Thanks for correcting that. Everything looks set up correctly.

How are you saving objects? If you're using HTTP, what is the URL?

Can you associate your precommit hook with a bucket type
("test-bucket-type" below) that is *not* set up for the "map" data
type and see if your hook is called correctly?

This command should save an object and trigger the precommit hook
*with* a bucket and bucket type:

curl -4vvv -H 'Content-Type: text/plain'
localhost:8098/types/test-bucket-type/buckets/test-bucket/keys/test-key
-d "THIS IS THE DATA FOR TEST-KEY"

Luke

On Fri, Nov 18, 2016 at 3:03 PM, Mav erick <mav4001 at gmail.com> wrote:
>
> * Hostname was NOT found in DNS cache
> *   Trying 127.0.0.1...
> * Connected to localhost (127.0.0.1) port 8098 (#0)
>> GET /types/maps/props HTTP/1.1
>> User-Agent: curl/7.35.0
>> Host: localhost:8098
>> Accept: */*
>>
> < HTTP/1.1 200 OK
> < Vary: Accept-Encoding
> * Server MochiWeb/1.1 WebMachine/1.10.6 (no drinks) is not blacklisted
> < Server: MochiWeb/1.1 WebMachine/1.10.6 (no drinks)
> < Date: Fri, 18 Nov 2016 22:27:56 GMT
> < Content-Type: application/json
> < Content-Length: 545
> <
> * Connection #0 to host localhost left intact
> {"props":{"active":true,"allow_mult":true,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod"
> :"riak_core_util","fun":"chash_std_keyfun"},"claimant":"riak at 10.243.44.165","datatype":"map","dvv_en
> abled":true,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"m
> apreduce_linkfun"},"n_val":3,"notfound_ok":true,"old_vclock":86400,"postcommit":[],"pr":0,"precommit
> ":[{"mod":"commit_hooks","fun":"precommit_hook"}],"pw":0,"r":"quorum","rw":"quorum","smal
> l_vclock":50,"w":"quorum","young_vclock":20}}
>
> $ curl -4vvv localhost:8098/types/maps/buckets/testbucket/props
> * Hostname was NOT found in DNS cache
> *   Trying 127.0.0.1...
> * Connected to localhost (127.0.0.1) port 8098 (#0)
>> GET /types/maps//buckets/testbucket/props HTTP/1.1
>> User-Agent: curl/7.35.0
>> Host: localhost:8098
>> Accept: */*
>>
> < HTTP/1.1 200 OK
> < Vary: Accept-Encoding
> * Server MochiWeb/1.1 WebMachine/1.10.6 (no drinks) is not blacklisted
> < Server: MochiWeb/1.1 WebMachine/1.10.6 (no drinks)
> < Date: Fri, 18 Nov 2016 22:59:22 GMT
> < Content-Type: application/json
> < Content-Length: 565
> <
> * Connection #0 to host localhost left intact
> {"props":{"name":"testbucket","active":true,"allow_mult":true,"basic_quorum":false,"big_vclock":
> chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"claimant":"riak at 10.243.44.165",
> atype":"map","dvv_enabled":true,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_
> ink_walker","fun":"mapreduce_linkfun"},"n_val":3,"notfound_ok":true,"old_vclock":86400,"postcomm
> [],"pr":0,"precommit":[{"mod":"commit_hooks","fun":"precommit_hook"}],"pw":0,"r":"quo
> ,"rw":"quorum","small_vclock":50,"w":"quorum","young_vclock":20}}$




More information about the riak-users mailing list