Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
streamingUserPortrait
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵威
streamingUserPortrait
Commits
a3eb0138
Commit
a3eb0138
authored
Feb 03, 2021
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update project's name
parent
21c94040
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
17 deletions
+6
-17
build.sbt
build.sbt
+2
-2
Main.scala
src/main/scala/com.gmei.up/Main.scala
+4
-15
No files found.
build.sbt
View file @
a3eb0138
// ThisBuild / scalaVersion := "2.12.13"
// ThisBuild / scalaVersion := "2.12.13"
ThisBuild
/
scalaVersion
:=
"2.11.12"
ThisBuild
/
scalaVersion
:=
"2.11.12"
ThisBuild
/
version
:=
"0.1.0"
ThisBuild
/
version
:=
"0.1.0"
ThisBuild
/
organization
:=
"com.gmei"
ThisBuild
/
organization
:=
"com.gmei
.up
"
val
esVersion
=
"7.10.2"
val
esVersion
=
"7.10.2"
val
es
=
"org.elasticsearch"
%
"elasticsearch"
%
esVersion
val
es
=
"org.elasticsearch"
%
"elasticsearch"
%
esVersion
...
@@ -22,7 +22,7 @@ val flinkHadoop = "org.apache.flink" %% "flink-hadoop-compatibility" % flinkVers
...
@@ -22,7 +22,7 @@ val flinkHadoop = "org.apache.flink" %% "flink-hadoop-compatibility" % flinkVers
lazy
val
root
=
(
project
in
file
(
"."
))
lazy
val
root
=
(
project
in
file
(
"."
))
.
settings
(
.
settings
(
name
:=
"
tryFlink
"
,
name
:=
"
streamingUserPortrait
"
,
// libraryDependencies += "com.alibaba" % "fastjson" % "1.2.75",
// libraryDependencies += "com.alibaba" % "fastjson" % "1.2.75",
libraryDependencies
+=
es
,
libraryDependencies
+=
es
,
...
...
src/main/scala/com.gmei/Main.scala
→
src/main/scala/com.gmei
.up
/Main.scala
View file @
a3eb0138
package
com.gmei
package
com.gmei
.up
// import org.apache.flink.api.scala._
import
org.apache.flink.streaming.api.scala._
import
org.apache.flink.streaming.api.scala._
object
Main
{
object
Main
{
...
@@ -8,20 +7,10 @@ object Main {
...
@@ -8,20 +7,10 @@ object Main {
println
(
"hello"
)
println
(
"hello"
)
val
env
=
StreamExecutionEnvironment
.
getExecutionEnvironment
val
env
=
StreamExecutionEnvironment
.
getExecutionEnvironment
val
socketStream
=
env
.
socketTextStream
(
"localhost"
,
9000
)
val
a
=
env
.
fromElements
(
1
,
2
,
-
3
,
0
,
5
,
-
9
,
8
)
val
b
=
a
.
map
(
_
+
1
)
// val a = env.fromElements(1, 2, -3, 0, 5, -9, 8)
b
.
print
()
// val b = a.map(_ + 1)
// b.print()
val
wordsStream
=
socketStream
.
flatMap
(
value
=>
value
.
split
(
"\\s+"
)).
map
(
value
=>
(
value
,
1
))
val
keyValuePair
=
wordsStream
.
keyBy
(
0
)
val
countPair
=
keyValuePair
.
sum
(
1
)
countPair
.
print
env
.
execute
env
.
execute
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment