|
@@ -66,7 +66,7 @@ public class PitcherAgentCDC {
|
|
props.load(PitcherAgentCDC.class.getResourceAsStream(Env.isTest ? "/application.test.properties" : "/application.properties"));
|
|
props.load(PitcherAgentCDC.class.getResourceAsStream(Env.isTest ? "/application.test.properties" : "/application.properties"));
|
|
|
|
|
|
// 设置默认并行度
|
|
// 设置默认并行度
|
|
- env.setParallelism(1);
|
|
|
|
|
|
+ env.setParallelism(16);
|
|
|
|
|
|
// 任务失败后的重启策略
|
|
// 任务失败后的重启策略
|
|
// env.setRestartStrategy(RestartStrategies.noRestart());// 失败不重启
|
|
// env.setRestartStrategy(RestartStrategies.noRestart());// 失败不重启
|
|
@@ -176,16 +176,13 @@ public class PitcherAgentCDC {
|
|
|
|
|
|
private void pitcherAgentToMpConfigAgent(Envelope.Operation operation, Map<String, Object> data, Collector<Tuple3<String, String, TransportMap>> out) {
|
|
private void pitcherAgentToMpConfigAgent(Envelope.Operation operation, Map<String, Object> data, Collector<Tuple3<String, String, TransportMap>> out) {
|
|
Long accountId = ObjectUtil.objToLong(data.get("account_id"));
|
|
Long accountId = ObjectUtil.objToLong(data.get("account_id"));
|
|
- String sourceSystem = ObjectUtil.objToString(data.get("sourceSystem"));
|
|
|
|
- if (sourceSystem.contains("ZX")) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (accountId == null) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ String sourceSystem = ObjectUtil.objToString(data.get("source_system"));
|
|
String accountType = ObjectUtil.objToString(data.get("account_type"));
|
|
String accountType = ObjectUtil.objToString(data.get("account_type"));
|
|
Long pitcherId = ObjectUtil.objToLong(data.get("pitcher_id"));
|
|
Long pitcherId = ObjectUtil.objToLong(data.get("pitcher_id"));
|
|
Long gameId = ObjectUtil.objToLong(data.get("game_id"));
|
|
Long gameId = ObjectUtil.objToLong(data.get("game_id"));
|
|
|
|
+ if (sourceSystem.contains("ZX") || accountId == null || gameId == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>(16);
|
|
Map<String, Object> result = new HashMap<>(16);
|
|
result.put("advertiser_conf_id", accountId);
|
|
result.put("advertiser_conf_id", accountId);
|
|
@@ -204,20 +201,19 @@ public class PitcherAgentCDC {
|
|
queryParam.put("source_system", sourceSystem);
|
|
queryParam.put("source_system", sourceSystem);
|
|
queryParam.put("zx_pitcher_id", pitcherId);
|
|
queryParam.put("zx_pitcher_id", pitcherId);
|
|
Map<String, Object> putUserMap = mapper.queryOne("t_pitcher_map", queryParam);
|
|
Map<String, Object> putUserMap = mapper.queryOne("t_pitcher_map", queryParam);
|
|
|
|
+ queryParam.clear();
|
|
if (putUserMap != null) {
|
|
if (putUserMap != null) {
|
|
result.put("bugu_put_user_id", putUserMap.get("bugu_pitcher_id"));
|
|
result.put("bugu_put_user_id", putUserMap.get("bugu_pitcher_id"));
|
|
result.put("bugu_put_user_name", putUserMap.get("bugu_pitcher_name"));
|
|
result.put("bugu_put_user_name", putUserMap.get("bugu_pitcher_name"));
|
|
result.put("sys_put_user_name", putUserMap.get("zx_pitcher_name"));
|
|
result.put("sys_put_user_name", putUserMap.get("zx_pitcher_name"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (gameId != null) {
|
|
|
|
- queryParam.put("source_system", sourceSystem);
|
|
|
|
- queryParam.put("id", gameId);
|
|
|
|
- queryParam.clear();
|
|
|
|
- Map<String, Object> gameInfo = mapper.queryOne("t_game", queryParam);
|
|
|
|
- if (gameInfo != null) {
|
|
|
|
- result.put("app_name", gameInfo.get("game_name"));
|
|
|
|
- }
|
|
|
|
|
|
+ queryParam.put("source_system", sourceSystem);
|
|
|
|
+ queryParam.put("id", gameId);
|
|
|
|
+ Map<String, Object> gameInfo = mapper.queryOne("t_game", queryParam);
|
|
|
|
+ queryParam.clear();
|
|
|
|
+ if (gameInfo != null) {
|
|
|
|
+ result.put("app_name", gameInfo.get("game_name"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -231,16 +227,13 @@ public class PitcherAgentCDC {
|
|
|
|
|
|
private void pitcherAgentToAdAccount(Envelope.Operation operation, Map<String, Object> data, Collector<Tuple3<String, String, TransportMap>> out) {
|
|
private void pitcherAgentToAdAccount(Envelope.Operation operation, Map<String, Object> data, Collector<Tuple3<String, String, TransportMap>> out) {
|
|
Long accountId = ObjectUtil.objToLong(data.get("account_id"));
|
|
Long accountId = ObjectUtil.objToLong(data.get("account_id"));
|
|
- String sourceSystem = ObjectUtil.objToString(data.get("sourceSystem"));
|
|
|
|
- if (sourceSystem.contains("ZX")) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (accountId == null) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ String sourceSystem = ObjectUtil.objToString(data.get("source_system"));
|
|
String accountType = ObjectUtil.objToString(data.get("account_type"));
|
|
String accountType = ObjectUtil.objToString(data.get("account_type"));
|
|
Long pitcherId = ObjectUtil.objToLong(data.get("pitcher_id"));
|
|
Long pitcherId = ObjectUtil.objToLong(data.get("pitcher_id"));
|
|
Long gameId = ObjectUtil.objToLong(data.get("game_id"));
|
|
Long gameId = ObjectUtil.objToLong(data.get("game_id"));
|
|
|
|
+ if (sourceSystem.contains("ZX") || accountId == null || gameId == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
Map<String, Object> result = new HashMap<>();
|
|
result.put("account_id", accountId);
|
|
result.put("account_id", accountId);
|
|
@@ -253,25 +246,27 @@ public class PitcherAgentCDC {
|
|
try (SqlSession session = odsSqlSessionFactory.openSession(true)) {
|
|
try (SqlSession session = odsSqlSessionFactory.openSession(true)) {
|
|
BaseMapper mapper = session.getMapper(BaseMapper.class);
|
|
BaseMapper mapper = session.getMapper(BaseMapper.class);
|
|
|
|
|
|
- Map<String, Object> queryParams = new HashMap<>(6);
|
|
|
|
|
|
+ Map<String, Object> queryParam = new HashMap<>(6);
|
|
if (pitcherId != null) {
|
|
if (pitcherId != null) {
|
|
- queryParams.put("source_system", sourceSystem);
|
|
|
|
- queryParams.put("zx_pitcher_id", pitcherId);
|
|
|
|
- Map<String, Object> putUserMap = mapper.queryOne("t_pitcher_map", queryParams);
|
|
|
|
|
|
+ queryParam.put("source_system", sourceSystem);
|
|
|
|
+ queryParam.put("zx_pitcher_id", pitcherId);
|
|
|
|
+ Map<String, Object> putUserMap = mapper.queryOne("t_pitcher_map", queryParam);
|
|
|
|
+ queryParam.clear();
|
|
if (putUserMap != null) {
|
|
if (putUserMap != null) {
|
|
result.put("sys_put_user_name", putUserMap.get("zx_pitcher_name"));
|
|
result.put("sys_put_user_name", putUserMap.get("zx_pitcher_name"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (gameId != null) {
|
|
if (gameId != null) {
|
|
- queryParams.put("source_system", sourceSystem);
|
|
|
|
- queryParams.put("id", gameId);
|
|
|
|
- queryParams.clear();
|
|
|
|
- Map<String, Object> gameInfo = mapper.queryOne("t_game", queryParams);
|
|
|
|
|
|
+ queryParam.put("source_system", sourceSystem);
|
|
|
|
+ queryParam.put("id", gameId);
|
|
|
|
+ Map<String, Object> gameInfo = mapper.queryOne("t_game", queryParam);
|
|
|
|
+ queryParam.clear();
|
|
if (gameInfo != null) {
|
|
if (gameInfo != null) {
|
|
result.put("app_name", gameInfo.get("game_name"));
|
|
result.put("app_name", gameInfo.get("game_name"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
out.collect(new Tuple3<>("ad_account", sourceSystem, TransportMap.builder()
|
|
out.collect(new Tuple3<>("ad_account", sourceSystem, TransportMap.builder()
|
|
.tableName("ad_account")
|
|
.tableName("ad_account")
|
|
.primaryKeys(Collections.singletonList("account_id"))
|
|
.primaryKeys(Collections.singletonList("account_id"))
|