[ 
https://issues.apache.org/jira/browse/BEAM-13560?focusedWorklogId=708363&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-708363
 ]

ASF GitHub Bot logged work on BEAM-13560:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jan/22 14:48
            Start Date: 13/Jan/22 14:48
    Worklog Time Spent: 10m 
      Work Description: daria-malkova commented on a change in pull request 
#16477:
URL: https://github.com/apache/beam/pull/16477#discussion_r784027376



##########
File path: playground/backend/internal/setup_tools/builder/setup_builder.go
##########
@@ -31,73 +31,139 @@ const (
        javaLogConfigFilePlaceholder = "{logConfigFile}"
 )
 
-// SetupExecutorBuilder return executor with set args for validator, 
preparator, compiler and runner
-func SetupExecutorBuilder(paths fs_tool.LifeCyclePaths, pipelineOptions 
string, sdkEnv *environment.BeamEnvs) (*executors.ExecutorBuilder, error) {
+// Validator return executor with set args for validator
+func Validator(paths *fs_tool.LifeCyclePaths, sdkEnv *environment.BeamEnvs) 
(*executors.ExecutorBuilder, error) {

Review comment:
       Let's do it at the next PR, it is not very critical right now

##########
File path: playground/backend/internal/setup_tools/builder/setup_builder.go
##########
@@ -31,73 +31,139 @@ const (
        javaLogConfigFilePlaceholder = "{logConfigFile}"
 )
 
-// SetupExecutorBuilder return executor with set args for validator, 
preparator, compiler and runner
-func SetupExecutorBuilder(paths fs_tool.LifeCyclePaths, pipelineOptions 
string, sdkEnv *environment.BeamEnvs) (*executors.ExecutorBuilder, error) {
+// Validator return executor with set args for validator
+func Validator(paths *fs_tool.LifeCyclePaths, sdkEnv *environment.BeamEnvs) 
(*executors.ExecutorBuilder, error) {
        sdk := sdkEnv.ApacheBeamSdk
-
-       if sdk == pb.Sdk_SDK_JAVA {
-               pipelineOptions = utils.ReplaceSpacesWithEquals(pipelineOptions)
-       }
-
        val, err := utils.GetValidators(sdk, paths.AbsoluteSourceFilePath)
        if err != nil {
                return nil, err
        }
+       builder := executors.NewExecutorBuilder().
+               WithValidator().
+               WithSdkValidators(val).
+               ExecutorBuilder
+       return &builder, err
+}
+
+// Preparer return executor with set args for preparator
+func Preparer(paths *fs_tool.LifeCyclePaths, sdkEnv *environment.BeamEnvs) 
(*executors.ExecutorBuilder, error) {

Review comment:
       same

##########
File path: playground/backend/internal/setup_tools/builder/setup_builder.go
##########
@@ -31,73 +31,139 @@ const (
        javaLogConfigFilePlaceholder = "{logConfigFile}"
 )
 
-// SetupExecutorBuilder return executor with set args for validator, 
preparator, compiler and runner
-func SetupExecutorBuilder(paths fs_tool.LifeCyclePaths, pipelineOptions 
string, sdkEnv *environment.BeamEnvs) (*executors.ExecutorBuilder, error) {
+// Validator return executor with set args for validator
+func Validator(paths *fs_tool.LifeCyclePaths, sdkEnv *environment.BeamEnvs) 
(*executors.ExecutorBuilder, error) {
        sdk := sdkEnv.ApacheBeamSdk
-
-       if sdk == pb.Sdk_SDK_JAVA {
-               pipelineOptions = utils.ReplaceSpacesWithEquals(pipelineOptions)
-       }
-
        val, err := utils.GetValidators(sdk, paths.AbsoluteSourceFilePath)
        if err != nil {
                return nil, err
        }
+       builder := executors.NewExecutorBuilder().
+               WithValidator().
+               WithSdkValidators(val).
+               ExecutorBuilder
+       return &builder, err
+}
+
+// Preparer return executor with set args for preparator
+func Preparer(paths *fs_tool.LifeCyclePaths, sdkEnv *environment.BeamEnvs) 
(*executors.ExecutorBuilder, error) {
+       sdk := sdkEnv.ApacheBeamSdk
        prep, err := utils.GetPreparators(sdk, paths.AbsoluteSourceFilePath)
        if err != nil {
                return nil, err
        }
-       executorConfig := sdkEnv.ExecutorConfig
        builder := executors.NewExecutorBuilder().
-               WithExecutableFileName(paths.AbsoluteExecutableFilePath).
-               WithWorkingDir(paths.AbsoluteBaseFolderPath).
-               WithValidator().
-               WithSdkValidators(val).
                WithPreparator().
                WithSdkPreparators(prep).
+               ExecutorBuilder
+       return &builder, err
+}
+
+// Compiler return executor with set args for compiler
+func Compiler(paths *fs_tool.LifeCyclePaths, sdkEnv *environment.BeamEnvs) 
*executors.ExecutorBuilder {

Review comment:
       same




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 708363)
    Time Spent: 2h 10m  (was: 2h)

> [Playground] Split builder (refactoring)
> ----------------------------------------
>
>                 Key: BEAM-13560
>                 URL: https://issues.apache.org/jira/browse/BEAM-13560
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-playground
>            Reporter: Daria Malkova
>            Assignee: Daria Malkova
>            Priority: P3
>              Labels: beam-playground-backend, beam-playground-sprint-7
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> Improve usage of executor builder by splitting it to parts.
> Now executor builder is created at once for all steps: validation, 
> preparation, compiling, and run/test. To make a change at some step we have 
> to change the created executor. To avoid it, we can create a builder for each 
> step separately after the previous steps are executed. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to