Skip to content

[pipeline threadpool] Pass and manage the Executor by user #4339

@xrayw

Description

@xrayw

Now, there is still create a new threadpool for each pipeline sync.

executorService = Executors.newFixedThreadPool(MULTI_NODE_PIPELINE_SYNC_WORKERS);



And this pr seems too complex and inflexible. Difficult to meet complex scenarios https://github.com//pull/4070

I have an idea for minimal changes, we can add a method that allows user to pass in the thread pool by themselves

like

public ClusterPipeline pipelined(Executor pipelineExecutor) {
  return new ClusterPipeline((ClusterConnectionProvider) provider, (ClusterCommandObjects) commandObjects, pipelineExecutor);
}

and make some minor modifications to other classes, like ClusterPipeline & MultiNodePipelineBase

Image

This change is minor and can be adapted to any complex user scenario.



Any feedback is welcome. thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions