Commit 3ed21345 authored by 赵建伟's avatar 赵建伟

update codes

parent f18f645a
...@@ -7,7 +7,7 @@ export JAVA_OPTS="-Xms1024m -Xmx8192m -XX:-UseGCOverheadLimit -XX:+UseConcMarkSw ...@@ -7,7 +7,7 @@ export JAVA_OPTS="-Xms1024m -Xmx8192m -XX:-UseGCOverheadLimit -XX:+UseConcMarkSw
$FLINK_HOME/bin/flink run \ $FLINK_HOME/bin/flink run \
-m yarn-cluster \ -m yarn-cluster \
-ynm portrait_monitor \ -ynm portrait-monitor \
-yqu flink \ -yqu flink \
-yn 2 \ -yn 2 \
-ys 2 \ -ys 2 \
......
...@@ -15,9 +15,10 @@ public class GmPortraitResult { ...@@ -15,9 +15,10 @@ public class GmPortraitResult {
* event_cn : 搜索操作/点击卡片/kyc/ai测脸 等 * event_cn : 搜索操作/点击卡片/kyc/ai测脸 等
*/ */
private String device_id; private String device_id;
private String log_time;
private String event_cn;
private String action; private String action;
private String log_time;
private String event;
private Boolean new_portrait;
public String getDevice_id() { public String getDevice_id() {
return device_id; return device_id;
...@@ -35,14 +36,6 @@ public class GmPortraitResult { ...@@ -35,14 +36,6 @@ public class GmPortraitResult {
this.log_time = log_time; this.log_time = log_time;
} }
public String getEvent_cn() {
return event_cn;
}
public void setEvent_cn(String event_cn) {
this.event_cn = event_cn;
}
public String getAction() { public String getAction() {
return action; return action;
} }
...@@ -50,4 +43,20 @@ public class GmPortraitResult { ...@@ -50,4 +43,20 @@ public class GmPortraitResult {
public void setAction(String action) { public void setAction(String action) {
this.action = action; this.action = action;
} }
public String getEvent() {
return event;
}
public void setEvent(String event) {
this.event = event;
}
public Boolean getNew_portrait() {
return new_portrait;
}
public void setNew_portrait(Boolean new_portrait) {
this.new_portrait = new_portrait;
}
} }
...@@ -64,13 +64,14 @@ public class PortraitMonitorSucOperator implements BaseOperator{ ...@@ -64,13 +64,14 @@ public class PortraitMonitorSucOperator implements BaseOperator{
.filter(new FilterFunction<GmPortraitResult>() { .filter(new FilterFunction<GmPortraitResult>() {
@Override @Override
public boolean filter(GmPortraitResult value) throws Exception { public boolean filter(GmPortraitResult value) throws Exception {
if(null == value.getAction() || null == value.getDevice_id() || null == value.getLog_time()){ if(null == value.getAction() || null == value.getDevice_id()
|| null == value.getLog_time() || null == value.getEvent()){
return false; return false;
} }
return true; return true;
} }
}) })
.keyBy("action") .keyBy("event")
.timeWindow(Time.seconds(windownSize),Time.seconds(slideSize)) .timeWindow(Time.seconds(windownSize),Time.seconds(slideSize))
.process(new ProcessWindowFunction<GmPortraitResult, TblMonitorPortraitSuc, Tuple, TimeWindow>() { .process(new ProcessWindowFunction<GmPortraitResult, TblMonitorPortraitSuc, Tuple, TimeWindow>() {
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment