Commit b6ecda11 authored by 赵建伟's avatar 赵建伟

update codes

parent 54065e39
......@@ -172,9 +172,11 @@ public class PortraitMonitorShdOperator implements BaseOperator{
++count;
}
}
String currentTimeStr = DateUtils.getCurrentTimeStr(date);
TblMonitorPortraitShd tblMonitorPortraitShd = new TblMonitorPortraitShd(key.getField(0), count, currentTimeStr);
out.collect(tblMonitorPortraitShd);
if(count > 0){
String currentTimeStr = DateUtils.getCurrentTimeStr(date);
TblMonitorPortraitShd tblMonitorPortraitShd = new TblMonitorPortraitShd(key.getField(0), count, currentTimeStr);
out.collect(tblMonitorPortraitShd);
}
}
});
process.print();
......
......@@ -83,14 +83,16 @@ public class PortraitMonitorSucOperator implements BaseOperator{
long currentTimestamp = DateUtils.getCurrentTimestamp(date);
long tenMinitesAgoTimestamp = DateUtils.getTenMinitesAgoTimestamp(date);
for (GmPortraitResult element : elements) {
long logTime = Long.valueOf(element.getLog_time());
long logTime = Long.valueOf(Math.round(Double.valueOf(element.getLog_time())));
if(logTime >= tenMinitesAgoTimestamp && logTime <= currentTimestamp){
++ count;
}
}
String currentTimeStr = DateUtils.getCurrentTimeStr(date);
TblMonitorPortraitSuc tblMonitorPortraitSuc = new TblMonitorPortraitSuc(key.getField(0), count, currentTimeStr);
out.collect(tblMonitorPortraitSuc);
if(count > 0){
String currentTimeStr = DateUtils.getCurrentTimeStr(date);
TblMonitorPortraitSuc tblMonitorPortraitSuc = new TblMonitorPortraitSuc(key.getField(0), count, currentTimeStr);
out.collect(tblMonitorPortraitSuc);
}
}
})
.addSink(new PortraitSucMysqlSink(outJdbcUrl,maxRetry,retryInteral))
......
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