Purging = removing the old version of the module (so that it will only have a new version).
erlang:check_old_code(mymodule).
Return if the module has an old version loaded.
code:load_file(mymodule).
| <Plugin "processes"> | |
| ProcessMatch "carbon-cache" "python.+carbon-cache" | |
| ProcessMatch "carbon-aggregator" "python.+carbon-aggregator" | |
| </Plugin> |
| #! /bin/bash | |
| echo Creating Combined console.log | |
| for I in *-riak-debug; do NODE=${I//-riak-debug/}; echo " Processing ${NODE}..."; for J in $I/logs/platform_log_dir/console.lo*; do sed -n -e '/^2015/!{H;d;};/^2015/{x;s/\n/ /g;p;};${x;s/\n/ /g;p;}' $J | awk '!/^$/{print $1"T"$2,"'${NODE}'",$0}' | sed 's/\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \(.*\)/\1 \2 \5/' >> temp.log ; done; done; sort temp.log > combined_console.log;rm temp.log; | |
| echo Creating Combined error.log | |
| for I in *-riak-debug; do NODE=${I//-riak-debug/}; echo " Processing ${NODE}..."; for J in $I/logs/platform_log_dir/error.lo*; do sed -n -e '/^2015/!{H;d;};/^2015/{x;s/\n/ /g;p;};${x;s/\n/ /g;p;}' $J | awk '!/^$/{print $1"T"$2,"'${NODE}'",$0}' | sed 's/\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \(.*\)/\1 \2 \5/' >> temp.log ; done; done; sort temp.log > combined_error.log;rm temp.log; | |
| echo Checking for LevelDB Compaction Errors | |
| find . -name "LOG" -exec grep -l 'Compaction error' {} \; |
| This gist captures what needs to be done to add a new field to Riak's Yokozuna | |
| search index. | |
| Sources: | |
| - https://github.com/basho/yokozuna/issues/130 | |
| - http://riak-users.197444.n3.nabble.com/How-to-update-existed-schema-td4032143.html | |
| The code below is for illustration purposes only. Use at your own risk. | |
| 1. Create/Update new schema file |
| alias gbr='git for-each-ref --sort="-authordate:iso8601" --format=" %(color:green)%(authordate:iso8601)%09%(color:white)%(refname:short)" refs/heads' |
riak_object and populate the various fields with the headers, metadata supplied by the client.riak_client:put: https://github.com/basho/riak_kv/blob/1.4.2/src/riak_client.erl#L143handle_common_errors and it is nice to return human readable errors to client :)| %% riak_dt_map: OR-Set schema based multi CRDT container | |
| M = riak_dt_map:new(), | |
| %% Braxton adds key and val fields | |
| {ok, M1B} = riak_dt_map:update({update, [ | |
| {add, {key, riak_dt_lwwreg}}, | |
| {add, {val, riak_dt_pncounter}} | |
| ]}, braxton, M), | |
| %% Braxton sets key to 'a' and increments val by 1 | |
| {ok, M2B} = riak_dt_map:update({update, [ | |
| {update, {key, riak_dt_lwwreg}, {assign, a}}, |
| %% These are shell functions that can be used to output a keylist from a bitcask file in terms of Riak {Bucket,Key} tuples | |
| %% They should be run from `riak attach`. Paste in the contents and run ListAll("filename.txt"). Profit. | |
| ListCask = fun(Vnode,OutFile) -> | |
| Fold_data = fun(Handle) -> | |
| FoldFun = fun(Bytes, X, Y, {ok, Acc}) -> | |
| case Bytes of | |
| <<1:7, 0:1,Sz:16/integer,Bucket:Sz/bytes, Key/binary>> -> | |
| io:format(OutFile, "~s/~s~n", [binary_to_list(Bucket),binary_to_list(Key)]), {ok, Acc + 1}; |
#Map Reduce Delete Instructions
Set allow_strfun true on all nodes:
echo "rpc:multicall([node() | nodes()], application,set_env,[riak_kv,allow_strfun,true])." | bin/riak attach
Insert 15000 keys:
for i in {1..15000}; do curl -XPUT http://127.0.0.1:9000/buckets/test/keys/test$i -H "content-type: text/plain" -d "Data #$i\n"; done