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
f0c963b1
Commit
f0c963b1
authored
Oct 19, 2021
by
WangJinfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update lazada_rtdmp,fix RTDmpFetch
parent
bcad12be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
RTDmpFetch.java
src/main/java/mobvista/dmp/datasource/rtdmp/RTDmpFetch.java
+4
-4
MySQLUtil.java
src/main/java/mobvista/dmp/util/MySQLUtil.java
+4
-3
No files found.
src/main/java/mobvista/dmp/datasource/rtdmp/RTDmpFetch.java
View file @
f0c963b1
...
@@ -161,7 +161,7 @@ public class RTDmpFetch {
...
@@ -161,7 +161,7 @@ public class RTDmpFetch {
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
LOGGER
.
info
(
e
.
getMessage
());
LOGGER
.
info
(
e
.
getMessage
());
}
}
kv
=
mySqlUtil
.
getPartitionTime
(
"dwh"
,
"
audience_merge_v1"
);
kv
=
mySqlUtil
.
getPartitionTime
(
"dwh"
,
"audience_merge_v1"
);
dt
=
DateUtil
.
format
(
DateUtil
.
parse
(
kv
.
getK
().
substring
(
0
,
8
),
"yyyyMMdd"
),
"yyyy-MM-dd"
);
dt
=
DateUtil
.
format
(
DateUtil
.
parse
(
kv
.
getK
().
substring
(
0
,
8
),
"yyyyMMdd"
),
"yyyy-MM-dd"
);
hour
=
kv
.
getK
().
substring
(
8
,
10
);
hour
=
kv
.
getK
().
substring
(
8
,
10
);
utime
=
kv
.
getV
();
utime
=
kv
.
getV
();
...
@@ -192,7 +192,7 @@ public class RTDmpFetch {
...
@@ -192,7 +192,7 @@ public class RTDmpFetch {
String
sql
=
buildSql
(
dt
,
hour
,
jsonObject
)
String
sql
=
buildSql
(
dt
,
hour
,
jsonObject
)
.
replace
(
"@key"
,
"device_type"
)
.
replace
(
"@key"
,
"device_type"
)
.
replace
(
"@table"
,
"
audience_merge_v1_all"
)
+
" GROUP BY device_type"
;
.
replace
(
"@table"
,
"audience_merge_v1_all"
)
+
" GROUP BY device_type"
;
LOGGER
.
info
(
"checkDeviceType -->> audienceId:"
+
audienceId
+
", sql -->>"
+
sql
);
LOGGER
.
info
(
"checkDeviceType -->> audienceId:"
+
audienceId
+
", sql -->>"
+
sql
);
ClickHouseDataSource
dataSource0
=
new
ClickHouseDataSource
(
URL
.
replace
(
"host"
,
ips0
[
random0
]),
properties
);
ClickHouseDataSource
dataSource0
=
new
ClickHouseDataSource
(
URL
.
replace
(
"host"
,
ips0
[
random0
]),
properties
);
...
@@ -219,7 +219,7 @@ public class RTDmpFetch {
...
@@ -219,7 +219,7 @@ public class RTDmpFetch {
sql
=
buildSql
(
dt
,
hour
,
jsonObject
)
sql
=
buildSql
(
dt
,
hour
,
jsonObject
)
.
replace
(
"@key"
,
"COUNT(1) counts"
)
.
replace
(
"@key"
,
"COUNT(1) counts"
)
.
replace
(
"@table"
,
"
audience_merge_v1_all"
);
.
replace
(
"@table"
,
"audience_merge_v1_all"
);
int
counts
=
0
;
int
counts
=
0
;
try
{
try
{
connection0
=
dataSource0
.
getConnection
();
connection0
=
dataSource0
.
getConnection
();
...
@@ -242,7 +242,7 @@ public class RTDmpFetch {
...
@@ -242,7 +242,7 @@ public class RTDmpFetch {
for
(
String
devType
:
devTypeSet
)
{
for
(
String
devType
:
devTypeSet
)
{
sql
=
buildSql
(
dt
,
hour
,
jsonObject
)
sql
=
buildSql
(
dt
,
hour
,
jsonObject
)
.
replace
(
"@key"
,
"devid"
)
.
replace
(
"@key"
,
"devid"
)
.
replace
(
"@table"
,
"
audience_merge_v1"
)
+
" AND device_type = '"
+
devType
+
"'"
;
.
replace
(
"@table"
,
"audience_merge_v1"
)
+
" AND device_type = '"
+
devType
+
"'"
;
LOGGER
.
info
(
"checkDeviceId -->> audienceId:"
+
audienceId
+
",sql -->> "
+
sql
);
LOGGER
.
info
(
"checkDeviceId -->> audienceId:"
+
audienceId
+
",sql -->> "
+
sql
);
for
(
int
i
=
0
;
i
<
SET_VALUES
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
SET_VALUES
.
length
;
i
++)
{
...
...
src/main/java/mobvista/dmp/util/MySQLUtil.java
View file @
f0c963b1
...
@@ -143,13 +143,13 @@ public class MySQLUtil {
...
@@ -143,13 +143,13 @@ public class MySQLUtil {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
KV
kv
=
getPartitionTime
(
"dwh"
,
"
audience_merge_v1"
);
KV
kv
=
getPartitionTime
(
"dwh"
,
"audience_merge_v1"
);
long
nowTime
=
DateUtil
.
parse
(
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
),
"yyyy-MM-dd HH:mm:ss"
).
getTime
()
/
1000
;
long
nowTime
=
DateUtil
.
parse
(
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
),
"yyyy-MM-dd HH:mm:ss"
).
getTime
()
/
1000
;
System
.
out
.
println
(
kv
.
getV
());
System
.
out
.
println
(
kv
.
getV
());
System
.
out
.
println
(
Long
.
parseLong
(
kv
.
getV
())
>
nowTime
-
1200
);
System
.
out
.
println
(
Long
.
parseLong
(
kv
.
getV
())
>
nowTime
-
1200
);
// System.out.println(getLastPartition("dwh", "
audience_merge_v1"));
// System.out.println(getLastPartition("dwh", "audience_merge_v1"));
// System.out.println(update("dwh", "
audience_merge_v1", "2021072913"));
// System.out.println(update("dwh", "audience_merge_v1", "2021072913"));
}
}
}
}
\ No newline at end of file
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