#22903 Fix code snippeds

* move scala and java sources out of paradox sources
* replace relative paths with $code$ and $akka$
* fix broken includes
This commit is contained in:
Martynas Mickevičius 2017-05-11 11:59:28 +03:00
parent 7bee495749
commit 81df4ff417
384 changed files with 1609 additions and 1602 deletions

View file

@ -0,0 +1,27 @@
package jdocs.cluster;
import java.util.HashMap;
import java.util.Map;
import akka.actor.AbstractActor;
//#worker
public class StatsWorker extends AbstractActor {
Map<String, Integer> cache = new HashMap<String, Integer>();
@Override
public Receive createReceive() {
return receiveBuilder()
.match(String.class, word -> {
Integer length = cache.get(word);
if (length == null) {
length = word.length();
cache.put(word, length);
}
getSender().tell(length, getSelf());
})
.build();
}
}
//#worker