mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01:43 -05:00
[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  Co-authored-by: 稚鱼 <lianjunwen.ljw@antgroup.com>
This commit is contained in:
parent
e1a974aa9c
commit
d0b324990f
4 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue