Commit bdeb0290 authored by she's avatar she

ouid创角 1

增加混合平台模式
parent 623844ee
......@@ -95,13 +95,7 @@ public class AppsflyerAnalyze {
}
return true;
}
}).process(new ProcessFunction<AppsFlyerEvent, AppsFlyerEvent>() {
@Override
public void processElement(AppsFlyerEvent value, ProcessFunction<AppsFlyerEvent, AppsFlyerEvent>.Context ctx, Collector<AppsFlyerEvent> out) throws Exception {
out.collect(value);
// if ()
}
})
}).process(new MutiplatDataProcess())
.uid("parse-event")
.name("parse-event");
......
package com.fshark.overseas.advert.processor;
import com.fshark.overseas.advert.modle.AppsFlyerEvent;
import org.apache.flink.streaming.api.functions.ProcessFunction;
import org.apache.flink.util.Collector;
import java.util.ArrayList;
import java.util.List;
public class MutiplatDataProcess extends ProcessFunction<AppsFlyerEvent, AppsFlyerEvent> {
//需要混合的包名
private String[] packages = {"com.chaosportal.samsung", "com.chaosportal.onestore", "com.chaosportal.shark"};
@Override
public void processElement(AppsFlyerEvent value, ProcessFunction<AppsFlyerEvent, AppsFlyerEvent>.Context ctx, Collector<AppsFlyerEvent> out) throws Exception {
out.collect(value);
for (String aPackage : packages) {
if (aPackage.equals(value.getGame_id())) {
setMutiValue(value);
out.collect(value);
}
}
}
private void setMutiValue(AppsFlyerEvent value) {
value.setGame_id("com.chaosportal.shark.all");
value.setPlatform("android");
}
}
......@@ -60,6 +60,14 @@ public class OuidLoginProcess extends RichFlatMapFunction<AppsFlyerEvent, Activa
if (!account.isPresent()) {
gameAccountDao.insertOuidRegister(value, event_time, ouid);
activationMetrics.setData_ouid_register(1L);
if (EventTypeEnum.createRoleEvent(value)) {
Optional<GameAccount> accountCreateRole = gameAccountDao.findByOuid(value, ouid,Constants.TYPE_CREATEROLE);
if (!accountCreateRole.isPresent()) {
activationMetrics.setData_create_role(1L);
activationMetrics.setData_day_register_create(1L);
gameAccountDao.insertOuidEvent(value,ouid,Constants.TYPE_CREATEROLE);
}
}
} else {
GameAccount gameAccount = account.get();
copyOuidMetrics(gameAccount, activationMetrics);
......
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