Skip to content

Instantly share code, notes, and snippets.

@jboner
jboner / akka-cluster-implementation-notes.md
Last active October 9, 2024 11:34
Akka Cluster Implementation Notes

Akka Cluster Implementation Notes

Slightly disorganized but reasonably complete notes on the algorithms, strategies and optimizations of the Akka Cluster implementation. Could use a lot more links and context etc., but was just written for my own understanding. Might be expanded later.

Links to papers and talks that have inspired the implementation can be found on the 10 last pages of this presentation.

Akka Gossip

Gossip state

This is the Gossip state representation:

@retronym
retronym / sbt-quickstart.txt
Created January 22, 2013 21:27
try a library with sbt-extras
~/code/scratch1 sbt -sbt-create -scala-version 2.10.0 'set libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.0.0-M7"' 'console'
Detected sbt version 0.12.2-RC2
Using /Users/jason/.sbt/0.12.2-RC2 as sbt dir, -sbt-dir to override.
[info] Set current project to default-821d14 (in build file:/Users/jason/code/scratch1/)
[info] Defining */*:log-level
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to default-821d14 (in build file:/Users/jason/code/scratch1/)
[info] Defining {.}/*:scala-version
[info] The new value will be used by no settings or tasks.
@gseitz
gseitz / FSMSupervision.scala
Created August 23, 2012 21:12
Akka FSM Supervision
package akka.actor
import collection.mutable
import akka.actor.FSM.{ CurrentState, Transition, UnsubscribeTransitionCallBack, SubscribeTransitionCallBack }
import akka.routing.{ Deafen, Listen }
case object PreRestart
case object PostRestart
trait ParentNotification { thisActor: Actor ⇒
@retronym
retronym / just-do-it.log
Created August 19, 2012 22:10
Just Do It: TODO comments in scala/scala git-blamed on commits between 2.9.2 and 2.10-0-SNAPSHOT
========================================
Adriaan Moors
========================================
= src/compiler/scala/tools/nsc/ast/TreeGen.scala
1dbcbd5 2012-02-17 75 // TODO: would be so much nicer if we would know during match-translation (i.e., type checking)
= src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala
2890714 2012-04-24 536 // TODO: clean this up -- there is too much information packked into makePatDef's `pat` argument
= src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
a57ac60 2012-02-13 1107 var ctx1 = genLoad(selector, ctx, INT) // TODO: Java 7 allows strings in switches (so, don't assume INT and don't convert the literals using intValue)
= src/compiler/scala/tools/nsc/transform/Erasure.scala
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@retronym
retronym / hash-set-reflect.txt
Created August 7, 2012 06:13
hash-set-reflect
scala> val cm = reflect.runtime.currentMirror
cm: reflect.runtime.universe.Mirror = JavaMirror with scala.tools.nsc.interpreter.IMain$TranslatingClassLoader@2635ee49 of type class scala.tools.nsc.interpreter.IMain$TranslatingClassLoader with classpath [(memory)] and parent being scala.tools.nsc.util.ScalaClassLoader$URLClassLoader@1eaf0e38 of type class scala.tools.nsc.util.ScalaClassLoader$URLClassLoader with classpath [file:/Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents/Classes/classes.jar,file:/Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents/Classes/ui.jar,file:/Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents/Classes/jsse.jar,file:/Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents/Classes/jce.jar,file:/Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents/Class...
scala> val hs = cm.universe.typeOf[collection.immutable.HashSet[_]]
hs: cm.universe.Type = scala.collection.immutable.HashSet[_]
scala> println(hs.members.map(m => (m.owner.own