Remove outdated Java doc and run demo code in CI (#10698)

Resolve Conflicts:
        java/tutorial/pom.xml
        java/tutorial/pom_template.xml
This commit is contained in:
Hao Chen
2020-09-22 23:49:45 +00:00
committed by Barak Michener
parent 45addcf6bd
commit 696ca394d2
21 changed files with 95 additions and 771 deletions
+6 -6
View File
@@ -59,20 +59,20 @@ Ray provides Python and Java API. And Ray uses Tasks (functions) and Actors (Cla
public class RayDemo {
public static int f(int x) {
public static int square(int x) {
return x * x;
}
public static class Counter {
private int n = 0;
private int value = 0;
public void increment() {
this.n += 1;
this.value += 1;
}
public int read() {
return this.n;
return this.value;
}
}
@@ -81,10 +81,10 @@ Ray provides Python and Java API. And Ray uses Tasks (functions) and Actors (Cla
Ray.init();
{
List<ObjectRef<Integer>> objectRefList = new ArrayList<>();
// Invoke the `f` method 4 times remotely as Ray tasks.
// Invoke the `square` method 4 times remotely as Ray tasks.
// The tasks will run in parallel in the background.
for (int i = 0; i < 4; i++) {
objectRefList.add(Ray.task(RayDemo::f, i).remote());
objectRefList.add(Ray.task(RayDemo::square, i).remote());
}
// Get the actual results of the tasks with `get`.
System.out.println(Ray.get(objectRefList)); // [0, 1, 4, 9]
+6 -6
View File
@@ -50,7 +50,7 @@ Parallelizing Python/Java Functions with Ray Tasks
public class RayDemo {
public static int f(int x) {
public static int square(int x) {
return x * x;
}
@@ -58,10 +58,10 @@ Parallelizing Python/Java Functions with Ray Tasks
// Intialize Ray runtime.
Ray.init();
List<ObjectRef<Integer>> objectRefList = new ArrayList<>();
// Invoke the `f` method 4 times remotely as Ray tasks.
// Invoke the `square` method 4 times remotely as Ray tasks.
// The tasks will run in parallel in the background.
for (int i = 0; i < 4; i++) {
objectRefList.add(Ray.task(RayDemo::f, i).remote());
objectRefList.add(Ray.task(RayDemo::square, i).remote());
}
// Get the actual results of the tasks.
System.out.println(Ray.get(objectRefList)); // [0, 1, 4, 9]
@@ -114,14 +114,14 @@ maintain its own internal state.
public static class Counter {
private int n = 0;
private int value = 0;
public void increment() {
this.n += 1;
this.value += 1;
}
public int read() {
return this.n;
return this.value;
}
}