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
02b049bc
Commit
02b049bc
authored
Feb 07, 2021
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comment logger
parent
a87ca6a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
build.sbt
build.sbt
+2
-2
Main.scala
src/main/scala/com.gmei.up/Main.scala
+8
-4
No files found.
build.sbt
View file @
02b049bc
...
@@ -27,8 +27,8 @@ lazy val root = (project in file("."))
...
@@ -27,8 +27,8 @@ lazy val root = (project in file("."))
.
settings
(
.
settings
(
name
:=
"streamingUserPortrait"
,
name
:=
"streamingUserPortrait"
,
libraryDependencies
+=
"ch.qos.logback"
%
"logback-classic"
%
"1.2.3"
,
//
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3",
libraryDependencies
+=
"com.typesafe.scala-logging"
%%
"scala-logging"
%
"3.9.2"
,
//
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.9.2",
libraryDependencies
+=
"com.alibaba"
%
"fastjson"
%
"1.2.75"
,
libraryDependencies
+=
"com.alibaba"
%
"fastjson"
%
"1.2.75"
,
libraryDependencies
+=
jsonNative
,
libraryDependencies
+=
jsonNative
,
...
...
src/main/scala/com.gmei.up/Main.scala
View file @
02b049bc
...
@@ -34,7 +34,8 @@ object Main extends LazyLogging {
...
@@ -34,7 +34,8 @@ object Main extends LazyLogging {
// val query = ES.generateServiceDiaryRequest(List("光子嫩肤", "水光针"), List("丰胸", "胸部塑身"), -1)
// val query = ES.generateServiceDiaryRequest(List("光子嫩肤", "水光针"), List("丰胸", "胸部塑身"), -1)
// println("###############")
// println("###############")
try
{
try
{
logger
.
info
(
"UserPortrait Flink Started"
)
// TODO logger
// logger.info("UserPortrait Flink Started")
val
env
=
StreamExecutionEnvironment
.
getExecutionEnvironment
val
env
=
StreamExecutionEnvironment
.
getExecutionEnvironment
// TODO read from config
// TODO read from config
...
@@ -108,7 +109,8 @@ object Main extends LazyLogging {
...
@@ -108,7 +109,8 @@ object Main extends LazyLogging {
Redis
.
save
(
ES
.
request
(
serviceDiaryReq
),
deviceId
,
"service_diary"
,
streamTimeBegin
)
Redis
.
save
(
ES
.
request
(
serviceDiaryReq
),
deviceId
,
"service_diary"
,
streamTimeBegin
)
// current time
// current time
logger
.
info
(
s
"${user.eventCn} ${deviceId}"
)
// TODO logger
// logger.info(s"${user.eventCn} ${deviceId}")
val
cost
=
streamTimeBegin
-
user
.
sendTimestamp
val
cost
=
streamTimeBegin
-
user
.
sendTimestamp
if
(
cost
>
1000
)
{
if
(
cost
>
1000
)
{
...
@@ -136,7 +138,8 @@ object Main extends LazyLogging {
...
@@ -136,7 +138,8 @@ object Main extends LazyLogging {
Map
(
"Main.main"
->
"stream.map"
,
"error"
->
e
.
getStackTrace
.
mkString
(
"\n"
)),
Map
(
"Main.main"
->
"stream.map"
,
"error"
->
e
.
getStackTrace
.
mkString
(
"\n"
)),
contentType
=
"exception"
contentType
=
"exception"
)
)
logger
.
error
(
e
.
getStackTrace
.
mkString
(
"\n"
))
// TODO logger
// logger.error(e.getStackTrace.mkString("\n"))
e
.
printStackTrace
()
e
.
printStackTrace
()
""
""
}
}
...
@@ -151,7 +154,8 @@ object Main extends LazyLogging {
...
@@ -151,7 +154,8 @@ object Main extends LazyLogging {
Map
(
"method"
->
"main"
,
"error"
->
e
.
getStackTrace
.
mkString
(
"\n"
)),
Map
(
"method"
->
"main"
,
"error"
->
e
.
getStackTrace
.
mkString
(
"\n"
)),
contentType
=
"exception"
contentType
=
"exception"
)
)
logger
.
error
(
e
.
getStackTrace
.
mkString
(
"\n"
))
// TODO logger
// logger.error(e.getStackTrace.mkString("\n"))
e
.
printStackTrace
()
e
.
printStackTrace
()
}
}
}
}
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