Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wj-datacenter-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
jinan
wj-datacenter-platform
Commits
6b2fdf0c
Commit
6b2fdf0c
authored
Nov 17, 2023
by
zhoushiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
行人指标
parent
57b86cc7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
PedIndicationProcessFunction.java
...pedestrian/service/func/PedIndicationProcessFunction.java
+2
-2
PedestrianMain.java
...nji/indicators/task/pedestrian/stream/PedestrianMain.java
+10
-10
GeomsConvertUtil.java
...main/java/com/wanji/indicators/util/GeomsConvertUtil.java
+3
-3
No files found.
wj-realtime-computing/src/main/java/com/wanji/indicators/task/pedestrian/service/func/PedIndicationProcessFunction.java
View file @
6b2fdf0c
...
...
@@ -139,8 +139,8 @@ public class PedIndicationProcessFunction extends KeyedProcessFunction<String, C
}
if
(
isCanWalk
)
{
log
.
info
(
"行人绿灯长:rid={},行人绿灯剩余时长={}s,行人绿灯总时长={}s,时间:{},当前灯态:{},上次灯态:{},方向:{}"
,
rid
,
greenRemainTimeState
.
get
(
rid
),
greenTotalTimeState
.
get
(
rid
),
DateUtil
.
toDateTime
(
globalTimeStamp
,
"yyyy-MM-dd HH:mm:ss.SSS"
),
nowLightColor
,
agoLightColor
,
lightDir
);
//
log.info("行人绿灯长:rid={},行人绿灯剩余时长={}s,行人绿灯总时长={}s,时间:{},当前灯态:{},上次灯态:{},方向:{}",
//
rid, greenRemainTimeState.get(rid), greenTotalTimeState.get(rid), DateUtil.toDateTime(globalTimeStamp, "yyyy-MM-dd HH:mm:ss.SSS"),nowLightColor,agoLightColor,lightDir);
if
(
runList
!=
null
&&
!
runList
.
isEmpty
())
{
//按rid分组
...
...
wj-realtime-computing/src/main/java/com/wanji/indicators/task/pedestrian/stream/PedestrianMain.java
View file @
6b2fdf0c
...
...
@@ -48,20 +48,20 @@ public class PedestrianMain {
String
topic
=
properties
.
getProperty
(
"consumer.topic"
);
StreamExecutionEnvironment
env
=
StreamExecutionEnvironment
.
getExecutionEnvironment
();
env
.
setParallelism
(
4
);
env
.
enableCheckpointing
(
10
*
60
*
1000
);
env
.
getCheckpointConfig
().
setTolerableCheckpointFailureNumber
(
3
);
env
.
getCheckpointConfig
().
setCheckpointTimeout
(
10
*
60
*
1000
);
env
.
getCheckpointConfig
().
setMaxConcurrentCheckpoints
(
10
);
env
.
getCheckpointConfig
().
setCheckpointStorage
(
new
FileSystemCheckpointStorage
(
properties
.
getProperty
(
"check.point.uri"
)));
env
.
getCheckpointConfig
().
setExternalizedCheckpointCleanup
(
CheckpointConfig
.
ExternalizedCheckpointCleanup
.
DELETE_ON_CANCELLATION
);
env
.
setParallelism
(
1
);
//
env.enableCheckpointing(10 * 60 * 1000);
//
env.getCheckpointConfig().setTolerableCheckpointFailureNumber(3);
//
env.getCheckpointConfig().setCheckpointTimeout(10 * 60 * 1000);
//
env.getCheckpointConfig().setMaxConcurrentCheckpoints(10);
//
env.getCheckpointConfig().setCheckpointStorage(new FileSystemCheckpointStorage(properties.getProperty("check.point.uri")));
//
env.getCheckpointConfig().setExternalizedCheckpointCleanup(CheckpointConfig.ExternalizedCheckpointCleanup.DELETE_ON_CANCELLATION);
//============================================================================================//
KafkaSource
<
String
>
source
=
KafkaSource
.<
String
>
builder
()
.
setProperties
(
instance
.
getConsumerProperties
())
.
setProperty
(
"auto.offset.commit"
,
"true"
)
.
setProperty
(
"auto.commit.interval.ms"
,
"1000"
)
.
setProperty
(
"commit.offsets.on.checkpoint"
,
"
tru
e"
)
.
setProperty
(
"commit.offsets.on.checkpoint"
,
"
fals
e"
)
.
setBootstrapServers
(
properties
.
getProperty
(
"bootstrap.servers"
))
.
setTopics
(
topic
)
.
setGroupId
(
GROUP_ID
+
UUID
.
randomUUID
().
toString
())
...
...
@@ -75,7 +75,7 @@ public class PedestrianMain {
.
setProperties
(
instance
.
getConsumerProperties
())
.
setProperty
(
"auto.offset.commit"
,
"true"
)
.
setProperty
(
"auto.commit.interval.ms"
,
"1000"
)
.
setProperty
(
"commit.offsets.on.checkpoint"
,
"
tru
e"
)
.
setProperty
(
"commit.offsets.on.checkpoint"
,
"
fals
e"
)
.
setBootstrapServers
(
properties
.
getProperty
(
"bootstrap.servers"
))
.
setTopics
(
"cross_lights_status"
)
.
setGroupId
(
GROUP_ID
+
UUID
.
randomUUID
().
toString
())
...
...
wj-realtime-computing/src/main/java/com/wanji/indicators/util/GeomsConvertUtil.java
View file @
6b2fdf0c
...
...
@@ -510,10 +510,10 @@ public class GeomsConvertUtil {
public
static
boolean
withinGeo
(
String
poing
,
String
geometry
)
{
try
{
WKTReader
reader
=
new
WKTReader
(
geometryFactory
);
Point
point
=
(
Point
)
reader
.
read
(
poing
);
Polygon
polygon
=
(
Polygon
)
reader
.
read
(
geometry
);
Point
point
=
createPoint
(
poing
);
Geometry
polygon
=
genGeometry
(
geometry
);
return
point
.
within
(
polygon
);
}
catch
(
Parse
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
false
;
...
...
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