mario donkey kong · distribution, distances, concurrency, commodity, scale: all these are reasons...
TRANSCRIPT
![Page 1: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/1.jpg)
![Page 2: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/2.jpg)
MarioMariovs.
Donkey Kong
![Page 3: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/3.jpg)
…oh, Pardon…
![Page 4: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/4.jpg)
Erlang/OTPvs.
Enterprise Java
![Page 5: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/5.jpg)
PavloBaron
![Page 6: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/6.jpg)
![Page 8: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/8.jpg)
![Page 9: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/9.jpg)
Why am I talking Why am I talking about it
![Page 10: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/10.jpg)
Do you think it’s about heart?
![Page 11: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/11.jpg)
Or is there another reason?
![Page 12: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/12.jpg)
I DON‘TLIKELIKE
JAVA!
![Page 13: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/13.jpg)
The world of IT, as we knew it, has knew it, has changed…
![Page 14: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/14.jpg)
Instead of huge cabinets…
![Page 15: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/15.jpg)
…we can now use lots of cheap commodity hardware
![Page 16: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/16.jpg)
Physics has hit the wall…
![Page 17: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/17.jpg)
…and we must think parallel
![Page 18: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/18.jpg)
Our physically Our physically huge globe…
![Page 19: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/19.jpg)
s
…became a tiny electronic ball. It‘s completely wired
![Page 20: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/20.jpg)
Spontanuous requirements…
![Page 21: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/21.jpg)
…can be covered by the fog (aka cloud)
![Page 22: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/22.jpg)
So what?
![Page 23: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/23.jpg)
We must accept some things…
![Page 24: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/24.jpg)
Functional languages much better suit parallel programming
![Page 25: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/25.jpg)
Extrem scenarios require require
technologies allowing extrem scalability – no scalability – no
forced standards
![Page 26: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/26.jpg)
Application types have pretty much changed
![Page 27: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/27.jpg)
Data became more different, more different, bigger, more fine-grained and more and more frequent
![Page 28: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/28.jpg)
High availability High availability counts for many among must-have parameters
![Page 29: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/29.jpg)
Distribution, distances, concurrency,concurrency,commodity,scale: all these are reasons why parts reasons why parts of a system can anytime crash
![Page 30: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/30.jpg)
Share-nothing approaches scale best
![Page 31: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/31.jpg)
Tell me something new –
Enterprise Java Enterprise Java solves it all. Where does Erlang/OTP Erlang/OTP
come into play?
![Page 32: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/32.jpg)
Exactly!Let‘s take a Let‘s take a look at it
![Page 33: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/33.jpg)
Language
![Page 34: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/34.jpg)
List<Integer> l = Arrays.asList(1, 2, 3, 4, 5);
Java: list processing
List<Integer> l = Arrays.asList(1, 2, 3, 4, 5);List<Integer> r = new ArrayList<Integer>();for (int i : l) {
if (i % 2 == 0) {r.add(i);
}}}
![Page 35: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/35.jpg)
Erlang: list comprehensions
[X || X <- lists:seq(1, 5), X rem 2 == 0].
![Page 36: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/36.jpg)
Where is more boilerplate?boilerplate?
![Page 37: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/37.jpg)
synchronized (this) {if (!crawledSites.contains(site)) {
linkedSites.add(site);}
}
…
Java:„concurrency“
…
public class CountingSemaphore {private int signals = 0;public synchronized void take() {
this.signals++;this.notify();
}
„concurrency“
public synchronized void release()throws InterruptedException {
while (this.signals == 0) wait();this.signals--;
}}
![Page 38: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/38.jpg)
Java concurrency: like two boxers alternating the gloves, thus hitting sequentially
![Page 39: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/39.jpg)
Java concurrency: like a Java concurrency: like a goalkeeper telling the forwards to wait while he takes a pull on a battle
![Page 40: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/40.jpg)
Erlang: functional
![Page 41: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/41.jpg)
Erlang: single assignment
![Page 42: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/42.jpg)
Erlang: single assignment
1> A = 5.52> A = 10.** exception error: no match of right hand side value 103>
![Page 43: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/43.jpg)
Enterprise Java: why not pick „more modern“ weapons?..
![Page 44: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/44.jpg)
Erlang: Share-nothing
![Page 45: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/45.jpg)
-record(state, {start,player1,
Erlang: message passing with state externalization
player1,player2
}).
..
State = #state{start=0}Pid ! {self(), State},Pid ! {self(), State},
receive{Pid, NewState} ->
…end,
![Page 46: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/46.jpg)
import kilim.Mailbox;import kilim.Pausable;import kilim.Task;
public class SimpleTask extends Task {static Mailbox<String> mb = new Mailbox<String>();
Java: „actor model“ This package comes with a bytecode transformation tool called Weaver (package: kilim.tools.Weaver) that post-processes .class fileslooking for the "throws Pausable" annotation.
When a task needs to pause, it
public static void main(String[] args) throws Exception {new SimpleTask().start();Thread.sleep(10);mb.putnb("Hello ");mb.putnb("World\n");mb.putnb("done");
}
public void execute() throws Pausable {while (true) {
When a task needs to pause, it unwinds its stack, squirrels away all state that it'll need later on resumption. This unwinding and rewinding the stack is automatically performed by the code introduced by the Weaver.(Debug information is adjusted so that the transformed code can be debugged inside eclipse) This is identical to what a
while (true) {String s = mb.get();if (s.equals("done")) break;
System.out.print(s);}
System.exit(0);}
}
is identical to what a programmer would havewritten
![Page 47: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/47.jpg)
Erlang: actor based
![Page 48: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/48.jpg)
register(serv, spawn(?MODULE, loop, []))serv ! {self(), “Hello there!”},receive
Spawn, loop, register und message passing
receive{_Pid, Msg} ->
…end.
…
loop() ->receive
{From, Txt}…loop();
![Page 49: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/49.jpg)
So what?In Java, I have
standards for standards for everything. And parallel systems I can solve with I can solve with Scala and Akka
![Page 50: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/50.jpg)
Exactly!Let‘s take a look at this as look at this as well
![Page 51: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/51.jpg)
Java: is it really the ultimate ultimate answer to everything?
![Page 52: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/52.jpg)
Enterprise Java: tries to standardize the half world
![Page 53: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/53.jpg)
This somehow reminds of…
![Page 54: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/54.jpg)
When Enterprise Java?
![Page 55: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/55.jpg)
When not Enterprise Java?
![Page 56: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/56.jpg)
Enterprise Java: suffers Swiss Army knife syndrome
![Page 57: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/57.jpg)
Java: application orientedoriented
![Page 58: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/58.jpg)
Java: especially concurrency and low level technology have generally never been to the fore
![Page 59: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/59.jpg)
Erlang/OTP: strong specialization
![Page 60: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/60.jpg)
Erlang: technology rather than application oriented. „Massive parallel“ from the beginning
![Page 61: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/61.jpg)
-define(IP_VERSION, 4).
Erlang: example of bitstring processing
-define(IP_VERSION, 4).-define(IP_MIN_HDR_LEN, 5).
DgramSize = byte_size(Dgram),case Dgram of
<<?IP_VERSION:4, HLen:4, SrvcType:8, TotLen:16, ID:16, Flgs:3, FragOff:13,TTL:8, Proto:8, HdrChkSum:16,SrcIP:32,DestIP:32, RestDgram/binary>> when HLen>=5, 4*HLen=<DgramSize ->DestIP:32, RestDgram/binary>> when HLen>=5, 4*HLen=<DgramSize ->OptsLen = 4*(HLen - ?IP_MIN_HDR_LEN),<<Opts:OptsLen/binary,Data/binary>> = RestDgram,
...end.
![Page 62: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/62.jpg)
When Erlang/OTP?
Network components controlNetwork components controlExtreme servers
Messaging middlewareDistributed systems
Systems for big data processingBulk calculation systemsBulk calculation systems
Critical systemsEvent control and processing
Bitstream processing
![Page 63: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/63.jpg)
When not Erlang/OTP?
UI-heavy applications
Application / business logic
Number crunchingNumber crunching
![Page 64: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/64.jpg)
Scala devotes itself primarily to… exactly, Scala!
![Page 65: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/65.jpg)
Scala doesn’t have an own VM und lives off the JVM
![Page 66: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/66.jpg)
JVM is by far not established in every IT in the world
![Page 67: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/67.jpg)
Scala‘s basis code inherits Java diseasesinherits Java diseases
![Page 68: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/68.jpg)
Akka development concentrates primarily on Scala
![Page 69: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/69.jpg)
Scala and Akka took over lots of Erlang concepts ☺
![Page 70: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/70.jpg)
Doesn’t matter!Enterprise Java platform is platform is proved, reliable, fault tolerantand optimal and optimal suitable for all situations!
![Page 71: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/71.jpg)
Exactly!Let‘s take a look at this, look at this, too
![Page 72: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/72.jpg)
Java: fault tolerancepublic static void main(String[] args) {
PathDasher dasher = new PathDasher(null); }
…
# A fatal error has been detected by the Java Runtime Environment:## EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006da97783, pid=4772, tid=3416### JRE version: 6.0_15-b03# Java VM: Java HotSpot(TM) 64-Bit Server VM (14.1-b02 mixed mode windows-amd64 )# Problematic frame:# V [jvm.dll+0x207783]
![Page 73: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/73.jpg)
Java: JNI crash will crash the whole JVM
![Page 74: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/74.jpg)
Erlang: fault tolerance
![Page 75: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/75.jpg)
1> self().<0.31.0>
Erlang: fault tolerance
<0.31.0>2> 5/0.** exception error: bad argument in an arithmetic expression
in operator '/'/2called as 5 / 0called as 5 / 0
3> self().<0.34.0>4>
![Page 76: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/76.jpg)
Erlang:supervisor trees
![Page 77: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/77.jpg)
-module(dr_supervisor).-behaviour(supervisor).
Erlang: supervisor tree
-behaviour(supervisor).-export([start_link/1]).-export([init/1]).
start_link(Args) ->supervisor:start_link({local, ?MODULE}, ?MODULE, Args).
init(Args) ->{ok, {{one_for_one, 2, 10}, [{ok, {{one_for_one, 2, 10}, [
{session, {dr_session, start_link, [Args]}, transient, 2000, supervisor, [dr_session]}]}}.
![Page 78: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/78.jpg)
-module(dr_session).-behaviour(supervisor).
-export([start_link/1]).
Erlang: supervisor tree
-export([start_link/1]).-export([init/1]).
start_link(Args) ->supervisor:start_link({local, ?MODULE}, ?MODULE, Args).
init(Args) ->error_logger:info_report("session started"),{ok, {{one_for_one, 2, 10}, [{ok, {{one_for_one, 2, 10}, [{server, {dr_session_server, start_link, [Args]}, transient, 2000, worker,
[dr_session_server]},{state, {dr_session_state, start_link, [Args]}, transient, 2000, worker,
[dr_session_state]},{vm, {dr_session_vm, start_link, [Args]}, transient, 2000, worker,
[dr_session_vm]}]}}.
![Page 79: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/79.jpg)
import org.gridgain.grid.*;import org.gridgain.grid.gridify.*;import org.gridgain.grid.gridify.aop.spring.*;
public final class GridifyHelloWorldSessionExample {private GridifyHelloWorldSessionExample() { //ensure singleton}
@Gridify(taskClass = GridifyHelloWorldSessionTask.class, timeout = 3000)public static int sayIt(String phrase) {
System.out.println(phrase);
Java: distribution
System.out.println(phrase);return phrase.length();
}
public static void main(String[] args) throws GridException {if (args.length == 0) {
GridFactory.start();}else {
GridFactory.start(args[0]);}
To use other AOP implementations (such as JBoss AOP, or Spring AOP), refer to AOP Configuration documentation.The following configuration needs to be applied to enable AspectJ byte code weaving.JVM configuration should include:
try {
int phraseLen = sayIt("Hello World");
System.out.println(„number of characters is '" + phraseLen + "'.");}finally {
GridFactory.stop(true);}
}}
-javaagent:[GRIDGAIN_HOME]/libs/aspectjweaver-1.5.3.jar
![Page 80: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/80.jpg)
Erlang: distributed
![Page 81: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/81.jpg)
Erlang: example of multicall for code reload
%% Find object code for module Mod
{Mod, Bin, File} = code:get_object_code(Mod),
%% and load it on all nodes including this one
{ResL, _} = rpc:multicall(code, load_binary, [Mod, Bin, File,], 5000),{ResL, _} = rpc:multicall(code, load_binary, [Mod, Bin, File,], 5000),
%% and then maybe check the ResL list.
![Page 82: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/82.jpg)
QueueConnectionFactory connFactory = new QueueConnectionFactory();QueueConnection conn = connFactory.createQueueConnection();QueueSession session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);Queue q = new Queue("world");
Java: message exchange
Queue q = new Queue("world");QueueSender sender = session.createSender(q);TextMessage msg = session.createTextMessage();msg.setText("Hello there!");sender.send(msg);
QueueReceiver receiver = session.createReceiver(q);conn.start();Message m = receiver.receive();if (m instanceof TextMessage) {
TextMessage txt = (TextMessage) m;TextMessage txt = (TextMessage) m;}
session.close();conn.close();
![Page 83: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/83.jpg)
Boilerplate?Even with Spring still symptom still symptom treatment
![Page 84: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/84.jpg)
Erlang: message oriented
![Page 85: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/85.jpg)
Erlang: message passing
Pid ! {self(), “Hello there!”},receive
{Pid, Txt} ->…
end,
![Page 86: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/86.jpg)
VM
![Page 87: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/87.jpg)
JVM threads are too “heavy”. Context switching is extremely expensive to have many thousands of them. Only hacks thousands of them. Only hacks such as CPS simulation over byte code manipulation provide a remedy und illusion of a remedy und illusion of lightweight threads
![Page 88: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/88.jpg)
import kilim.Mailbox;import kilim.Pausable;import kilim.Task;
public class SimpleTask extends Task {static Mailbox<String> mb = new Mailbox<String>();
Java: „concurrency“This package comes with a bytecode transformation tool called Weaver (package: kilim.tools.Weaver) that post-processes .class fileslooking for the "throws
public static void main(String[] args) throws Exception {new SimpleTask().start();Thread.sleep(10);mb.putnb("Hello ");mb.putnb("World\n");mb.putnb("done");
}
public void execute() throws Pausable {while (true) {
looking for the "throws Pausable" annotation.
When a task needs to pause, it unwinds its stack, squirrels away all state that it'll need later on resumption. This unwinding and rewinding the stack is automatically performed by the code introduced by the Weaver.(Debug information is adjusted while (true) {
String s = mb.get();if (s.equals("done")) break;
System.out.print(s);}
System.exit(0);}
}
(Debug information is adjusted so that the transformed code can be debugged inside eclipse) This is identical to what a programmer would havewritten
![Page 89: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/89.jpg)
Java: instance-wide garbage collector
![Page 90: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/90.jpg)
Erlang: concurrent.Hunderts of Hunderts of thousends of lightweight VM processes per node processes per node instead of „native“ threads-> own scheduler
![Page 91: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/91.jpg)
Erlang: heap per process -> garbage collected per process
![Page 92: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/92.jpg)
Hot swapping
![Page 93: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/93.jpg)
Java: ClassLoadertrees can be trees can be complex and unpredictable.Middlewareoften causesoften causeslib conflicts
![Page 94: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/94.jpg)
Java: OSGi is invasive and imports a middleware
![Page 95: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/95.jpg)
Java: app server fatigue is a common phenomenon after
frequent application redeploymentredeployment
![Page 96: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/96.jpg)
Java: zero downtime systems are possible only with human support
![Page 97: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/97.jpg)
% hot_swap:sum(Num) addiert 1 dazu1> c(hot_swap).{ok,hot_swap}
Erlang: live code upgrade
{ok,hot_swap}2> hot_swap:sum(1).2...%hot_swap.erl wurde modifiziert. Jetzt% addiert es 2 dazu……3> c(hot_swap).{ok,hot_swap}4> hot_swap:sum(1).35>
![Page 98: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/98.jpg)
Erlang: non-stop systems arepossible and implemented
![Page 99: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/99.jpg)
Come on!Come on!Enterprise Java offers even more scalabilityscalability
![Page 100: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/100.jpg)
Exactly!This should also be also be considered
![Page 101: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/101.jpg)
Java doesn‘t scale as originally expected
Hacks
Scala & Co.
Java
EnterpriseJava
![Page 102: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/102.jpg)
Erlang: scaling
![Page 103: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/103.jpg)
From sequential program to world-wide distribution
MulticoreProgramming
DistributedProgramming
SequentialErlang
FunctionalErlang
![Page 104: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/104.jpg)
Frameworks
![Page 105: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/105.jpg)
Java: Framework-itis(like others, too ☺)
![Page 106: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/106.jpg)
Erlang: generic behaviors
![Page 107: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/107.jpg)
Erlang/OTP: behaviors
-module(dr_session_state).-behaviour(gen_fsm).-behaviour(gen_fsm).
-export([start_link/1]).-export([init/1]).
start_link(Args) ->gen_fsm:start_link({local, ?MODULE}, ?MODULE, Args, []).
init(_Args) ->init(_Args) ->error_logger:info_report("state started"),{ok, waiting1, []}.
![Page 108: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/108.jpg)
Erlang/OTP:behaviors
-module(dr_session_server).-behaviour(gen_server).
-export([start_link/1]).-export([init/1]).-export([code_change/3]).-export([handle_call/3]).-export([handle_cast/2]).-export([handle_cast/2]).-export([handle_info/2]).-export([terminate/2]).
-record(state, {start,player1,player2
}).
start_link(Args) ->gen_server:start_link({local, ?MODULE}, ?MODULE, [Args], []).
init(_Args) ->error_logger:info_report("server started"),process_flag(trap_exit, true),{ok, #state{}}.
…
![Page 109: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/109.jpg)
Erlang/OTP: behaviors
-module(dr_gen_vm).-export([behaviour_info/1]).
behaviour_info(callbacks) ->[{init,1}];
behaviour_info(_Other) ->undefined.undefined.
![Page 110: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/110.jpg)
NoSQL DSs made in Java don‘t implement Java standards for data access because they are impractical, and use open impractical, and use open standards instead
![Page 111: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/111.jpg)
NoSQL DSs made in Erlangreceive many things as a gift…
![Page 112: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/112.jpg)
Erlang: big data storage possibilities
![Page 113: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/113.jpg)
Erlang: Dets = Disk Erlang Term Storage
{_,D} = dets:open_file(„example“), dets:delete_all_objects(D),dets:insert(D, {mama, mia}),dets:insert(D, {here, we}),dets:insert(D, {go, again}),dets:insert(D, {go, again}),dets:close(D),
![Page 114: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/114.jpg)
Erlang: Mnesia = dets + transactions, quiries and
distributionmnesia:create_schema([node()]),mnesia:start(),mnesia:start(),mnesia:create_table(album,
[ {disc_copies, [node()] },{attributes,
record_info(fields, album)} ]),Insert = fun() ->
mnesia:write(#album{ index=A_Index,#album{ index=A_Index,
artist=A_Artist,title=A_Title } ) end,
{atomic, Result} = mnesia:transaction(Insert),…
![Page 115: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/115.jpg)
Really? ButEnterprise Java Enterprise Java integrates everything in the world!world!
![Page 116: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/116.jpg)
Exactly!Let‘s see…Let‘s see…
![Page 117: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/117.jpg)
Java prefers to integrate non-natively, from afar –natively, from afar –for example per web service. In a pinch JNI will do –at own risk.at own risk.
![Page 118: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/118.jpg)
Erlang: integrated
![Page 119: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/119.jpg)
Erlang: ways to integration
Erlang node Pseudo-OTP
Erlang program
PortPort
OTPnode with the externalprogram
Binary data
Linked-inDriver
Externalprogram
Binary data
![Page 120: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/120.jpg)
Erlang: example JInterfaceimport com.ericsson.otp.erlang.*;
...
OtpNode self = new OtpNode("pseudo@test");OtpNode self = new OtpNode("pseudo@test");OtpMbox mbox = self.createMbox("pingpong");OtpErlangObject o;OtpErlangTuple msg;OtpErlangPid from;
while (true) {try {o = mbox.receive();if (o instanceof OtpErlangTuple) {
msg = (OtpErlangTuple)o;msg = (OtpErlangTuple)o;from = (OtpErlangPid)(msg.elementAt(0));mbox.send(from, msg.elementAt(1));
}catch (Exception e) {...
}}
![Page 121: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/121.jpg)
Erlang: example JInterface
-module(pongclient).-export([pong/0]).
pong() ->{pingpong, "pseudo@test“} ! {self(), "ball"},receive
Result ->io:format("What comes back is : ~p~n", [Result])
end.
![Page 122: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/122.jpg)
And even I can do web services these days ☺
![Page 123: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/123.jpg)
Stop!Stop!I am constrained to the JVM!Period.Period.
![Page 124: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/124.jpg)
BEAM is not an option for every IT
![Page 125: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/125.jpg)
Erjang – Erlang on the JVM. It can already
boot some big Erlangsystems. It’s under systems. It’s under
development.I do help ☺
![Page 126: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/126.jpg)
Right tool for the job
![Page 127: Mario Donkey Kong · Distribution, distances, concurrency, commodity, scale: all these are reasons why parts of a system can anytime crash](https://reader031.vdocuments.mx/reader031/viewer/2022022110/5c143c5f09d3f2256b8b7174/html5/thumbnails/127.jpg)
Thank you