mirror of
https://github.com/wassname/ray.git
synced 2026-07-10 19:28:26 +08:00
[Java] Pass large object by reference (#7595)
This commit is contained in:
@@ -2,8 +2,13 @@ package org.ray.runtime.task;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.ray.api.Ray;
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.id.ObjectId;
|
||||
import org.ray.api.runtime.RayRuntime;
|
||||
import org.ray.runtime.AbstractRayRuntime;
|
||||
import org.ray.runtime.RayMultiWorkerNativeRuntime;
|
||||
import org.ray.runtime.generated.Common.Language;
|
||||
import org.ray.runtime.object.NativeRayObject;
|
||||
import org.ray.runtime.object.ObjectSerializer;
|
||||
@@ -38,7 +43,13 @@ public class ArgumentsBuilder {
|
||||
} else {
|
||||
value = ObjectSerializer.serialize(arg);
|
||||
if (value.data.length > LARGEST_SIZE_PASS_BY_VALUE) {
|
||||
// Do nothing since we are not support pass by reference in direct call.
|
||||
RayRuntime runtime = Ray.internal();
|
||||
if (runtime instanceof RayMultiWorkerNativeRuntime) {
|
||||
runtime = ((RayMultiWorkerNativeRuntime) runtime).getCurrentRuntime();
|
||||
}
|
||||
id = ((AbstractRayRuntime) runtime).getObjectStore()
|
||||
.putRaw(value);
|
||||
value = null;
|
||||
}
|
||||
}
|
||||
if (language == Language.PYTHON) {
|
||||
|
||||
Reference in New Issue
Block a user