Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
6ceb5599
Commit
6ceb5599
authored
12 years ago
by
Patrick Wendell
Browse files
Options
Downloads
Patches
Plain Diff
Adding multi-jar constructor in quickstart
parent
f86960cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/quick-start.md
+2
-2
2 additions, 2 deletions
docs/quick-start.md
with
2 additions
and
2 deletions
docs/quick-start.md
+
2
−
2
View file @
6ceb5599
...
@@ -113,7 +113,7 @@ import SparkContext._
...
@@ -113,7 +113,7 @@ import SparkContext._
object SimpleJob extends Application {
object SimpleJob extends Application {
val logFile = "/var/log/syslog" // Should be some file on your system
val logFile = "/var/log/syslog" // Should be some file on your system
val sc = new SparkContext("local", "Simple Job", "$YOUR_SPARK_HOME",
val sc = new SparkContext("local", "Simple Job", "$YOUR_SPARK_HOME",
"target/scala-{{site.SCALA_VERSION}}/simple-project_{{site.SCALA_VERSION}}-1.0.jar")
List(
"target/scala-{{site.SCALA_VERSION}}/simple-project_{{site.SCALA_VERSION}}-1.0.jar")
)
val logData = sc.textFile(logFile, 2).cache()
val logData = sc.textFile(logFile, 2).cache()
val numAs = logData.filter(line => line.contains("a")).count()
val numAs = logData.filter(line => line.contains("a")).count()
val numBs = logData.filter(line => line.contains("b")).count()
val numBs = logData.filter(line => line.contains("b")).count()
...
@@ -172,7 +172,7 @@ public class SimpleJob {
...
@@ -172,7 +172,7 @@ public class SimpleJob {
public static void main(String[] args) {
public static void main(String[] args) {
String logFile = "/var/log/syslog"; // Should be some file on your system
String logFile = "/var/log/syslog"; // Should be some file on your system
JavaSparkContext sc = new JavaSparkContext("local", "Simple Job",
JavaSparkContext sc = new JavaSparkContext("local", "Simple Job",
"$YOUR_SPARK_HOME", "target/simple-project-1.0.jar");
"$YOUR_SPARK_HOME",
new String[]{
"target/simple-project-1.0.jar"
}
);
JavaRDD
<String>
logData = sc.textFile(logFile).cache();
JavaRDD
<String>
logData = sc.textFile(logFile).cache();
long numAs = logData.filter(new Function<String, Boolean>() {
long numAs = logData.filter(new Function<String, Boolean>() {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment