mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 07:20:51 +08:00
fix bug: (#3000)
before fix,RAY_FUN_CACHE use only get method ,can only get null fix : put after create
This commit is contained in:
committed by
Robert Nishihara
parent
3ce8eb2d4c
commit
9c606ea06c
@@ -28,7 +28,7 @@ public class FunctionManager {
|
||||
* Cache from a RayFunc object to its corresponding FunctionDescriptor. Because
|
||||
* `LambdaUtils.getSerializedLambda` is expensive.
|
||||
*/
|
||||
private static final ThreadLocal<WeakHashMap<Class<RayFunc>, FunctionDescriptor>>
|
||||
private static final ThreadLocal<WeakHashMap<Class<? extends RayFunc>, FunctionDescriptor>>
|
||||
RAY_FUNC_CACHE = ThreadLocal.withInitial(WeakHashMap::new);
|
||||
|
||||
/**
|
||||
@@ -51,6 +51,7 @@ public class FunctionManager {
|
||||
final String methodName = serializedLambda.getImplMethodName();
|
||||
final String typeDescriptor = serializedLambda.getImplMethodSignature();
|
||||
functionDescriptor = new FunctionDescriptor(className, methodName, typeDescriptor);
|
||||
RAY_FUNC_CACHE.get().put(func.getClass(),functionDescriptor);
|
||||
}
|
||||
return getFunction(driverId, functionDescriptor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user