Skip to content

Commit

Permalink
Merge pull request apache#17678 from [BEAM-14460] [Playground] WIP. F…
Browse files Browse the repository at this point in the history
…ix error during getting the graph for java SDK.
  • Loading branch information
vchunikhin authored May 17, 2022
1 parent d51a601 commit e65b4a3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions playground/backend/internal/preparers/java_preparers.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const (
newLinePattern = "\n"
javaPublicClassNamePattern = "public class (.*?) [{|implements(.*)]"
pipelineNamePattern = `Pipeline\s([A-z|0-9_]*)\s=\sPipeline\.create`
findImportsPattern = `import.*\;`
graphSavePattern = "String dotString = org.apache.beam.runners.core.construction.renderer.PipelineDotRenderer.toDotString(%s);\n" +
" try (java.io.PrintWriter out = new java.io.PrintWriter(\"Graph.dot\")) {\n " +
" out.println(dotString);\n " +
Expand Down Expand Up @@ -107,7 +106,7 @@ func (builder *JavaPreparersBuilder) WithGraphHandler() *JavaPreparersBuilder {
func addCodeToSaveGraph(args ...interface{}) error {
filePath := args[0].(string)
pipelineObjectName, _ := findPipelineObjectName(filePath)
graphSaveCode := fmt.Sprintf(graphSavePattern, pipelineObjectName, utils.GraphFileName)
graphSaveCode := fmt.Sprintf(graphSavePattern, pipelineObjectName, pipelineObjectName)

if pipelineObjectName != utils.EmptyLine {
err := replace(filePath, fmt.Sprintf("%s.run", pipelineObjectName), graphSaveCode)
Expand Down

0 comments on commit e65b4a3

Please sign in to comment.