This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> :javap MongoDB | |
public class MongoDB$ extends java.lang.Object { | |
public static final MongoDB$ MODULE$; // actual instance of our `object` | |
public static {}; | |
public MongoDB$(); | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pl.project13.hadoop.scalding.NoJarTool | |
import com.twitter.scalding | |
import org.apache.hadoop.util.ToolRunner | |
import org.apache.hadoop.conf.Configuration | |
val conf = new Configuration | |
val masterIp = "10.0.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def writeAsync(persistentBatch: immutable.Seq[PersistentRepr]): Future[Unit] | |
def deleteAsync(processorId: String, fromSequenceNr: Long, toSequenceNr: Long, permanent: Boolean): Future[Unit] | |
def confirmAsync(processorId: String, sequenceNr: Long, channelId: String): Future[Unit] | |
// and "replay": | |
def replayAsync(processorId: String, fromSequenceNr: Long, toSequenceNr: Long) | |
(replayCallback: (PersistentRepr) => Unit): Future[Long] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Use for testing. | |
* | |
* Forwards all messages received to the system's EventStream. | |
* Use this to deterministically `awaitForLeaderElection` etc. | |
*/ | |
trait EventStreamAllMessages { | |
this: Actor => | |
override def aroundReceive(receive: Actor.Receive, msg: Any) = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for { | |
item <- items | |
transformed = transform(item) | |
} yield transformed | |
// let's say you need a println | |
def print(a: Any) = { println(a); a } | |
for { | |
item <- items |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class ManyCommand(nums: List[Int]) | |
case class State(count: Int) { | |
def updated(more: Int) = State(count + more) | |
} | |
sealed trait Event | |
case class AddOneEvent(num: Int) extends Event | |
class MultiCounter extends EventsourcedProcessor { |
- Martin Odersky - @odersky
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-06-22 12:45:37 | |
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.0-b70 mixed mode): | |
"Attach Listener" #87 daemon prio=9 os_prio=31 tid=0x00007fe6bc084000 nid=0x651f waiting on condition [0x0000000000000000] | |
java.lang.Thread.State: RUNNABLE | |
"pool-9-thread-7" #86 prio=5 os_prio=31 tid=0x00007fe6bf504800 nid=0x9d03 waiting on condition [0x0000000126b70000] | |
java.lang.Thread.State: TIMED_WAITING (parking) | |
at sun.misc.Unsafe.park(Native Method) | |
- parking to wait for <0x0000000780f9f760> (a java.util.concurrent.SynchronousQueue$TransferStack) |