Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mobvista-dmp
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
王金锋
mobvista-dmp
Commits
5a91cf65
Commit
5a91cf65
authored
Aug 03, 2021
by
WangJinfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix RTDmpFetch bug
parent
45302635
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
RTDmpFetch.java
src/main/java/mobvista/dmp/datasource/rtdmp/RTDmpFetch.java
+16
-1
No files found.
src/main/java/mobvista/dmp/datasource/rtdmp/RTDmpFetch.java
View file @
5a91cf65
...
@@ -3,6 +3,7 @@ package mobvista.dmp.datasource.rtdmp;
...
@@ -3,6 +3,7 @@ package mobvista.dmp.datasource.rtdmp;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.util.concurrent.ThreadFactoryBuilder
;
import
mobvista.dmp.common.Constants
;
import
mobvista.dmp.common.Constants
;
import
mobvista.dmp.datasource.rtdmp.entity.Tuple
;
import
mobvista.dmp.datasource.rtdmp.entity.Tuple
;
import
mobvista.dmp.util.*
;
import
mobvista.dmp.util.*
;
...
@@ -30,6 +31,7 @@ import java.sql.ResultSet;
...
@@ -30,6 +31,7 @@ import java.sql.ResultSet;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.*
;
/**
/**
* @package: mobvista.dmp.datasource.rtdmp
* @package: mobvista.dmp.datasource.rtdmp
...
@@ -80,10 +82,23 @@ public class RTDmpFetch {
...
@@ -80,10 +82,23 @@ public class RTDmpFetch {
String
part
=
DateUtil
.
format
(
DateUtil
.
parse
(
update_time_end
,
"yyyy-MM-dd HH:mm:ss"
),
"yyyyMMddHH"
);
String
part
=
DateUtil
.
format
(
DateUtil
.
parse
(
update_time_end
,
"yyyy-MM-dd HH:mm:ss"
),
"yyyyMMddHH"
);
JSONArray
jsonArray
=
ruleAudienceInfo
(
update_time_start
,
update_time_end
);
JSONArray
jsonArray
=
ruleAudienceInfo
(
update_time_start
,
update_time_end
);
jsonArray
.
sort
(
Comparator
.
comparing
(
obj
->
((
JSONObject
)
obj
).
getIntValue
(
"id"
)));
jsonArray
.
sort
(
Comparator
.
comparing
(
obj
->
((
JSONObject
)
obj
).
getIntValue
(
"id"
)));
ThreadFactory
threadFactory
=
new
ThreadFactoryBuilder
()
.
setNameFormat
(
"RTDmpFetch-%d"
).
build
();
ExecutorService
pool
=
new
ThreadPoolExecutor
(
5
,
10
,
120L
,
TimeUnit
.
MILLISECONDS
,
new
LinkedBlockingQueue
<>(
64
),
threadFactory
,
new
ThreadPoolExecutor
.
AbortPolicy
());
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
audienceObject
=
jsonArray
.
getJSONObject
(
i
);
int
finalI
=
i
;
pool
.
execute
(()
->
{
JSONObject
audienceObject
=
jsonArray
.
getJSONObject
(
finalI
);
doFetch
(
audienceObject
,
part
);
doFetch
(
audienceObject
,
part
);
});
}
}
pool
.
shutdown
();
}
}
private
static
void
doFetch
(
JSONObject
audienceObject
,
String
part
)
{
private
static
void
doFetch
(
JSONObject
audienceObject
,
String
part
)
{
...
...
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