Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
ZHHT-IRN-BD-ANALYSIS
Project
Overview
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
李凯旋
ZHHT-IRN-BD-ANALYSIS
Commits
7c006f0b
Commit
7c006f0b
authored
Nov 03, 2022
by
余根龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改travel实体类引用路径
parent
fe9b9b52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
TravelInfoJob.java
...reaming/src/main/java/com/zhht/irn/job/TravelInfoJob.java
+9
-9
No files found.
realtime/hologram-streaming/src/main/java/com/zhht/irn/job/TravelInfoJob.java
View file @
7c006f0b
package
com
.
zhht
.
irn
.
job
;
package
com
.
zhht
.
irn
.
job
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.zhht.irn.entity.
kafka.
Location
;
import
com.zhht.irn.entity.Location
;
import
com.zhht.irn.entity.
kafka.TravelInfo
;
import
com.zhht.irn.entity.
Travel
;
import
com.zhht.irn.entity.mysql.TripsMetric
;
import
com.zhht.irn.entity.mysql.TripsMetric
;
import
com.zhht.irn.sink.TripsMetricSink
;
import
com.zhht.irn.sink.TripsMetricSink
;
import
org.apache.flink.api.common.functions.FilterFunction
;
import
org.apache.flink.api.common.functions.FilterFunction
;
...
@@ -77,23 +77,23 @@ public class TravelInfoJob {
...
@@ -77,23 +77,23 @@ public class TravelInfoJob {
DataStream
<
String
>
rawStringStream
=
env
.
addSource
(
kafkaConsumer
);
DataStream
<
String
>
rawStringStream
=
env
.
addSource
(
kafkaConsumer
);
// 开始计算旅行信息相关指标
// 开始计算旅行信息相关指标
rawStringStream
.
map
(
new
MapFunction
<
String
,
Travel
Info
>()
{
rawStringStream
.
map
(
new
MapFunction
<
String
,
Travel
>()
{
@Override
@Override
public
Travel
Info
map
(
String
s
)
throws
Exception
{
public
Travel
map
(
String
s
)
throws
Exception
{
// json 格式字符串转化为 TravelInfo 实体类
// json 格式字符串转化为 TravelInfo 实体类
Travel
Info
travelInfo
=
JSON
.
parseObject
(
s
,
TravelInfo
.
class
);
Travel
travelInfo
=
JSON
.
parseObject
(
s
,
Travel
.
class
);
return
null
;
return
null
;
}
}
}).
filter
(
new
FilterFunction
<
Travel
Info
>()
{
}).
filter
(
new
FilterFunction
<
Travel
>()
{
@Override
@Override
public
boolean
filter
(
Travel
Info
travelInfo
)
throws
Exception
{
public
boolean
filter
(
Travel
travelInfo
)
throws
Exception
{
// 过滤掉垃圾数据
// 过滤掉垃圾数据
return
true
;
return
true
;
}
}
}).
map
(
new
MapFunction
<
Travel
Info
,
TripsMetric
>()
{
}).
map
(
new
MapFunction
<
Travel
,
TripsMetric
>()
{
@Override
@Override
public
TripsMetric
map
(
Travel
Info
travelInfo
)
throws
Exception
{
public
TripsMetric
map
(
Travel
travelInfo
)
throws
Exception
{
TripsMetric
tripsMetric
=
new
TripsMetric
();
TripsMetric
tripsMetric
=
new
TripsMetric
();
// 计算各类指标, 塞入tripsMetric @todo
// 计算各类指标, 塞入tripsMetric @todo
List
<
Location
>
locations
=
travelInfo
.
getLocations
();
List
<
Location
>
locations
=
travelInfo
.
getLocations
();
...
...
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