Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
ctr-estimate
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
赵建伟
ctr-estimate
Commits
bbebdd34
Commit
bbebdd34
authored
Apr 04, 2020
by
赵建伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update codes
parent
397a87f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
12 deletions
+20
-12
start_tag.sh
bin/start_tag.sh
+1
-1
CtrEstimateTagEtl.java
src/main/java/com/gmei/data/ctr/bean/CtrEstimateTagEtl.java
+4
-4
CtrEstimateTagOperator.java
...va/com/gmei/data/ctr/operator/CtrEstimateTagOperator.java
+10
-2
TidbMysqlAsyncSource.java
...n/java/com/gmei/data/ctr/source/TidbMysqlAsyncSource.java
+5
-5
No files found.
bin/start_tag.sh
View file @
bbebdd34
...
...
@@ -27,7 +27,7 @@ $JAR_DIR/ctr-estimate-1.0-SNAPSHOT.jar \
--retryInteral
3000
\
--checkpointPath
'hdfs://bj-gmei-hdfs/user/data/flink/ctr-estimate-tag/checkpoint'
\
--parallelism
6
\
--startTime
'2020-04-04 1
1:56
:00'
\
--startTime
'2020-04-04 1
2:23
:00'
\
>>
/data/log/ctr-estimate/ctr-estimate-tag.out 2>&1 &
tail
-f
/data/log/ctr-estimate/ctr-estimate-tag.out
...
...
src/main/java/com/gmei/data/ctr/bean/CtrEstimateTagEtl.java
View file @
bbebdd34
...
...
@@ -11,13 +11,13 @@ public class CtrEstimateTagEtl {
private
String
estimateType
;
private
Integer
count
;
private
String
cardContentType
;
private
Stri
ng
cardId
;
private
Lo
ng
cardId
;
private
String
partitionDate
;
private
String
lastUpdateTime
;
private
String
type
;
private
String
keyWord
;
public
CtrEstimateTagEtl
(
String
deviceId
,
String
cardContentType
,
Stri
ng
cardId
,
String
estimateType
,
Integer
count
,
String
partitionDate
,
String
lastUpdateTime
,
String
type
,
String
keyWord
)
{
public
CtrEstimateTagEtl
(
String
deviceId
,
String
cardContentType
,
Lo
ng
cardId
,
String
estimateType
,
Integer
count
,
String
partitionDate
,
String
lastUpdateTime
,
String
type
,
String
keyWord
)
{
this
.
deviceId
=
deviceId
;
this
.
cardContentType
=
cardContentType
;
this
.
cardId
=
cardId
;
...
...
@@ -48,11 +48,11 @@ public class CtrEstimateTagEtl {
this
.
cardContentType
=
cardContentType
;
}
public
Stri
ng
getCardId
()
{
public
Lo
ng
getCardId
()
{
return
cardId
;
}
public
void
setCardId
(
Stri
ng
cardId
)
{
public
void
setCardId
(
Lo
ng
cardId
)
{
this
.
cardId
=
cardId
;
}
...
...
src/main/java/com/gmei/data/ctr/operator/CtrEstimateTagOperator.java
View file @
bbebdd34
...
...
@@ -82,7 +82,14 @@ public class CtrEstimateTagOperator implements BaseOperator{
}
if
(
StringUtils
.
isNotBlank
(
clId
))
{
String
cardContentType
=
paramsObject
.
getString
(
"card_content_type"
);
String
cardId
=
paramsObject
.
getString
(
"card_id"
);
String
cardIdStr
=
paramsObject
.
getString
(
"card_id"
);
Long
cardId
=
0L
;
try
{
cardId
=
Long
.
valueOf
(
cardIdStr
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
false
;
}
if
(
null
!=
cardContentType
&&
null
!=
cardId
)
{
if
(
"service"
.
equals
(
cardContentType
)
||
"diary"
.
equals
(
cardContentType
)
||
"tractate"
.
equals
(
cardContentType
)
||
"answer"
.
equals
(
cardContentType
))
{
...
...
@@ -121,7 +128,8 @@ public class CtrEstimateTagOperator implements BaseOperator{
}
if
(
StringUtils
.
isNotBlank
(
clId
))
{
String
cardContentType
=
paramsObject
.
getString
(
"card_content_type"
);
String
cardId
=
paramsObject
.
getString
(
"card_id"
);
String
cardIdStr
=
paramsObject
.
getString
(
"card_id"
);
Long
cardId
=
Long
.
valueOf
(
cardIdStr
);
ctrEstimateTagEtl
.
setDeviceId
(
deviceId
);
if
(
null
!=
cardContentType
&&
null
!=
cardId
)
{
ctrEstimateTagEtl
.
setCardId
(
cardId
);
...
...
src/main/java/com/gmei/data/ctr/source/TidbMysqlAsyncSource.java
View file @
bbebdd34
...
...
@@ -70,21 +70,21 @@ public class TidbMysqlAsyncSource extends RichAsyncFunction<CtrEstimateTagEtl, D
if
(
"commodity"
.
equals
(
type
)
||
"content"
.
equals
(
type
)){
String
sql
=
null
;
String
cardContentType
=
ctrEstimateTagEtl
.
getCardContentType
();
Stri
ng
cardId
=
ctrEstimateTagEtl
.
getCardId
();
Lo
ng
cardId
=
ctrEstimateTagEtl
.
getCardId
();
if
(
"commodity"
.
equals
(
type
)
&&
"service"
.
equals
(
cardContentType
)){
sql
=
String
.
format
(
"select first_demands,first_positions,first_solutions,second_demands,second_positions,second_solutions,project_tags "
+
"from strategy_service_tagv3_info where service_id = '%
s
'"
,
cardId
);
"from strategy_service_tagv3_info where service_id = '%
d
'"
,
cardId
);
}
if
(
"content"
.
equals
(
type
)){
if
(
"diary"
.
equals
(
cardContentType
)){
sql
=
String
.
format
(
"select first_demands,first_positions,first_solutions,second_demands,second_positions,second_solutions,project_tags "
+
"from strategy_content_tagv3_info where content_id = '%
s
'"
,
cardId
);
"from strategy_content_tagv3_info where content_id = '%
d
'"
,
cardId
);
}
else
if
(
"tractate"
.
equals
(
cardContentType
)){
sql
=
String
.
format
(
"select first_demands,first_positions,first_solutions,second_demands,second_positions,second_solutions,project_tags "
+
"from strategy_tractate_tagv3_info where content_id = '%
s
'"
,
cardId
);
"from strategy_tractate_tagv3_info where content_id = '%
d
'"
,
cardId
);
}
else
if
(
"answer"
.
equals
(
cardContentType
)){
sql
=
String
.
format
(
"select first_demands,first_positions,first_solutions,second_demands,second_positions,second_solutions,project_tags "
+
"from strategy_answer_tagv3_info where content_id = '%
s
'"
,
cardId
);
"from strategy_answer_tagv3_info where content_id = '%
d
'"
,
cardId
);
}
}
if
(
StringUtils
.
isNotBlank
(
sql
)){
...
...
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