-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for ParentIterative Edge
- Loading branch information
1 parent
b688980
commit 08da159
Showing
10 changed files
with
195 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) 2023 Uber Technologies, Inc. | ||
# | ||
# <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
# except in compliance with the License. You may obtain a copy of the License at | ||
# <p>http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# <p>Unless required by applicable law or agreed to in writing, software distributed under the | ||
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
# express or implied. See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
[[edges]] | ||
scope = "ParentIterative" | ||
from = "spark_conf_change_java_scala" | ||
to = ["BuilderPattern"] | ||
|
||
[[edges]] | ||
scope = "ParentIterative" | ||
from = "BuilderPattern" | ||
to = ["BuilderPattern"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Copyright (c) 2023 Uber Technologies, Inc. | ||
# | ||
# <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
# except in compliance with the License. You may obtain a copy of the License at | ||
# <p>http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# <p>Unless required by applicable law or agreed to in writing, software distributed under the | ||
# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
# express or implied. See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
[[rules]] | ||
name = "spark_conf_change_java_scala" | ||
query = "cs new SparkConf()" | ||
replace_node = "*" | ||
replace = 'new SparkSession.builder()' | ||
|
||
|
||
[[rules]] | ||
name = "set_spark_home_change_java_scala" | ||
query = "cs :[r].setSparkHome(:[a1])" | ||
replace_node = "*" | ||
replace = "@r.sparkHome(@a1)" | ||
is_seed_rule = false | ||
groups = ["BuilderPattern"] | ||
|
||
[[rules]] | ||
name = "set_executor_env_change_2_java_scala" | ||
query = "cs :[r].setExecutorEnv(:[a1], :[a2])" | ||
replace_node = "*" | ||
replace = "@r.executorEnv(@a1, @a2)" | ||
is_seed_rule = false | ||
groups = ["BuilderPattern"] | ||
|
||
|
||
[[rules]] | ||
name = "app_name_change_java_scala" | ||
query = "cs :[r].setAppName(:[app_name])" | ||
replace_node = "*" | ||
replace = "@r.appName(@app_name)" | ||
is_seed_rule = false | ||
groups = ["BuilderPattern"] | ||
|
||
[[rules]] | ||
name = "master_name_change_java_scala" | ||
query = "cs :[r].setMaster(:[master])" | ||
replace_node = "*" | ||
replace = "@r.master(@master)" | ||
is_seed_rule = false | ||
groups = ["BuilderPattern"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.piranha; | ||
|
||
import org.apache.spark.SparkConf; | ||
import org.apache.spark.sql.SparkSession; | ||
|
||
class Sample { | ||
void main() { | ||
|
||
val conf1 = new SparkSession.builder() | ||
.master(master1) | ||
.appName(appName1) | ||
.executorEnv("spark.executor.extraClassPath1", "test1"); | ||
|
||
val conf2 = new SparkSession.builder() | ||
.appName(appName2) | ||
.master(master2) | ||
.sparkHome(sparkHome2) | ||
.executorEnv("spark.executor.extraClassPath2", "test2"); | ||
|
||
val conf3 = new SparkSession.builder() | ||
.executorEnv("spark.executor.extraClassPath3", "test3") | ||
.appName(appName3) | ||
.master(master3) | ||
.sparkHome(sparkHome3); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.piranha; | ||
|
||
import org.apache.spark.SparkConf; | ||
import org.apache.spark.sql.SparkSession; | ||
|
||
class Sample { | ||
void main() { | ||
|
||
val conf1 = new SparkConf() | ||
.setMaster(master1) | ||
.setAppName(appName1) | ||
.setExecutorEnv("spark.executor.extraClassPath1", "test1"); | ||
|
||
val conf2 = new SparkConf() | ||
.setAppName(appName2) | ||
.setMaster(master2) | ||
.setSparkHome(sparkHome2) | ||
.setExecutorEnv("spark.executor.extraClassPath2", "test2"); | ||
|
||
val conf3 = new SparkConf() | ||
.setExecutorEnv("spark.executor.extraClassPath3", "test3") | ||
.setAppName(appName3) | ||
.setMaster(master3) | ||
.setSparkHome(sparkHome3); | ||
|
||
|
||
} | ||
|
||
} |