Commit 10ed45e2 authored by data爬虫-冯 军凯's avatar data爬虫-冯 军凯

设备指纹实时数据清洗增加传入数据源类型

parent 9ac7a242
...@@ -12,11 +12,11 @@ import com.lkb.data.hbase.row.MobileFingerPrintDataRow; ...@@ -12,11 +12,11 @@ import com.lkb.data.hbase.row.MobileFingerPrintDataRow;
*/ */
public class DeviceFingerInfoService { public class DeviceFingerInfoService {
public static void storageDeviceFingerInfo(MobileFingerPrintDataRow mobileFingerPrintDataRow, String uuid, boolean ka) { public static void storageDeviceFingerInfo(MobileFingerPrintDataRow mobileFingerPrintDataRow, String uuid, boolean ka, String type) {
MobileFingerPrintDataService.put(mobileFingerPrintDataRow); MobileFingerPrintDataService.put(mobileFingerPrintDataRow);
DeviceFingerInfoCleaningService.cleanningAndSaveDeviceFingersInfo(mobileFingerPrintDataRow, uuid, ka); DeviceFingerInfoCleaningService.cleanningAndSaveDeviceFingersInfo(mobileFingerPrintDataRow, uuid, ka, type);
} }
......
...@@ -178,7 +178,7 @@ public class DeviceFingerInfoCleaningService { ...@@ -178,7 +178,7 @@ public class DeviceFingerInfoCleaningService {
longColumns.add("systemUpTime"); longColumns.add("systemUpTime");
} }
public static void cleanningAndSaveDeviceFingersInfo(MobileFingerPrintDataRow mobileFingerPrintDataRow, String uuid, boolean ka) { public static void cleanningAndSaveDeviceFingersInfo(MobileFingerPrintDataRow mobileFingerPrintDataRow, String uuid, boolean ka, String type) {
ThreadPoolExecutorUtils.getThreadPoolUtil().execute(new Runnable() { ThreadPoolExecutorUtils.getThreadPoolUtil().execute(new Runnable() {
@Override @Override
...@@ -228,12 +228,12 @@ public class DeviceFingerInfoCleaningService { ...@@ -228,12 +228,12 @@ public class DeviceFingerInfoCleaningService {
paramList.add(list); paramList.add(list);
} catch (Exception e) { } catch (Exception e) {
log.error("设备指纹清洗异常, uuid: {} , ka: {} , param: {} ", uuid, ka, JSON.toJSONString(mobileFingerPrintDataRow)); log.error("设备指纹清洗异常, uuid: {} , ka: {} , type: {} , param: {} ", uuid, ka, type, JSON.toJSONString(mobileFingerPrintDataRow));
} }
JdbcExecuters.prepareBatchUpdate(Constant.SQL.DEVICE_FINGERS_INFOS, paramList); JdbcExecuters.prepareBatchUpdate(Constant.SQL.DEVICE_FINGERS_INFOS, paramList, type);
log.info("充值记录清洗完成, uuid: {} , 入库大小: {} , ka: {} , 耗时: {} ", uuid, 1, ka, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS)); log.info("充值记录清洗完成, uuid: {} , 入库大小: {} , type: {} , ka: {} , 耗时: {} ", uuid, 1, type, ka, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
} }
......
...@@ -73,7 +73,7 @@ public class JdbcExecuters { ...@@ -73,7 +73,7 @@ public class JdbcExecuters {
} }
} }
public static void prepareBatchUpdate(String sql, List<List<Object>> paramList) { public static void prepareBatchUpdate(String sql, List<List<Object>> paramList, String type) {
Connection conn = null; Connection conn = null;
PreparedStatement statement = null; PreparedStatement statement = null;
try { try {
...@@ -96,15 +96,15 @@ public class JdbcExecuters { ...@@ -96,15 +96,15 @@ public class JdbcExecuters {
} }
statement.addBatch(); statement.addBatch();
} catch (SQLException e) { } catch (SQLException e) {
log.error("设备指纹清洗数据批量插入数据SQL异常 , param: {} ", JSON.toJSONString(param), e); log.error("设备指纹清洗数据批量插入数据SQL异常 , type: {} , param: {} ", type, JSON.toJSONString(param), e);
} catch (Exception e) { } catch (Exception e) {
log.error("设备指纹清洗数据批量插入数据未知异常, param: {} ", JSON.toJSONString(param), e); log.error("设备指纹清洗数据批量插入数据未知异常, type: {} , param: {} ", type, JSON.toJSONString(param), e);
} }
} }
statement.executeBatch(); statement.executeBatch();
conn.commit(); conn.commit();
} catch (Exception e) { } catch (Exception e) {
log.error("设备指纹清洗数据批量插入数据未知异常, sql: {} ", sql, e); log.error("设备指纹清洗数据批量插入数据未知异常, type: {} , sql: {} ", type, sql, e);
} finally { } finally {
close(conn, statement, null); close(conn, statement, null);
} }
......
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