Suppose there are three EC2 instances called A,X,Y.
I'd like to execute Java program jx, jy in X, Y from other Java program ja in A. ja needs to pass command line argument of jx and jy.
For EC2 instance A, X, Y, and Java program ja, jx, jy,
A's ja------------> X's jx
-------------> Y's jy
The ja wait for finish of both jx and jy and obtain the result value (or file)
A's ja <---return val -------X's jx
<---return val ------ Y's jy
Again, ja execute jx and jy with other argument determined by the return values.
ja needs to execute jx and jy for 5 times respectively.
I think psudo code of ja is like below:
for(int i = 0; i < 5; i++){
rx = executeJX(argx);
ry = executeJY(argy);
waitJxJyFinish(); // jx and jy take ~30 min to finish.
(argx, argy) = determineNextArgXandArgY(rx, ry);
}
Constraint
This is for just experimental purpose, not production for daily use, that's why the least overhead way is the best even if it's dirty way. I don't have any experience of hadoop or any other staff. Simple and easy way is welcome.