Quick start =========== Configuration ------------- Ray will read your configurations in the following order: * Java system properties: e.g., ``-Dray.run-mode=SINGLE_PROCESS``. * A ``ray.conf`` file in the classpath: `example `_. * Customise your own ``ray.conf`` path using system property ``-Dray.config=/path/to/ray.conf`` For all available config items and default values, see `this file `_. Starting Ray ------------ .. code:: java Ray.init(); Read and write remote objects ----------------------------- Each remote object is considered a ``RayObject`` where ``T`` is the type for this object. You can use ``Ray.put`` and ``RayObject.get`` to write and read the objects. .. code:: java Integer x = 1; RayObject obj = Ray.put(x); Integer x1 = obj.get(); assert (x.equals(x1)); Remote functions ---------------- Here is an ordinary java code piece for composing ``hello world example``. .. code:: java public class ExampleClass { public static void main(String[] args) { String str1 = add("hello", "world"); String str = add(str1, "example"); System.out.println(str); } public static String add(String a, String b) { return a + " " + b; } } We use ``@RayRemote`` to indicate that a function is remote, and use ``Ray.call`` to invoke it. The result from the latter is a ``RayObject`` where ``R`` is the return type of the target function. The following shows the changed example with ``add`` annotated, and correspondent calls executed on remote machines. .. code:: java public class ExampleClass { public static void main(String[] args) { Ray.init(); RayObject objStr1 = Ray.call(ExampleClass::add, "hello", "world"); RayObject objStr2 = Ray.call(ExampleClass::add, objStr1, "example"); String str = objStr2.get(); System.out.println(str); } @RayRemote public static String add(String a, String b) { return a + " " + b; } } More information ================ - `Installation `_ - `API document `_ - `Tutorial `_