texera icon indicating copy to clipboard operation
texera copied to clipboard

Create OperatorExecutor on Worker side

Open shengquan-ni opened this issue 4 years ago • 3 comments

Our engine creates an OperatorExecutor upon the creation of a worker actor. However, the OperatorExecutor is first created by calling a (Int) => IOperatorExecutor lambda function on the controller, then serialized and passed to the worker side. This will cause unnecessary memory allocation. In the worst case, OperatorExecutor may establish some connections that cannot be serialized (this ideally should be done inside open(), but we are not restricting developers to do that in the constructor). So I propose we pass a () => IOperatorExecutor lambda to the worker's constructor, then let the worker execute it. So the OperatorExecutor will be created on worker side.

shengquan-ni avatar Feb 01 '21 03:02 shengquan-ni

I noticed for some operators, we passed a java lambda function as (Int) => IOperatorExecutor. Although scala will convert it to a scala lambda function, it won't be marked as Serializable. So the akka serializer will complain. For now, I didn't find any good way to solve this issue.

shengquan-ni avatar Feb 01 '21 03:02 shengquan-ni

Discussion 01/13/2021: @shengquan-ni will look into it. Not urgent.

Yicong-Huang avatar Jan 13 '22 21:01 Yicong-Huang

Discussion 2022.05.12: WIP, not urgent.

Xiao-zhen-Liu avatar May 12 '22 20:05 Xiao-zhen-Liu

Discussion 2022.12.07: WIP, to be done within 1 or 2 months.

Xiao-zhen-Liu avatar Dec 08 '22 00:12 Xiao-zhen-Liu

Fixed in #1807.

shengquan-ni avatar Apr 10 '23 20:04 shengquan-ni