Skip to content

Instantly share code, notes, and snippets.

View moonpolysoft's full-sized avatar

Cliff Moon moonpolysoft

View GitHub Profile
#!/usr/bin/env escript
-mode(compile).
main([Size]) ->
B = bloom:new(list_to_integer(Size), 0.001),
{_, Keys} = lists:foldl(fun(_, {Last, Acc}) ->
Mod = succ(Last),
{Mod, [Mod|Acc]}
end, {"aaaaaaaa", []}, lists:seq(1,10000)),
diff --git a/configuration.cc b/configuration.cc
index 5d089e9..ccee3e7 100644
--- a/configuration.cc
+++ b/configuration.cc
@@ -35,7 +35,7 @@
*/
#include <confuse.h>
-
+#include <unistd.h>
KHUMA & ASSOCIATES
8 Gerald Arden Road
Pretoria, South
Africa.
Tel: +27 732 212 357.
I want to bring to your notice that you have been bequeathed a total sum
of $875,000 by my late client Mr. Ted Govender who before his death was a
member of the Red Cross Society South Africa Chapter.
Status:
Publishing gets completed in under a second:
info: [{memory,303357},
{owner,<0.2888.0>},
{heir,none},
{name,subs},
{size,20000},
{node,'janus@domU-12-31-39-02-B5-46'},
{named_table,false},
def fromErlang(x: OtpErlangTuple) : Thingie = {
x.elements match {
case Array(Atom("set"), id : OtpErlangLong, list : OtpErlangList) =>
...
trait OtpConversions {
implicit def erlangLongToInteger(erl : OtpErlangLong) : Int = erl.intValue
implicit def erlangAtomToString(erl : OtpErlangAtom) : String = erl.atomValue
}
bootstrap procedure
* new node joins the network
* new partition ownership gets computed
* each node compiles two lists of partitions: those that it is losing and those that it is gaining, regardless of where it appears in the preference list
* each node is then responsible for initiating any receiving processes for partitions it is gaining and sending processes for only the master (first in the pref list) partitions it is losing
* if a receiving process comes up for a partition that appears to contain data on disk, that partition folder will be moved to a backup name and an alert registered in the alert API
* sending processes should be able to broadcast packets to more than one receiver in the case where several replicas must be bootstrapped
* the bootstrap processes are all registered in local bootstrap managers
* each node is responsible for tracking the status of any local bootstrap processes
val bytes : Array[Byte] = value.toBytes
bytes must haveSize(9)
rev2 bootstrap procedure
* X new nodes come up and optionally join an existing distributed erlang cluster. they DO NOT issue dynomite join commands.
* When a new node comes up it starts in single mode with a number of local storage servers and is ready to serve requests unless it has existing membership/partition state from disk
* Once all of the new nodes that need to be merged are up and running an administrator or script must issue a request to the admin API enumerating the nodes which must be joined
* The admin API returns a token that can be used to check the status of the bootstrap process, or an outright failure if any member node is unreachable at the time bootstrap starts
* An ad-hoc master process is started up, which helps to monitor and coordinate the bootstrap process
* Each node's membership server will receive a join command with the new member node list and partition mapping
* the individual servers will all compute listings of partitions gained and lost across the cluster
* if a node is los
-define(assertRecv(Pattern, Timeout),
((fun () ->
receive V = Pattern -> V
after Timeout ->
receive __X ->
.erlang:error({assertRecv_failed,
[{module, ?MODULE},
{line, ?LINE},
{pattern, (??Pattern)},
{received, __X}]})
erlc +debug_info -W0 -I etest -I include -I deps/mochiweb/include -I gen-erl/ -o ebin elibs/web_rpc.erl
erl -boot start_sasl +K true +A 30 +P 60000 -smp enable -pa /Users/cliff/projects/dynomite/ebin/ -pa /Users/cliff/projects/dynomite/deps/mochiweb/ebin -pa /Users/cliff/projects/dynomite/deps/rfc4627/ebin -pa /Users/cliff/projects/dynomite/deps/thrift/ebin -sname dynomite -kernel error_logger '{file,"log/dynomite.log"}' -sasl sasl_error_logger '{file,"log/sasl.log"}' -dynomite config "\"config.json\"" -dynomite nodefile "\"node.json\"" -setcookie e841d215484685567858aaec4d25af2f -run dynomite start
Erlang R13B (erts-5.7.1) [source] [smp:2:2] [rq:2] [async-threads:30] [kernel-poll:true]
Eshell V5.7.1 (abort with ^G)
(dynomite@galva)1>
[starting] local configuration ...complete
[starting] global configuration ...complete
[starting] stats collection ...complete
[starting] membership server ...comp