mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 20:24:03 +08:00
[Java] Fix the required-resources issue of actor member function in Java worker. (#3002)
This fixes a bug in which Java actor methods inherit the resource requirements of the actor creation task.
This commit is contained in:
committed by
Robert Nishihara
parent
b45bed4bce
commit
fcef4edd46
@@ -58,12 +58,17 @@ public class RayFunction {
|
||||
}
|
||||
|
||||
public RayRemote getRayRemoteAnnotation() {
|
||||
RayRemote rayRemote = executable.getAnnotation(RayRemote.class);
|
||||
if (rayRemote == null) {
|
||||
// If the method doesn't have a annotation, get the annotation from
|
||||
// its wrapping class.
|
||||
RayRemote rayRemote;
|
||||
|
||||
// If this method is a constructor, the task of it should be a actorCreationTask.
|
||||
// And the annotation of actorCreationTask should inherit from class.
|
||||
// Otherwise, it's a normal method, and it shouldn't inherit annotation from class.
|
||||
if (isConstructor()) {
|
||||
rayRemote = executable.getDeclaringClass().getAnnotation(RayRemote.class);
|
||||
} else {
|
||||
rayRemote = executable.getAnnotation(RayRemote.class);
|
||||
}
|
||||
|
||||
return rayRemote;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user