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
58e5a861
Commit
58e5a861
authored
4 years ago
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get query
parent
7feaa92b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Main.scala
src/main/scala/com.gmei.up/Main.scala
+5
-5
No files found.
src/main/scala/com.gmei.up/Main.scala
View file @
58e5a861
...
@@ -11,14 +11,14 @@ import org.apache.flink.streaming.connectors.kafka.{
...
@@ -11,14 +11,14 @@ import org.apache.flink.streaming.connectors.kafka.{
import
org.apache.flink.api.common.typeinfo.
{
TypeHint
,
TypeInformation
,
Types
}
import
org.apache.flink.api.common.typeinfo.
{
TypeHint
,
TypeInformation
,
Types
}
import
org.apache.kafka.clients.consumer.ConsumerRecord
import
org.apache.kafka.clients.consumer.ConsumerRecord
import
com.alibaba.fastjson.JSON
import
com.alibaba.fastjson.JSON
import
com.gmei.up.utils.
{
UserInfo
}
import
com.gmei.up.utils.
{
UserInfo
,
ES
}
class
UserInfoDeserializationSchema
extends
KafkaDeserializationSchema
[
UserInfo
]
{
class
UserInfoDeserializationSchema
extends
KafkaDeserializationSchema
[
UserInfo
]
{
override
def
isEndOfStream
(
t
:
UserInfo
)
:
Boolean
=
false
override
def
isEndOfStream
(
t
:
UserInfo
)
:
Boolean
=
false
override
def
deserialize
(
consumerRecord
:
ConsumerRecord
[
Array
[
Byte
]
,
Array
[
Byte
]])
:
UserInfo
=
{
override
def
deserialize
(
consumerRecord
:
ConsumerRecord
[
Array
[
Byte
]
,
Array
[
Byte
]])
:
UserInfo
=
{
val
info
=
new
String
(
consumerRecord
.
value
(),
"UTF-8"
)
val
info
=
new
String
(
consumerRecord
.
value
(),
"UTF-8"
)
println
(
info
)
//
println(info)
val
userInfo
:
UserInfo
=
JSON
.
parseObject
(
info
,
classOf
[
UserInfo
])
val
userInfo
:
UserInfo
=
JSON
.
parseObject
(
info
,
classOf
[
UserInfo
])
userInfo
userInfo
}
}
...
@@ -53,9 +53,9 @@ object Main {
...
@@ -53,9 +53,9 @@ object Main {
stream
.
map
{
user
=>
stream
.
map
{
user
=>
println
(
user
.
deviceId
)
println
(
user
.
deviceId
)
// val query = ES.generateDiaryQuery(-1, user.projects, user.secondDemands
)
val
query
=
ES
.
generateDiaryQuery
(-
1
,
user
.
projects
.
toList
,
user
.
secondDemands
.
toList
)
//
println(query)
println
(
query
)
//
ES.test(query)
ES
.
test
(
query
)
println
(
"########################"
)
println
(
"########################"
)
}
}
...
...
This diff is collapsed.
Click to expand it.
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