[Java] Add doc for Ray.get api that throws an exception if it times out (#23666)

Add doc for Ray.get api that throws an exception if it times out

![image](https://user-images.githubusercontent.com/11072802/161364231-4337124d-3141-4334-879c-f88cecc0d818.png)

Co-authored-by: 稚鱼 <lianjunwen.ljw@antgroup.com>
This commit is contained in:
Larry 2022-04-02 18:29:19 +08:00 committed by GitHub
parent e1a974aa9c
commit d0b324990f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 0 deletions

View file

@ -18,6 +18,7 @@ public interface ObjectRef<T> {
* available.
*
* @param timeoutMs The maximum amount of time in miliseconds to wait before returning.
* @throws RayTimeoutException If it's timeout to get the object.
*/
T get(long timeoutMs);
}

View file

@ -83,6 +83,7 @@ public final class Ray extends RayCall {
* @param objectRef The reference of the object to get.
* @param timeoutMs The maximum amount of time in miliseconds to wait before returning.
* @return The Java object.
* @throws RayTimeoutException If it's timeout to get the object.
*/
public static <T> T get(ObjectRef<T> objectRef, long timeoutMs) {
return internal().get(objectRef, timeoutMs);
@ -104,6 +105,7 @@ public final class Ray extends RayCall {
* @param objectList A list of object references.
* @param timeoutMs The maximum amount of time in miliseconds to wait before returning.
* @return A list of Java objects.
* @throws RayTimeoutException If it's timeout to get the object.
*/
public static <T> List<T> get(List<ObjectRef<T>> objectList, long timeoutMs) {
return internal().get(objectList, timeoutMs);

View file

@ -74,6 +74,7 @@ public interface RayRuntime {
* @param objectRef The reference of the object to get.
* @param timeoutMs The maximum amount of time in millseconds to wait before returning.
* @return The Java object.
* @throws RayTimeoutException If it's timeout to get the object.
*/
<T> T get(ObjectRef<T> objectRef, long timeoutMs);
@ -83,6 +84,7 @@ public interface RayRuntime {
* @param objectRefs The list of object references.
* @param timeoutMs The maximum amount of time in millseconds to wait before returning.
* @return A list of Java objects.
* @throws RayTimeoutException If it's timeout to get the object.
*/
<T> List<T> get(List<ObjectRef<T>> objectRefs, long timeoutMs);

View file

@ -102,6 +102,7 @@ public abstract class ObjectStore {
* @param objectIds IDs of the objects to get.
* @param timeoutMs Timeout in milliseconds, wait infinitely if it's negative.
* @return Result list of objects data.
* @throws RayTimeoutException If it's timeout to get the object.
*/
public abstract List<NativeRayObject> getRaw(List<ObjectId> objectIds, long timeoutMs);
@ -124,6 +125,7 @@ public abstract class ObjectStore {
* @param <T> Type of these objects.
* @param timeoutMs The maximum amount of time in seconds to wait before returning.
* @return A list of GetResult objects.
* @throws RayTimeoutException If it's timeout to get the object.
*/
@SuppressWarnings("unchecked")
public <T> List<T> get(List<ObjectId> ids, Class<?> elementType, long timeoutMs) {